Thursday 15 January 2015

plsql - How can I generate (or get) a ddl script on an existing table in oracle? I have to re-create them in Hive -



plsql - How can I generate (or get) a ddl script on an existing table in oracle? I have to re-create them in Hive -

how can generate ddl script on existing table in oracle? working on project have re-create tables nowadays in oracle table hive.

if sql client doesn't back upwards this, can utilize dbms_metadata bundle source in database:

for table utilize this:

select dbms_metadata.get_ddl('table', 'your_table_name') dual;

you can tables @ once:

select dbms_metadata.get_ddl('table', table_name) user_tables;

and spool output sql script.

more details in manual: http://docs.oracle.com/cd/e11882_01/appdev.112/e40758/d_metada.htm

oracle plsql ddl

No comments:

Post a Comment