• 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;

       
  • 相关阅读:
    C#(winform)浏览按钮
    C#操作CSV存取类
    忘记windows的登陆密码
    exe文件打开方式(恢复EXE文件关联)
    MongoDB 搭建副本集
    Performance Monitor3:监控SQL Server的内存压力
    大数据操作:删除和去重
    SSRS配置2:加密管理
    SSISDB7:当前正在运行的Package及其Executable
    不再迷惑,无值和NULL值
  • 原文地址:https://www.cnblogs.com/zhanglin123/p/13225100.html
Copyright © 2020-2023  润新知