您的位置:首页 > 其它

impdp 使用network_link 迁移数据

2015-12-29 19:35 726 查看
create directory EXPDP as '/backup/expdp';

grant read,write on directory EXPDP tosystem;

 

将远端导出的备份集 按照某schema导入到新的schema and 新的shcema用户对应的表空间

先导出

expdp system/Oracle2015  directory=EXPDP schemas=platdumpfile=20151227expplat.dmp logfile=20151227expplat.log

 

目标库导入

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

impdp system/oracle  directory=EXPDP dumpfile=20151227expplat.dmpschemas=center remap_schema=center:centernew tablespace=plattbs:centerlogfile=imp1.log

 

 

同一个数据库,将用户A的所有对象 导入到B用户及保存在B的默认表空间

0、add the tnsname

1、Create public Database Link link_self Connect To system IdentifiedBy oracle Using 'rpdm';  create the  link using system user.

2、create tablespace new datafile '+DATA' size 50M;

3、create user new identified by new default tablespace new;

4、export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

5、impdp system/oracle directory=EXPDP network_link=link_selfschemas=centernew remap_schema=centernew:new remap_tablespace=center:new  logfile=test01.log

6、alter user centernew account lock;

7、alter tablespace center offline;

 

同一个数据库,将A用户的对象使用network_link导出。

0、add the tnsname

1、Create public Database Link link_self Connect To system IdentifiedBy oracle Using 'rpdm';  create the  link using system user.

2、create tablespace new datafile '+DATA' size 50M;

3、create user new identified by new default tablespace new;

4、export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

5、expdp system/oracle directory=EXPDP network_link=link_selfschemas=new dumpfile=expnew.dmp logfile=expnew.log

 

等效于这个

expdp system/oracle directory=EXPDPschemas=new dumpfile=expnew.dmp logfile=expnew.log

 

 

将远端数据库中的schemas导入到本地中

1、add tns prodracdb

2、Create public Database Link link_prod1011 Connect To systemIdentified By RPal218system Using 'prodracdb';

3、export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

4、impdp system/Oracle2015 directory=EXPDP network_link=link_prod1011PARALLEL=16 schemas=bossdd,accountxx,chargeaa logfile=201513061946balldb.log

一定要注意

chemas=bossdd,accountxx,chargeaa 中的用户 在目标数据库(当前)中是没有的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: