本测试的亮点是impdp参数network_link,此参数支持跨Oracle版本(如10.2.0.4和10.2.0.3),跨操作系统。
测试库
ora10g@mcprod ~]$ export ORACLE_SID=mcstar
ora10g@mcprod ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Nov 16 14:32:11 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn zhou/zhou
Connected.
生产库
[ora10g@hzmc ~]$ export ORACLE_SID=drb
[ora10g@hzmc ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Nov 16 15:05:31 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn system/oracle;
Connected.
SQL> create database link mcstar connect to zhou identified by zhou using 'mcstar';
Database link created.
SQL> conn /as sysdba;
Connected.
SQL> drop user zhou cascade;
User dropped.
SQL> CREATE DIRECTORY dmpdir AS '/tmp';
Directory created.
SQL> GRANT read, write ON DIRECTORY dmpdir TO system;
Grant succeeded.
SQL> create tablespace zhou datafile '/Tbackup/mcstar/oradata/zhou02.dbf' size 50m;
Tablespace created.
[ora10g@hzmc tmp]$ impdp system/oracle@drb directory=dmpdir network_link=mcstar schemas=zhou
Import: Release 10.2.0.3.0 - Production on Tuesday, 16 November, 2010 15:28:51
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/********@drb directory=dmpdir network_link=mcstar schemas=zhou
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 372 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . imported "ZHOU"."T2" 46285 rows
. . imported "ZHOU"."TABLE_AFTER" 759248 rows
. . imported "ZHOU"."TABLE_BEFORE" 759248 rows
. . imported "ZHOU"."TESTT1" 181860 rows
. . imported "ZHOU"."T" 189812 rows
. . imported "ZHOU"."T1" 46284 rows
. . imported "ZHOU"."ZHOU" 0 rows
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at 15:33:00
注:在跨版本,跨操作系统中可能存在某些bug
[ora10g@hzmc admin]$ impdp system/oracle@drb directory=dmpdir network_link=ora10g schemas=zhou
Import: Release 10.2.0.3.0 - Production on Tuesday, 16 November, 2010 15:58:24
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_02": system/********@drb directory=dmpdir network_link=ora10g schemas=zhou
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 4 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.DISPATCH_WORK_ITEMS while calling DBMS_METADATA.CLOSE []
ORA-31600: invalid input value 200002 for parameter HANDLE in function CLOSE
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 6228
----- PL/SQL Call Stack -----
object line object
handle number name
0x2be1375c 14916 package body SYS.KUPW$WORKER
0x2be1375c 6293 package body SYS.KUPW$WORKER
0x2be1375c 6988 package body SYS.KUPW$WORKER
0x2be1375c 1259 package body SYS.KUPW$WORKER
0x2de75438 2 anonymous block
测试库
ora10g@mcprod ~]$ export ORACLE_SID=mcstar
ora10g@mcprod ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Nov 16 14:32:11 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn zhou/zhou
Connected.
生产库
[ora10g@hzmc ~]$ export ORACLE_SID=drb
[ora10g@hzmc ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Nov 16 15:05:31 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn system/oracle;
Connected.
SQL> create database link mcstar connect to zhou identified by zhou using 'mcstar';
Database link created.
SQL> conn /as sysdba;
Connected.
SQL> drop user zhou cascade;
User dropped.
SQL> CREATE DIRECTORY dmpdir AS '/tmp';
Directory created.
SQL> GRANT read, write ON DIRECTORY dmpdir TO system;
Grant succeeded.
SQL> create tablespace zhou datafile '/Tbackup/mcstar/oradata/zhou02.dbf' size 50m;
Tablespace created.
[ora10g@hzmc tmp]$ impdp system/oracle@drb directory=dmpdir network_link=mcstar schemas=zhou
Import: Release 10.2.0.3.0 - Production on Tuesday, 16 November, 2010 15:28:51
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/********@drb directory=dmpdir network_link=mcstar schemas=zhou
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 372 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . imported "ZHOU"."T2" 46285 rows
. . imported "ZHOU"."TABLE_AFTER" 759248 rows
. . imported "ZHOU"."TABLE_BEFORE" 759248 rows
. . imported "ZHOU"."TESTT1" 181860 rows
. . imported "ZHOU"."T" 189812 rows
. . imported "ZHOU"."T1" 46284 rows
. . imported "ZHOU"."ZHOU" 0 rows
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed at 15:33:00
注:在跨版本,跨操作系统中可能存在某些bug
[ora10g@hzmc admin]$ impdp system/oracle@drb directory=dmpdir network_link=ora10g schemas=zhou
Import: Release 10.2.0.3.0 - Production on Tuesday, 16 November, 2010 15:58:24
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_02": system/********@drb directory=dmpdir network_link=ora10g schemas=zhou
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 4 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.DISPATCH_WORK_ITEMS while calling DBMS_METADATA.CLOSE []
ORA-31600: invalid input value 200002 for parameter HANDLE in function CLOSE
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 6228
----- PL/SQL Call Stack -----
object line object
handle number name
0x2be1375c 14916 package body SYS.KUPW$WORKER
0x2be1375c 6293 package body SYS.KUPW$WORKER
0x2be1375c 6988 package body SYS.KUPW$WORKER
0x2be1375c 1259 package body SYS.KUPW$WORKER
0x2de75438 2 anonymous block