Scripting Oracle Objects

I was recently given an existing oracle database in which I want to script to dump various objects and my static data so that I can host the objects under source control and rebuild the database from scratch if necessary.

Does anyone have any scripts or tools I could look out for to help me.

+1


a source to share


3 answers


I would look at something like: select dbms_metadata.get_ddl (object_type, object_name, owner) from dba_objects. Insert it into PL / SQL Procedure to write each DDL object to its own file using UTL_FILE.



+5


a source


For the tools I would recommend Oracle SQL Developer , it has both automatic scripting for objects and supports some version control utilities (CVS and Subversion).



+1


a source


I would tend to use either EXPORT / IMPORT (if any version is up to 11g inclusive) or DATA PUMP (if 11g and possibly 10G)

At the command line on the server, enter "exp help = Y" and you should have sufficient details about the options. Decide if you want the whole DB or one schema, data or not, etc.

0


a source







All Articles