您的位置:首页 > 其它

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

2016-05-03 11:09 375 查看
在使用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 &
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: