zoukankan      html  css  js  c++  java
  • 数据泵如何生成导出文件的DDL脚本

        在使用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 &

  • 相关阅读:
    Debian9 升级至 Debian10
    FastApi学习(二)
    FastApi学习(一)
    uber_go_guide解析(三)(规范)
    uber_go_guide解析(二)
    uber_go_guide解析(一)
    Docker踩过的坑
    Goland 设置代码格式化
    Nginx集成Naxsi防火墙
    ubuntu14中配置tomcat8
  • 原文地址:https://www.cnblogs.com/kerrycode/p/5454247.html
Copyright © 2011-2022 走看看