DG2:/home/oracle> rman targetsys/oracle@DG_PD auxiliarysys/oracle@DG_ST nocatalog
Recovery Manager: Release 11.2.0.3.0 -Production on Fri Oct 28 18:46:46 2011
Copyright (c) 1982, 2011, Oracle and/or itsaffiliates. All rights reserved.
connected to target database: DG(DBID=1679060044)
using target databasecontrol file instead of recovery catalog
connected to auxiliary database: DG (notmounted)
不然会报如下错误:
DBGSQL: TARGET> begin :fhdbi := dbms_rcvcat.getDbid; end;
DBGSQL: sqlcode = 6550
DBGSQL: B :fhdbi = 32767
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGESTACK FOLLOWS ===============
RMAN-00571:===========================================================
RMAN-03002: failure of Duplicate Db commandat 10/28/2011 17:53:04
RMAN-05501: aborting duplication of targetdatabase
RMAN-03015: error occurred in stored scriptMemory Script
ORA-06550: line 1, column 17:
PLS-00201: identifier'DBMS_RCVCAT.GETDBID' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
(2) 在执行duplicate的时候,如果源库和目标库目录相同,那么在duplicate 时,需要加上nofilenamecheck,如下:
RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
我在上面的示例中,目录结构不同,所以没有用该参数,如果目录相同,而又没有加该参数,那么就会报如下错误:
RMAN> duplicate target database forstandby from active database dorecover nofilenamecheck;
RMAN-05501: aborting duplication of targetdatabase
RMAN-05001: auxiliary file name/u01/app/oracle/oradata/dg/users01.dbf conflicts with a file used by the targetdatabase
RMAN-05001: auxiliary file name/u01/app/oracle/oradata/dg/undotbs01.dbf conflicts with a file used by thetarget database
RMAN-05001: auxiliary file name/u01/app/oracle/oradata/dg/sysaux01.dbf conflicts with a file used by thetarget database
RMAN-05001: auxiliary file name/u01/app/oracle/oradata/dg/system01.dbf conflicts with a file used by thetarget database
三. 后续工作
1. 主库已经使用了spfile,但是备库用的还是之前的pfile:
Primary:
SQL> show parameter pfile
NAME TYPE VALUE
------------------------------------ ------- ------------------------------
spfile string /u01/app/oracle/product/11.2.0
Standby:
SQL> show parameter pfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string