并行导出clob大表

脚本参考:

SQL> desc MEDICAL_CHECK_SYSINFO_H
 Name                                               Null?    Type
 ----------------------------------------------------------------------------------------- -------- ------------------------------------------------------------
 ID                                               NOT NULL NUMBER(10)
 REGISTER_NO                                           NOT NULL VARCHAR2(50 CHAR)
 PATIENT_ID                                           NOT NULL NUMBER(10)
 ORG_CODE                                           NOT NULL VARCHAR2(50 CHAR)
 MICODE                                            NOT NULL VARCHAR2(50 CHAR)
 ICNO                                               NOT NULL VARCHAR2(50 CHAR)
 SERVER_DATE                                           NOT NULL TIMESTAMP(9)
 ALLOW_QUERY_FLAG                                       NOT NULL NUMBER(10)
 SIGNINFO                                           NOT NULL VARCHAR2(50 CHAR)
 RAW_DATA                                                CLOB
 

查看导出job:

SET lines 200 
COL owner_name FORMAT a10;
COL job_name FORMAT a20;
COL state FORMAT a12;
COL operation LIKE state;
COL job_mode LIKE state;
COL owner.object for a50;
 
-- locate Data Pump jobs: 
SELECT owner_name, job_name, rtrim(operation) "OPERATION", 
    rtrim(job_mode) "JOB_MODE", state, attached_sessions
FROM dba_datapump_jobs
 WHERE job_name NOT LIKE 'BIN$%'
 ORDER BY 1,2; 

SELECT o.status, o.object_id, o.object_type, 
       o.owner||'.'||object_name "OWNER.OBJECT" 
  FROM dba_objects o, dba_datapump_jobs j 
 WHERE o.owner=j.owner_name AND o.object_name=j.job_name 
   AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;

异常终止expdp处理:

expdp xxx/xxx@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:\"where mod\(dbms_rowid.rowid_block_number\(rowid\), 10\) = 7\" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_7.dmp logfile=log_test_7.log 

SQL> SET lines 200 
COL owner_name FORMAT a10;
COL job_name FORMAT a20;
COL state FORMAT a12;
COL operation LIKE state;
COL job_mode LIKE state;
COL owner.object for a50;

SQL> SELECT o.status, o.object_id, o.object_type, 
       o.owner||'.'||object_name "OWNER.OBJECT" 
  FROM dba_objects o, dba_datapump_jobs j 
 WHERE o.owner=j.owner_name AND o.object_name=j.job_name 
   AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;  2    3    4    5  

STATUS	 OBJECT_ID OBJECT_TYPE
------- ---------- -----------------------
OWNER.OBJECT
--------------------------------------------------------------------------------
VALID	     94147 TABLE
xxx.SYS_EXPORT_TABLE_10

SQL> -- locate Data Pump jobs: 
SQL>SELECT owner_name, job_name, rtrim(operation) "OPERATION", 
    rtrim(job_mode) "JOB_MODE", state, attached_sessions
FROM dba_datapump_jobs
 WHERE job_name NOT LIKE 'BIN$%';

OWNER_NAME JOB_NAME		OPERATION    JOB_MODE	  STATE        ATTACHED_SESSIONS
---------- -------------------- ------------ ------------ ------------ -----------------
xxx	   SYS_EXPORT_TABLE_10	EXPORT	     TABLE	  STOP PENDING		       0

SQL> /

OWNER_NAME JOB_NAME		OPERATION    JOB_MODE	  STATE        ATTACHED_SESSIONS
---------- -------------------- ------------ ------------ ------------ -----------------
xxx	   SYS_EXPORT_TABLE_10	EXPORT	     TABLE	  STOP PENDING		       0

SQL> /

OWNER_NAME JOB_NAME		OPERATION    JOB_MODE	  STATE        ATTACHED_SESSIONS
---------- -------------------- ------------ ------------ ------------ -----------------
xxx	   SYS_EXPORT_TABLE_10	EXPORT	     TABLE	  STOPPING		       0

SQL> /

no rows selected

SQL> SELECT o.status, o.object_id, o.object_type, 
       o.owner||'.'||object_name "OWNER.OBJECT" 
  FROM dba_objects o, dba_datapump_jobs j 
 WHERE o.owner=j.owner_name AND o.object_name=j.job_name 
   AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;   2    3    4    5  

no rows selected



[oracle@rac1 dmp]$ expdp xxx/xxx@xxxdb attach=SYS_EXPORT_TABLE_10

Export: Release 19.0.0.0.0 - Production on Sat Jun 19 13:11:41 2021
Version 19.11.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

Job: SYS_EXPORT_TABLE_10
  Owner: xxx                            
  Operation: EXPORT                         
  Creator Privs: TRUE                           
  GUID: C5186FACCC327C75E053820AA8C04187
  Start Time: Saturday, 19 June, 2021 13:08:53
  Mode: TABLE                          
  Instance: xxx1
  Max Parallelism: 1
  Timezone: +00:00
  Timezone version: 32
  Endianness: LITTLE
  NLS character set: ZHS16GBK
  NLS NCHAR character set: AL16UTF16
  EXPORT Job Parameters:
  Parameter Name      Parameter Value:
     CLIENT_COMMAND        xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 7" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_7.dmp logfile=log_test_7.log 
     TRACE                 0
  State: STOP PENDING                   
  Bytes Processed: 0
  Current Parallelism: 1
  Job Error Count: 0
  Job heartbeat: 112
  Dump File: /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_7.dmp
    bytes written: 32,768
  
Worker 1 Status:
  Instance ID: 1
  Instance name: xxx1
  Host name: rac1
  Object start time: Saturday, 19 June, 2021 13:09:17
  Object status at: Saturday, 19 June, 2021 13:09:17
  Process Name: DW03
  State: EXECUTING                      
  Object Schema: xxx
  Object Name: MEDICAL_CHECK_SYSINFO_H
  Object Type: TABLE_EXPORT/TABLE/TABLE_DATA
  Completed Objects: 1
  Total Objects: 1
  Completed Rows: 163,321
  Worker Parallelism: 1

Export> kill_job
Are you sure you wish to stop this job ([yes]/no): yes

查看lob表大小:

select a.owner,a.table_name,a.column_name,b.segment_name,ROUND(b.BYTES / 1024 / 1024)
  from dba_lobs a, dba_segments b
 where a.segment_name = b.segment_name
   and a.owner = 'XXX'
   and a.table_name = 'MEDICAL_CHECK_SYSINFO_H'
union all
select a.owner,a.table_name,a.column_name,b.segment_name,ROUND(b.BYTES / 1024 / 1024)
  from dba_lobs a, dba_segments b
 where a.index_name = b.segment_name
   and a.owner = 'XXX'
   and a.table_name = 'MEDICAL_CHECK_SYSINFO_H'
union all
select a.owner,'','',a.segment_name,ROUND(sum(a.BYTES) / 1024 / 1024)
  from dba_segments a
 where a.owner = 'XXX'
   and a.segment_name = 'MEDICAL_CHECK_SYSINFO_H' group by a.owner,a.segment_name;

1.sh内容:注意i必须从0开始

导出:
#!/bin/bash
chunk=10
for ((i=0;i<=9;i++));
do
expdp xxx/xxx@xxxTABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:\"where mod\(dbms_rowid.rowid_block_number\(rowid\)\, ${chunk}\) = ${i}\" directory=DMP cluster=N exclude=statistics dumpfile=MEDICAL_CHECK_SYSINFO_H_${i}.dmp logfile=log_test_${i}.log &
echo $i
sleep 2  #不加延迟2秒,将导致输出太快报错ORA-31626: job does not exist
done

导入:需要先导入元表结构并排除索引exclude=index,constraint,trigger,statistics,然后执行下面脚本导入content=data_only最后导入include=index,constraint,trigger,statistics

#!/bin/bash
chunk=10
for ((i=0;i<=9;i++));
do
impdp xxx/xxx@xxx  directory=DMP REMAP_TABLE=MEDICAL_CHECK_SYSINFO_H:MEDICAL_CHECK_SYSINFO_H  remap_schema=xxx:target dumpfile=MEDICAL_CHECK_SYSINFO_H_${i}.dmp logfile=TABLE_imp_log_test_${i}.log  DATA_OPTIONS=DISABLE_APPEND_HINT CONTENT=DATA_ONLY cluster=N exclude=statistics &
sleep 2
done

DISABLE_APPEND_HINT — Specifies that you do not want the import operation to use the APPEND hint while loading the data object. Disabling the APPEND hint can be useful if there is a small set of data objects to load that already exist in the database and some other application may be concurrently accessing one or more of the data objects. 

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sutil/datapump-import-utility.html#GUID-5FFA128D-B7F5-41D0-A72C-EB2CE384765D

并行导出操作记录参考:13分钟,120GB大小

查看job任务:


select owner_name, job_name, operation, job_mode, state, attached_sessions 
from dba_datapump_jobs 
where job_name not like 'BIN$%' 
order by 1, 2;

执行窗口:

[oracle@rac1 dmp]$ chmod +x 1.sh
[oracle@rac1 dmp]$ ./1.sh
0
1
2
3
4
5
6
7
8
9
[oracle@rac1 dmp]$ 
Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Version 19.11.0.0.0

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


Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Version 19.11.0.0.0
Version 19.11.0.0.0


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

Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Version 19.11.0.0.0



Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Version 19.11.0.0.0
Version 19.11.0.0.0



Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Version 19.11.0.0.0


Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Version 19.11.0.0.0

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


Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Version 19.11.0.0.0
Version 19.11.0.0.0


Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-31626: job does not exist
ORA-31633: unable to create master table "xxx.SYS_EXPORT_TABLE_07"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1163
ORA-00955: name is already used by an existing object
ORA-06512: at "SYS.KUPV$FT", line 1056
ORA-06512: at "SYS.KUPV$FT", line 1044


ORA-31626: job does not exist
ORA-31633: unable to create master table "xxx.SYS_EXPORT_TABLE_08"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1163
ORA-00955: name is already used by an existing object
ORA-06512: at "SYS.KUPV$FT", line 1056
ORA-06512: at "SYS.KUPV$FT", line 1044


Starting "xxx"."SYS_EXPORT_TABLE_01":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 1" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_1.dmp logfile=log_test_1.log 
Starting "xxx"."SYS_EXPORT_TABLE_02":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 0" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_0.dmp logfile=log_test_0.log 
Starting "xxx"."SYS_EXPORT_TABLE_08":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 4" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_4.dmp logfile=log_test_4.log 
Starting "xxx"."SYS_EXPORT_TABLE_07":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 6" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_6.dmp logfile=log_test_6.log 
Starting "xxx"."SYS_EXPORT_TABLE_04":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 2" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_2.dmp logfile=log_test_2.log 
Starting "xxx"."SYS_EXPORT_TABLE_03":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 3" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_3.dmp logfile=log_test_3.log 
Starting "xxx"."SYS_EXPORT_TABLE_05":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 9" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_9.dmp logfile=log_test_9.log 
Starting "xxx"."SYS_EXPORT_TABLE_06":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(rowid), 10) = 5" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_5.dmp logfile=log_test_5.log 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.80 GB  313975 rows
Master table "xxx"."SYS_EXPORT_TABLE_08" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_08 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_4.dmp
Job "xxx"."SYS_EXPORT_TABLE_08" successfully completed at Fri Jun 18 16:35:26 2021 elapsed 0 00:11:08

. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.88 GB  314981 rows
Master table "xxx"."SYS_EXPORT_TABLE_05" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_05 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_9.dmp
Job "xxx"."SYS_EXPORT_TABLE_05" successfully completed at Fri Jun 18 16:35:34 2021 elapsed 0 00:11:18

. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.85 GB  313992 rows
Master table "xxx"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_01 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_1.dmp
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.78 GB  314160 rows
Job "xxx"."SYS_EXPORT_TABLE_01" successfully completed at Fri Jun 18 16:35:39 2021 elapsed 0 00:11:24

. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.85 GB  314894 rows
Master table "xxx"."SYS_EXPORT_TABLE_06" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_06 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_5.dmp
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.91 GB  316471 rows
Master table "xxx"."SYS_EXPORT_TABLE_03" successfully loaded/unloaded
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.97 GB  317177 rows
Job "xxx"."SYS_EXPORT_TABLE_06" successfully completed at Fri Jun 18 16:35:42 2021 elapsed 0 00:11:26

******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_03 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_3.dmp
Master table "xxx"."SYS_EXPORT_TABLE_07" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_07 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_6.dmp
Job "xxx"."SYS_EXPORT_TABLE_03" successfully completed at Fri Jun 18 16:35:44 2021 elapsed 0 00:11:29

Master table "xxx"."SYS_EXPORT_TABLE_04" successfully loaded/unloaded
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.91 GB  316566 rows
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_04 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_2.dmp
Job "xxx"."SYS_EXPORT_TABLE_07" successfully completed at Fri Jun 18 16:35:45 2021 elapsed 0 00:11:27

Job "xxx"."SYS_EXPORT_TABLE_04" successfully completed at Fri Jun 18 16:35:46 2021 elapsed 0 00:11:30

Master table "xxx"."SYS_EXPORT_TABLE_02" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_02 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_0.dmp
Job "xxx"."SYS_EXPORT_TABLE_02" successfully completed at Fri Jun 18 16:35:47 2021 elapsed 0 00:11:33

另一窗口记录:

SQL> col state for a10
SQL> 
 select owner_name, job_name, operation, job_mode, state, attached_sessions
 from dba_datapump_jobs
 where job_name not like 'BIN$%'
 order by 1, 2

OWNER_NAME JOB_NAME			  OPERAT JOB_MO STATE	   ATTACHED_SESSIONS
---------- ------------------------------ ------ ------ ---------- -----------------
xxx	   SYS_EXPORT_TABLE_01		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_02		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_03		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_04		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_05		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_06		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_07		  EXPORT TABLE	EXECUTING		   1
xxx	   SYS_EXPORT_TABLE_08		  EXPORT TABLE	EXECUTING		   1

8 rows selected.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@rac1 ~]$ cd /oracle/dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_0.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_1.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_2.dmp
8.0G	MEDICAL_CHECK_SYSINFO_H_3.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_4.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_5.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_6.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_0.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_1.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_2.dmp
8.0G	MEDICAL_CHECK_SYSINFO_H_3.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_4.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_5.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_6.dmp
8.1G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
16G	MEDICAL_CHECK_SYSINFO_H_0.dmp
16G	MEDICAL_CHECK_SYSINFO_H_1.dmp
16G	MEDICAL_CHECK_SYSINFO_H_2.dmp
16G	MEDICAL_CHECK_SYSINFO_H_3.dmp
16G	MEDICAL_CHECK_SYSINFO_H_4.dmp
16G	MEDICAL_CHECK_SYSINFO_H_5.dmp
16G	MEDICAL_CHECK_SYSINFO_H_6.dmp
16G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
16G	MEDICAL_CHECK_SYSINFO_H_0.dmp
16G	MEDICAL_CHECK_SYSINFO_H_1.dmp
16G	MEDICAL_CHECK_SYSINFO_H_2.dmp
16G	MEDICAL_CHECK_SYSINFO_H_3.dmp
16G	MEDICAL_CHECK_SYSINFO_H_4.dmp
16G	MEDICAL_CHECK_SYSINFO_H_5.dmp
16G	MEDICAL_CHECK_SYSINFO_H_6.dmp
16G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
16G	MEDICAL_CHECK_SYSINFO_H_0.dmp
16G	MEDICAL_CHECK_SYSINFO_H_1.dmp
16G	MEDICAL_CHECK_SYSINFO_H_2.dmp
16G	MEDICAL_CHECK_SYSINFO_H_3.dmp
16G	MEDICAL_CHECK_SYSINFO_H_4.dmp
16G	MEDICAL_CHECK_SYSINFO_H_5.dmp
16G	MEDICAL_CHECK_SYSINFO_H_6.dmp
16G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ sar 1 10
Linux 5.4.17-2011.6.2.el7uek.x86_64 (rac1) 	06/18/2021 	_x86_64_	(64 CPU)

04:31:35 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
04:31:36 PM     all      3.41      0.00      2.59      3.39      0.00     90.62
04:31:37 PM     all      3.40      0.00      2.25      3.22      0.00     91.13
04:31:38 PM     all      3.33      0.00      2.21      2.95      0.00     91.52
04:31:39 PM     all      3.31      0.00      2.16      3.70      0.00     90.83
04:31:40 PM     all      3.28      0.00      2.11      4.65      0.00     89.96
04:31:41 PM     all      3.21      0.00      2.38      5.04      0.00     89.36
04:31:42 PM     all      3.15      0.00      1.97      4.43      0.00     90.44
04:31:43 PM     all      3.21      0.00      1.86      3.72      0.00     91.21
04:31:44 PM     all      3.06      0.00      2.02      4.56      0.00     90.37
04:31:45 PM     all      3.15      0.00      1.92      4.47      0.00     90.46
Average:        all      3.25      0.00      2.15      4.01      0.00     90.59
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
12G	MEDICAL_CHECK_SYSINFO_H_0.dmp
12G	MEDICAL_CHECK_SYSINFO_H_1.dmp
12G	MEDICAL_CHECK_SYSINFO_H_2.dmp
12G	MEDICAL_CHECK_SYSINFO_H_3.dmp
12G	MEDICAL_CHECK_SYSINFO_H_4.dmp
12G	MEDICAL_CHECK_SYSINFO_H_5.dmp
12G	MEDICAL_CHECK_SYSINFO_H_6.dmp
12G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
12G	MEDICAL_CHECK_SYSINFO_H_0.dmp
12G	MEDICAL_CHECK_SYSINFO_H_1.dmp
12G	MEDICAL_CHECK_SYSINFO_H_2.dmp
12G	MEDICAL_CHECK_SYSINFO_H_3.dmp
12G	MEDICAL_CHECK_SYSINFO_H_4.dmp
12G	MEDICAL_CHECK_SYSINFO_H_5.dmp
12G	MEDICAL_CHECK_SYSINFO_H_6.dmp
12G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO*.dmp
12G	MEDICAL_CHECK_SYSINFO_H_0.dmp
12G	MEDICAL_CHECK_SYSINFO_H_1.dmp
12G	MEDICAL_CHECK_SYSINFO_H_2.dmp
12G	MEDICAL_CHECK_SYSINFO_H_3.dmp
12G	MEDICAL_CHECK_SYSINFO_H_4.dmp
12G	MEDICAL_CHECK_SYSINFO_H_5.dmp
12G	MEDICAL_CHECK_SYSINFO_H_6.dmp
12G	MEDICAL_CHECK_SYSINFO_H_9.dmp
[oracle@rac1 dmp]$ ls -lt|more
total 239233592
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_0.log
-rw-r----- 1 oracle asmadmin 12790267904 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_0.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_2.log
-rw-r----- 1 oracle asmadmin 12857425920 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_2.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_6.log
-rw-r----- 1 oracle asmadmin 12797472768 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_6.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_3.log
-rw-r----- 1 oracle asmadmin 12729819136 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_3.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_5.log
-rw-r----- 1 oracle asmadmin 12649000960 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_5.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_1.log
-rw-r----- 1 oracle asmadmin 12726243328 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_1.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_9.log
-rw-r----- 1 oracle asmadmin 12764639232 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_9.dmp
-rw-r--r-- 1 oracle asmadmin        1380 Jun 18 16:35 log_test_4.log
-rw-r----- 1 oracle asmadmin 12672323584 Jun 18 16:35 MEDICAL_CHECK_SYSINFO_H_4.dmp
-rwxr-xr-x 1 oracle oinstall         304 Jun 18 16:23 1.sh

[oracle@rac1 dmp]$ more log_test_4.log
;;; 
Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:24:08 2021
Version 19.11.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 "xxx"."SYS_EXPORT_TABLE_08":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H QUERY=MEDICAL_CHECK_SYSINFO_H:"where mod(dbms_rowid.rowid_block_number(ro
wid), 10) = 4" directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H_4.dmp logfile=log_test_4.log 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             11.80 GB  313975 rows
Master table "xxx"."SYS_EXPORT_TABLE_08" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_08 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H_4.dmp
Job "xxx"."SYS_EXPORT_TABLE_08" successfully completed at Fri Jun 18 16:35:26 2021 elapsed 0 00:11:08
[oracle@rac1 dmp]$ sqlplus xxx/xxx123890@xxxdb

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jun 18 16:37:44 2021
Version 19.11.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.

Last Successful login time: Fri Jun 18 2021 16:26:59 +08:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL> select count(*) from dba_datapump_jobs;        

  COUNT(*)
----------
	 0

非并行普通导出,消耗34分钟,大小120G,比并行慢接近3倍。

[oracle@rac1 dmp]$ expdp xxx/xxx@xxx TABLES=MEDICAL_CHECK_SYSINFO_H directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H.dmp logfile=log_test.log

Export: Release 19.0.0.0.0 - Production on Fri Jun 18 16:48:00 2021
Version 19.11.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 "xxx"."SYS_EXPORT_TABLE_01":  xxx/********@xxxdb TABLES=MEDICAL_CHECK_SYSINFO_H directory=DMP dumpfile=MEDICAL_CHECK_SYSINFO_H.dmp logfile=log_test.log 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
. . exported "xxx"."MEDICAL_CHECK_SYSINFO_H"             118.6 GB 3152056 rows
Master table "xxx"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for xxx.SYS_EXPORT_TABLE_01 is:
  /oracle/dmp/MEDICAL_CHECK_SYSINFO_H.dmp
Job "xxx"."SYS_EXPORT_TABLE_01" successfully completed at Fri Jun 18 17:22:54 2021 elapsed 0 00:34:53

[oracle@rac1 dmp]$ du -sh MEDICAL_CHECK_SYSINFO_H.dmp 
119G	MEDICAL_CHECK_SYSINFO_H.dmp

 

参考:https://www.linkedin.com/pulse/optimising-lob-export-import-performance-via-oracle-datapump-arya/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值