Home » SQL & PL/SQL » SQL & PL/SQL » creating backup copy of view
creating backup copy of view [message #196001] Tue, 03 October 2006 10:32 Go to next message
sunal
Messages: 2
Registered: October 2006
Junior Member
I got to write a script that automatically saves the DDL of view into a file and then write backout script to create or replace view with the one I already backed up.

To make it clear, here is the scenario:

I need to create a backup of a view VW_XYZ and save it in a file or a table as VW_XYZ_BUP. ---how do i write backup script using TOAD.

After this I made all the necessary modifications in VW_XYZ
But, now I don't want those changes.

So, I want to get the original script from VW_XYZ_BUP.

For this, how do I write a backout script.

I want the script to do the job of both backup and backout automatically.
Re: creating backup copy of view [message #196002 is a reply to message #196001] Tue, 03 October 2006 10:47 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
Obtain the SQL for the view by querying sys.dba_views and save it to a file.
Re: creating backup copy of view [message #196008 is a reply to message #196002] Tue, 03 October 2006 11:51 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
In the TOAD browser, you can save the DDL firectly from the Script tab.

Re: creating backup copy of view [message #196077 is a reply to message #196008] Wed, 04 October 2006 01:22 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Better still: do it the other way around.
Create scripts to create db-objects. Store these in some version-repository and work on those.
imho development of a production system SHOULD work that way.
Previous Topic: ora-00600;internal error code,arguments:[ktbdchk1:baddscn],[],[],[]
Next Topic: Decode statement
Goto Forum:
  


Current Time: Wed Dec 07 20:18:18 CST 2016

Total time taken to generate the page: 0.10950 seconds