数据泵联合dblink 使用场景

一 、 expdp可以通过dblink来实现把导出文件直接放在客户端

1、在客户端数据库创建db link和要保存数据文件的目录(在system 用户下操作)

create database link fbfj
  connect to system identified BY ora1Q23$AZ 
  using '(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = fbfj)
    )
  )';

create directory dir_test as '/oradata/dmptest';

2、在客户端发布命令


 expdp 'system/"ora1Q23$AZ"' schemas= USR_Q9FJ directory=dir_test network_link=fbfj dumpfile=fbfj%U.dmp logfile=fbfj.log  parallel=4


二、expdp + dblink 与expdp +nfs 比较

1、expdp + dblink 

[.com_oracle:/oradata/dmptest$ expdp 'system/"ora1Q23$AZ"' schemas= USR_Q9FJ directory=dir_test network_link=fbfj dumpfile=fbfj%U.dmp logfile=fbfj.log  parallel=2

Export: Release 11.2.0.3.0 - Production on Mon Aug 24 16:17:24 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** schemas= directory=dir_test network_link=fbfj dumpfile=fbfj%U.dmp logfile=fbfj.log parallel=2 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 93.67 GB
Processing object type SCHEMA_EXPORT/USER
<pre name="code" class="html">Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /oradata/dmptest/fbfj01.dmp
  /oradata/dmptest/fbfj02.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:32:02


 dmp 文件为 82G ,用时 70分钟 

2、 expdp +nfs 

nfs 参数:

10.9.:/Data        /tmpdata        nfs     rsize=32768,wsize=32768,hard,nointr,rw,bg,vers=3,tcp,noac,nolock,actimeo=0,timeo=600 0 0

Export: Release 10.2.0.4.0 - 64bit Production on Monday, 17 August, 2015 11:18:21

Copyright (c) 2003, 2007, Oracle.  All rights reserved.
;;; 
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_04":  system/******** schemas= USR_Q9FJ directory=dir_hlb dumpfile=fbfj_%U.dmp logfile=fbfj.log parallel=2 flashback_scn=1463086658 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 84.48 GB
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_04 is:
  /tmpdata/fbfj_01.dmp
  /tmpdata/fbfj_02.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_04" successfully completed at 12:37:44
[oracle@oradb1 tmpdata]$ 


dmp 文件 72G ,用时 80分钟。


从上可以看出当paralle 为 2 的时候,expdp + dblink  的性能优于 expdp + nfs




三、impdp +dblink 实现不落地导入

条件跟(一) 一样


[oracle@qs-oradb1 ~]$   impdp  'system/"ora1Q23$AZ"' schemas= USR_Q9FJ network_link=fbfj  flashback_scn= 6387059556023 parallel=2

Import: Release 11.2.0.4.0 - Production on Mon Aug 24 20:47:35 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/******** schemas= network_link=fbfj flashback_scn= parallel=2 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 94.50 GB
<pre name="code" class="html">Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at Mon Aug 24 22:32:53 2015 elapsed 0 01:45:17


 

耗时 100分钟 。


单独导入 需要30 分钟,所以 expdp + dblink +impdp 与 impdp + dblink的 效率差不多,但是优于  expdp + nfs + impdp ,但是 impdp + dblink 方法最省事。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

huangliang0703

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值