码迷,mamicode.com
首页 > 其他好文 > 详细

数据泵如何生成导出文件的DDL脚本

时间:2016-05-03 12:29:09      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:

    在使用exp/imp时,生成对应dumpfile文件的DDL脚本非常容易,在使用命令imp时,添加参数show, show=y表示展示imp导入的时候,输出相关DDL语句(不包括insert语句),而不会真正的在数据库中执行.其实使用数据泵(expdp/impdp)也能生成对应导出dumpfile的DDL语句,参数为sqlfile。如果添加了参数sqlfile就会生成对应dumpfile的SQL DDL脚本,impdp不会真正执行数据导入。

 

SQLFILE Write all the SQL DDL to a specified file.

If you use sqlfile parameter, impdp will not actulally perform the import process, rather it will generate all DDL that are supposed to be executed by impdp in the sqlfile you specified.

 

可以使用类似下面脚本生成对应的SQL DDL脚本:

nohup impdp ‘userid="/ as sysdba"‘ directory=dump_dir full=y dumpfile=full_20160501.dmp logfile=test.log sqlfile=db_ddl.sql &

数据泵如何生成导出文件的DDL脚本

标签:

原文地址:http://www.cnblogs.com/kerrycode/p/5454247.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!