清理NOT RUNNING的master表:
select 'drop table '||OWNER_NAME||'.'||JOB_NAME||' purge;' from dba_datapump_jobs where STATE='NOT RUNNING';
--执行结果用来执行,再次查看结果为空:
SQL> select * from dba_datapump_jobs;
no rows selected
按MOS建议,将导出任务移动到本地文件系统:
AIX源端导出XTTS源数据至源端/hxbak/xtts_exp目录中,而后copy至nfs共享存储/xtts/dmp中:
mkdir /hxbak/xtts_exp
chown oracle:dba /hxbak/xtts_exp
ls -ld /hxbak/xtts_exp
select * from dba_directories;
create or replace directory XTTS as '/hxbak/xtts_exp';
此时测试expdp任务可正常运行:
$ expdp \'/ as sysdba\' directory=XTTS tables=query.test dumpfile=query_test.dmp logfile=query_test.log
Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 01 November, 2018 16:03: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, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TABLE_01": '/******** AS SYSDBA' directory=XTTS tables=query.test dumpfile=query_test.dmp logfile=query_test.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 8 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "QUERY"."TEST" 6.743 MB 72593 rows
Master table "SYS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_TABLE_01 is:
/hxbak/xtts_exp/query_test.dmp
Job "SYS"."SYS_EXPORT_TABLE_01" successfully completed at 16:03:57
SQL> select * from dba_datapump_jobs;
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
---------- ------------------------------ --------------- ------------------------------ --------------- ---------- ----------------- -----------------
SYS SYS_EXPORT_TABLE_01 EXPORT TABLE EXECUTING 1 1 3
再次导出其他元数据:
#expdp_xtts.sh (about 5min)
nohup sh expdp_xtts.sh &
#expdp_xtts_other.sh(about 5min)
nohup sh expdp_xtts_other.sh &
#expdp_tmp_table
nohup sh expdp_tmp_table01.sh &
nohup sh expdp_tmp_table02.sh &
nohup sh expdp_tmp_table03.sh &
nohup sh expdp_tmp_table04.sh &
最后将这些导出文件再移动到/xtts/dmp/下,供后续xtts测试目标端导入使用:
$ pwd
/hxbak/xtts_exp
$ cp -rp * /xtts/dmp/
目标端导入时只需要有读这些文件的权限,即可,实际测试恢复OK。