zoukankan      html  css  js  c++  java
  • expdp/impdp 数据泵导入导出

    1. create directory mydata as '逻辑目录路径';
    2. 例如: 
    3. create directory mydata as '/data/oracle/oradata/mydata';
      grant read,write on directory mydata to public
      select * from dba_directories
      expdp 用户名/密码@ip地址/实例  [属性]
      ip地址不写默认就是本地

      userid=test/test            --导出的用户,本地用户!!
      directory=dmpfile          --导出的逻辑目录,一定要在oracle中创建完成的,并且给用户授权读写权限
      dumpfile=xx.dmp      --导出的数据文件的名称,如果想在指定的位置的话可以写成dumpfile=/home/oracle/userxx.dmp
      logfile=xx.log          --日志文件,如果不写这个参数的话默认名称就是export.log,可以在本地的文件夹中找到
      schemas=userxx       --使用dblink导出的用户不是本地的用户,需要加上schema来确定导出的用户,类似于exp中的owner,但还有一定的区别
      EXCLUDE=TABLE:"IN('T1','T2','T3')"     --exclude 可以指定不导出的东西,table,index等,后面加上不想导出的表名
      network_link=db_local          --这个参数是使用的dblink来远程导出,需要指定dblink的名称

      列出一些场景:

      1)导出用户及其对象
      expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp directory=dump_dir logfile=expdp.log;

      2)导出指定表
      expdp scott/tiger@orcl tables=emp,dept dumpfile=expdp.dmp directory=dump_dir logfile=expdp.log;

      3)按查询条件导
      expdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp tables=empquery='where deptno=20' logfile=expdp.log;

      4)按表空间导
      expdp system/manager@orcl directory=dump_dir dumpfile=tablespace.dmp tablespaces=temp,example logfile=expdp.log;

      5)导整个数据库
      expdp scott/123@127.0.0.1/orcl directory=dump_dir dumpfile=ly.dmp full=y  logfile=expdp.log;

      6)导入指定表

      impdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp table_exists_action=replace;

       
  • 相关阅读:
    MVVM MVC
    ASP.NET MVC中使用Bundle打包压缩js和css的方法
    BundleConfig的作用
    MVC中使用BundleConfig.RegisterBundles引用Css及js文件发布后丢失的问题
    Java面试题-1
    C语言程序设计I—寒假作业
    跟奥巴马一起画方块
    201655222第三周课上作业补做
    20165222第二周学习总结
    20165222第一周课上测试补做
  • 原文地址:https://www.cnblogs.com/zhanglin123/p/13225100.html
Copyright © 2011-2022 走看看