如何獲取expdp出來的dmp檔案中的DDL語句

tolywang發表於2015-04-01
Data Pump sqlfile parameter tips 

Oracle Tips by Burleson Consulting
July 21, 2010

Question:  In the old import utility we were able to use "show=y" to see the DDL contents of an export dump file.  What is the equivalent in Data Pump?

Answer:  In Data Pump import (impdp) made several great improvements:

The dump file is now in XML, and you can browser a dump file to see the contents.
The show=y has been replaced by the sqlfile argument.
Here is an example of using the sqlfile parameter with impdp to display the DDL within an Data Pump Export (expdp) file named myexp.dmp:

$ impdp directory=expdir dumpfile=myexp.dmp sqlfile=ddl.sql     ---  使用這個引數可以列印出DDL , 加入了這個引數後,impdp不會實際執行 。如果需要執行,需要去掉這個引數。

In this example, the impdp does not actually perform an import of the contents of the dump file.  Rather, the sqlfile parameter create a script named ddl.sql that contains all DDL from within the export dump file.
Also see how using the sqlfile parameter is useful when gathering arguments for the dbms_datapump metadata_remap procedure.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-1481091/,如需轉載,請註明出處,否則將追究法律責任。

相關文章