patternMinor
exporting oracle tables on command line as sql files
Viewed 0 times
tableslineexportingsqlfilescommandoracle
Problem
I use exp and expdp to export database tables on command line but it generates binary .dmp files. I want to export/import tables as .sql* files on command line like pl/sql developer app can do. Is there a specific command for this or extra parameters for exp/expdp?
*sql files must contain table creation scripts and insert statements.
Thanks.
*sql files must contain table creation scripts and insert statements.
Thanks.
Solution
You can generate DDL statements using imp/impdp utilities:
But this method will generate just schema DDL. INSERT statements will not be generated.
imp user/passwd file=export.dmp show=y log=export.sql 2> /dev/null
impdp user/passwd file=DIR:export.expdp sqlfile=DIR:export2.sqlBut this method will generate just schema DDL. INSERT statements will not be generated.
Code Snippets
imp user/passwd file=export.dmp show=y log=export.sql 2> /dev/null
impdp user/passwd file=DIR:export.expdp sqlfile=DIR:export2.sqlContext
StackExchange Database Administrators Q#58635, answer score: 2
Revisions (0)
No revisions yet.