打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
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;

     
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
oracle11g数据库逻辑备份与恢复
expdp\impdp及exp\imp
Oracle数据库expdp用法以及注意事项
expdp和impdp的用法
.Net程序员学用Oracle系列(19):导出、导入(备份、还原)
EXPDP 数据泵介绍
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服