且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

【DataGuarad】逻辑迁移与standby备库

更新时间:2022-08-21 12:04:22

standby 库不支持expdp,可以使用exp代替
oracle@rac3:/home/oracle>expdp yang/yang directory=dump dumpfile=yang.dmp tables=yang                     
Export: Release 11.2.0.1.0 - Production on Tue Sep 20 19:46:42 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31633: unable to create master table "YANG.SYS_EXPORT_TABLE_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1020
ORA-16000: database open for read-only access
原因:执行expdp导出时需要创建一个master table。standby 库是只读的,所以不能使用expdp工具,然而可以使用exp工具在备库上进行数据逻辑导出
oracle@rac3:/home/oracle>exp yang/yang file=yang_20110920.dmp tables=yang
Export: Release 11.2.0.1.0 - Production on Tue Sep 20 19:47:46 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table                           YANG     574121 rows exported
Export terminated successfully without warnings.
oracle@rac3:/home/oracle>
google 之后看到一篇文章:http://www.dbvisit.com/forums/showthread.php?t=552
说使用network_link可以进行导出。于是做了测试,但是均以失败告终:
yangdb 指向第一备库,yangdbstd 指向第二备库
oracle@rac1:/tmp>expdp yang/yang network_link=yangdb directory=dump dumpfile=yang.dmp tables=yang
Export: Release 11.2.0.1.0 - Production on Tue Sep 20 19:22:21 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-39006: internal error
ORA-39065: unexpected master process exception in DISPATCH
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/opt/oracle/oradata/yangdb/rac/tempfile/temp.268.761930967'
ORA-06512: at "SYS.DBMS_DATAPUMP", line 806
ORA-06512: at "SYS.DBMS_DATAPUMP", line 5822

ORA-39097: Data Pump job encountered unexpected error -1157

oracle@rac1:/tmp>expdp yang/yang network_link=yangdbstd directory=dump dumpfile=yang.dmp tables=yang
Export: Release 11.2.0.1.0 - Production on Tue Sep 20 19:22:58 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "YANG"."SYS_EXPORT_TABLE_02":  yang/******** network_link=alifpre directory=dump dumpfile=yang.dmp tables=yang 
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS [] 
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_METADATA", line 2625
ORA-06512: at "SYS.DBMS_METADATA", line 2668
ORA-06512: at "SYS.DBMS_METADATA", line 2974
ORA-06512: at "SYS.DBMS_METADATA", line 5161

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPW$WORKER", line 8159

----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
0xb60d7438     19028  package body SYS.KUPW$WORKER
0xb60d7438      8191  package body SYS.KUPW$WORKER
0xb60d7438     12728  package body SYS.KUPW$WORKER
0xb60d7438      2425  package body SYS.KUPW$WORKER
0xb60d7438      8846  package body SYS.KUPW$WORKER
0xb60d7438      1651  package body SYS.KUPW$WORKER
0xabf53b48         2  anonymous block

ORA-39126: Worker unexpected fatal error in KUPW$WORKER.MAIN [] 
ORA-04052: error occurred when looking up remote object YANG.DBMS_DATAPUMP@ALIFPRE
ORA-00604: error occurred at recursive SQL level 3
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPW$WORKER", line 8159

----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
0xaa652970     19028  package body SYS.KUPW$WORKER
0xaa652970      8191  package body SYS.KUPW$WORKER
0xaa652970      1705  package body SYS.KUPW$WORKER
0xaa50fb60         2  anonymous block

Job "YANG"."SYS_EXPORT_TABLE_02" stopped due to fatal error at 19:23:04
UDE-00001: user requested cancel of current operation
和内部错误有关。。