oracle中expdp,oracle的expdp和impdp

expdp impdp

1、创建目录

create directory expdp as '/u02/';

2、授权用户访问此目录

grant read,write on directory expdp to scott;

expdp scott/tiger dumpfile=scott.emp directory=expdp

schemas=SCOTT;

expdp scott/tiger dumpfile=scott.bak directory=expdp

tables=emp,dept;

expdp scott/tiger dumpfile=expdp:scott.emp

tables=emp,dept;

expdp \'sys/oracle as sysdba\' full=y

dumpfile=exp:full.bak

--direatory谁建立谁本身就有权限,怒需要单独分配

drop table scott.emp purge;

drop table scott.dept purge;

impdp scott/tiger dumpfile=expdp:scott.bak

tables=emp,dept;

select * from tab;

--append追加

delete emp;

impdp scott/tiger dumpfile=expdp:scott.bak tables=emp;

--skip跳过表,不会导入数据

impdp scott/tiger dumpfile=expdp:scott.bak tables=emp

table_exists_action=append;

--replace替换数据不释放空间

update emp set sal=sal+100;

cmomit;

impdp scott/tiger dumpfile=expdp:scott.bak tables=emp

table_exists_action=replace;

--truncate释放空间后插入数据

update emp set sal=sal+1;

cmomit;

impdp scott/tiger dumpfile=expdp:scott.bak tables=emp

table_exists_action=truncate;

--skip 无则加入,有则跳过

drop table scott.salgrade purge;

impdp scott/tiger dumpfile=expdp:scott.emp

tables=emp,dept.salgrade table_exists_action=skip;

--参数文件模式

userid=scott/tiger

dumpfile=expdp:scott.dmp

table_exists_action=truncate

impdp parfile=/u02/dp.txt

--remap_schema从A用户到B用户

impdp system/oracle dumpfile=expdp:scott.bak

remap_schema=scott:qin;

eg:

expdp system/oracle directory=dump_qin dumpfile=qin_%U.dmp

logfile=expdp_qin.log schemas=(wang,qin)

impdp system/oracle directory=dump_qin

dumpfile=qin_%U.dmp logfile=impdp_qin.log

schemas=(wang,qin)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值