Search code examples
sqlsql-server-2005oracle-databaseoracle10gdata-migration

generate database & tables schema (ddl) on Oracle pl-sql


Anyone have a PL-SQL statement that i can use to generate database & tables schema for specific database on Oracle 10g? I need the schema in .sql file and if possible compatible with ANSI-92/99 sql implementation, so i can use the generated .sql directly on sql server 2005.

Already heard about exp/imp, but it seems generated dump file, what i need just a simple ddl on .sql file.

Thanks


Solution

  • I wrote oraddlscript which calls dbms_metadata.get_ddl (Pop's answer) for each database object owned by a user and writes the DDL to a file.

    Update: Answered comment