convert expdp dmp file to SQL DDL statements

convert expdp dmp file to SQL DDL statements

Oracle Database Tips by Donald BurlesonApril 7, 2016

Question:  I want to take an export dmp file and convert it into the native SQL statements.  Can I convert a dmp file using the sqlfile option?

Answer:  You cannot convert an existing dmp file because of its internal format, but you can re-run the impdp to get the SQL DDL statements from a Data Pump dmp file with this sqlfile command:

impdp scott/tiger directory=dir_name dumpfile=myfile sqlfile=xyz.sql

This sqlfile option will create a myfile file in the dir_name directory with the DDL statements.

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

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.

posted @   耀阳居士  阅读(258)  评论(0编辑  收藏  举报
编辑推荐:
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示