问题描述:oracle数据泵导出数据时报错ORA-39095,如下所示:
数据库:oracle 19.7
1、告警信息
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting "SYSTEM"."FANYU#ZZZ_AOTML_API_EDW_1218#expdp.#job":  system/********@192.168.133.16:1521/tmis tables=FANYU.ZZZ_AOTML_API_EDW_1218 CONTENT=DATA_ONLY job_name=FANYU#ZZZ_AOTML_API_EDW_1218#expdp.#job dumpfile=FANYU.ZZZ_AOTML_API_EDW_1218.tmis.dpdmp DIRECTORY=expdp_linshi01_dir EXCLUDE=INDEX,TRIGGER parallel=8 logfile=expdp_FANYU#ZZZ_AOTML_API_EDW_1218.tmis.out 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-39095: Dump file space has been exhausted: Unable to allocate 8192 bytes
Job "SYSTEM"."FANYU#ZZZ_AOTML_API_EDW_1218#expdp.#job" stopped due to fatal error at Tue Sep 24 21:49:10 2024 elapsed 0 00:00:14


Export: Release 19.0.0.0.0 - Production on Tue Sep 24 21:55:15 2024
Version 19.7.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting "SYSTEM"."FANYU#ZZZ_AOREW_AP_CER_1219#expdp.#job":  system/********@192.168.133.16:1521/tmis tables=FANYU.ZZZ_AOREW_AP_CER_1219 CONTENT=DATA_ONLY job_name=FANYU#ZZZ_AOREW_AP_CER_1219#expdp.#job dumpfile=FANYU.ZZZ_AOREW_AP_CER_1219.tmis.dpdmp DIRECTORY=expdp_linshi01_dir EXCLUDE=INDEX,TRIGGER parallel=8 logfile=expdp_FANYU#ZZZ_AOREW_AP_CER_1219.tmis.out 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-39095: Dump file space has been exhausted: Unable to allocate 8192 bytes
Job "SYSTEM"."FANYU#ZZZ_AOREW_AP_CER_1219#expdp.#job" stopped due to fatal error at Tue Sep 24 21:55:31 2024 elapsed 0 00:00:15

2、异常排查
2.1、查表大小
OWNER           SEGMENT_NAME                                  SEGMENT_TYPE       BYTES/1024/1024
--------------- --------------------------------------------- ------------------ ---------------
FANYU           ZZZ_AOTML_API_EDW_1218                        TABLE                        15916
FANYU           ZZZ_AOREW_AP_CER_1219                         TABLE                        13824

2.2、导出脚本
[oracle@cldbs olm]$ cat expdp_nopartition_table.sh
#!/bin/bash
source ~/.bash_profile
{
cat expdp_nopartition_table.txt|while read line
do
   TABLE_NAME=`echo $line|awk '{print $2}'`
   USER_NAME=`echo $line|awk '{print $1}'`
  expdp system/tiger@10.191.180.151:1521/tmis  tables=$USER_NAME.$TABLE_NAME COMPRESSION=all job_name=$USER_NAME#$TABLE_NAME#expdp.#job dumpfile=$USER_NAME.$TABLE_NAME.tmis.dpdmp DIRECTORY=expdp_linshi_dir EXCLUDE=INDEX,TRIGGER parallel=2 logfile=expdp_$TABLE_NAME.tmis.out
done
}

说明:两张表大小分别为15g和13g,导出的单个dump文件过大导致出现ORA-39095告警.

3、解决方案
[oracle@cldbs olm]$ cat expdp_nopartition_table_error.sh
#!/bin/bash
source ~/.bash_profile
{
for TABLE_NAME in ZZZ_AOTML_API_EDW_1218 ZZZ_AOREW_AP_CER_1219 
do
  expdp system/tiger@10.191.180.151:1521/tmis tables=FANYU.$TABLE_NAME CONTENT=DATA_ONLY job_name=FANYU#$TABLE_NAME#expdp_02.#job COMPRESSION=all dumpfile=FANYU.$TABLE_NAME.tmis_%U.dpdmp filesize=500M cluster=n DIRECTORY=expdp_linshi_dir EXCLUDE=INDEX,TRIGGER parallel=4 logfile=expdp_FANYU#$TABLE_NAME.tmis.out
done
}

说明:修改expdp脚本,将dmp文件拆分为多个,且设置单个备份集大小为500M,此后异常不在发生.