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;

       
  • 相关阅读:
    【iOS开发-从网络上获取图片尺寸】
    【iOS开发之静态库、动态库】
    【iOS开发之OC和JS互调】
    【iOS之runtime、runloop】
    【iOS开发之C语言】sprintf,strncpy,strcmp三个函数的区别
    计算机中的存储单位
    linux命令行
    python的安装
    Java的跨平台特性
    方法的重写(override)两同两小一大原则:
  • 原文地址:https://www.cnblogs.com/zhanglin123/p/13225100.html
Copyright © 2011-2022 走看看