views:

50

answers:

3

Hi all Gurus

Here is my problem, I wants to create a baseline on our development Dateabase (Oracle 10g), and check into our svn for version control, and after this we will use liquibase to help us manage the incremental database changes.

My problem is how should I create baseline of Oracle 10g? the database now consists of 500+ tables, with large amount of configuration data, and I wants my db baseline to base on a set SQL scripts to check into subversion, rather then check in Oracle dump..

I have try use liquibase generateChangeLog, but it have some performance problem.. can anyone can recommends me any tools that will help me 1. Scan any Oracle Schema 2. Generate a set of SQL Scripts (With Table structures, and Data)..

Thanks in advance

James!

+1  A: 

Have you tried Oracle's free SQLDeveloper tool? It gives you the possibility of exporting DDL and data.

Rene
A: 

EXPDP with CONTENT=METADATA_ONLY option, then IMPDP with SQLFILE=your_script.sql ?

Nicolas.

N. Gasparotto
+1  A: 

Something like

SELECT DBMS_METADATA.GET_DDL('TABLE',table_name) FROM USER_TABLES;

is a good start. You can tweak it with PL/SQL and UTL_FILE to get it to write each table to a different file. You will probably need to do sequences too (though versioning them is fairly pointless), and maybe triggers/procedures/functions/packages etc.

Don't forget grants.

Gary
Can you use PL/SQL and this query to export the DDL to a file on the client side?
Derek Mahar
The DB server can't write client files (unless you go to the hassle of sharing and mounting the drive, effectively making the client a file server).
Gary