【EXPDP】Oracle expdp中并行问题

来源:互联网 发布:北京数据分析师招聘 编辑:程序博客网 时间:2024/06/10 05:41
$ expdp hr/hr tables=test1 dumpfile=test2.dmp directory=pump parallel=4


Export: Release 11.2.0.4.0 - Production on Sat Jul 1 05:11:29 2017


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, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "HR"."SYS_EXPORT_TABLE_01":  hr/******** tables=test1 dumpfile=test2.dmp directory=pump parallel=4 
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 8.687 GB
Processing object type TABLE_EXPORT/TABLE/TABLE

ORA-39095: Dump file space has been exhausted: Unable to allocate 8192 bytes


如果设置 EXPDP parallel=4 必须要设置4个EXPDP文件,不然PARALLEL是有问题的,同时EXPDP会使用一个WORKER进程导出METADATA,其他WORKER进程会同时出数据,如果EXPDP作业很于250M 只会启动一个WORKER进程如果是500M会启动2个,1000M及会启动4个WOKER进程,一般来说加上%U来设置多个文件。
而IMPDP有所不同,会先启动一个WOKER进程METADATA导入,然后启动多个WORKER进程导入,所以再前期只会看到WOKER在导入METADATA,而且IMPDP如果PARALLE=4也需要>=4个DMP文件,也可以使用%U来进行导入。
expdp system/****  PARALLEL=2 JOB_NAME=full_bak_job full=y dumpfile=exptest:back_%U.dmp logfile=exptest:back.log &
impdp system/*** PARALLEL=2 EXCLUDE=STATISTICS JOB_NAME=full_imp cluster=no full=y dumpfile=test:back_%U.dmp  logfile=test:back_imp.log;
而在11GR2后EXPDP 和 IMDP的WORKER进程会在多个INSTANCE启动,所以DIRECTORY必须在共享磁盘上,如果没有设置共享磁盘还是指定cluster=no 来防止报错。