when restoring oracle spfile, I get the following error.
RMAN> set dbid=1170383141
executing command: SET DBID
database name is "PROD" and DBID is 1170383141
RMAN> run
2> {
3> allocate channel t1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_p7_ibms_prod.opt)';
4> restore spfile;
5> restore controlfile;
6> }
allocated channel: t1
channel t1: sid=27 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0
Starting restore at 24-OCT-2011:15:37:55
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/24/2011 15:37:55
RMAN-06758: DB_UNIQUE_NAME is not unique in the recovery catalog
query the rman catalog database to verify that there are multiple db_unique_name share the same dbid.
sqlplus> ...
RMANCAT> col name format a
RMANCAT> col conf_name format a299
RMANCAT> col value format a39
RMANCAT> col db_unique_name format a9
RMANCAT> set linesize 300
RMANCAT> col value format a120
select conf.db_key,db.dbid,conf.db_unique_name,db.name as name
--,conf.name as conf_name,conf.value
from rman.conf conf, rman.rc_database db
where conf.db_key=db.db_key and (db.name ='PROD' or conf.db_unique_name='PROD')
DB_KEY DBID DB_UNIQUE NAME
---------- ---------- --------- ---------
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD
13 rows selected.
1* select * from rman.node order by db_key
17:13:22 RMANCAT> /
DB_UNIQUE DB_KEY HIGH_CONF_RECID FOR HIGH_ROUT_STAMP INST_STARTUP_STAMP DATABAS
--------- ---------- --------------- --- --------------- ------------------ -------
BIDATA 2923 0 YES 0 724438317 PRIMARY
BIDTST 2923 6139 NO 750855226 750494058 PRIMARY
TESTCOPY 6822 86 NO 714501546 714065640 PRIMARY
TEST 7582 25 NO 714501120 714068248 PRIMARY
PROD 16187 27 NO 764796729 764791973 PRIMARY
PRODSTBY 16187 24 NO 764939051 764934470 STANDBY
RMANCAT 59307 0 NO 753298557 746479200 PRIMARY
BIDATA 80019 1033 NO 743303600 742878243 PRIMARY
BIDATA 217407 5429 NO 748344418 748341440 PRIMARY
BIDATA2 243780 22 NO 752695082 752694449 PRIMARY
BIDATA 253407 2325 NO 765313006 764583195 PRIMARY
notice that both PROD and PRODSTBY share same db_key, but one is primary role, the other is standby role, this is because we have oracle dataguard configured.
the fix is to run
rman>restore spfile for db_unique_Name PROD.
RMAN> set dbid=1170383141
executing command: SET DBID
database name is "PROD" and DBID is 1170383141
RMAN> run
2> {
3> allocate channel t1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_p7_ibms_prod.opt)';
4> restore spfile;
5> restore controlfile;
6> }
allocated channel: t1
channel t1: sid=27 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0
Starting restore at 24-OCT-2011:15:37:55
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/24/2011 15:37:55
RMAN-06758: DB_UNIQUE_NAME is not unique in the recovery catalog
query the rman catalog database to verify that there are multiple db_unique_name share the same dbid.
sqlplus> ...
RMANCAT> col name format a
RMANCAT> col conf_name format a299
RMANCAT> col value format a39
RMANCAT> col db_unique_name format a9
RMANCAT> set linesize 300
RMANCAT> col value format a120
select conf.db_key,db.dbid,conf.db_unique_name,db.name as name
--,conf.name as conf_name,conf.value
from rman.conf conf, rman.rc_database db
where conf.db_key=db.db_key and (db.name ='PROD' or conf.db_unique_name='PROD')
DB_KEY DBID DB_UNIQUE NAME
---------- ---------- --------- ---------
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PRODSTBY PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD PROD
16187 1170383141 PROD
13 rows selected.
1* select * from rman.node order by db_key
17:13:22 RMANCAT> /
DB_UNIQUE DB_KEY HIGH_CONF_RECID FOR HIGH_ROUT_STAMP INST_STARTUP_STAMP DATABAS
--------- ---------- --------------- --- --------------- ------------------ -------
BIDATA 2923 0 YES 0 724438317 PRIMARY
BIDTST 2923 6139 NO 750855226 750494058 PRIMARY
TESTCOPY 6822 86 NO 714501546 714065640 PRIMARY
TEST 7582 25 NO 714501120 714068248 PRIMARY
PROD 16187 27 NO 764796729 764791973 PRIMARY
PRODSTBY 16187 24 NO 764939051 764934470 STANDBY
RMANCAT 59307 0 NO 753298557 746479200 PRIMARY
BIDATA 80019 1033 NO 743303600 742878243 PRIMARY
BIDATA 217407 5429 NO 748344418 748341440 PRIMARY
BIDATA2 243780 22 NO 752695082 752694449 PRIMARY
BIDATA 253407 2325 NO 765313006 764583195 PRIMARY
notice that both PROD and PRODSTBY share same db_key, but one is primary role, the other is standby role, this is because we have oracle dataguard configured.
the fix is to run
rman>restore spfile for db_unique_Name PROD.
Comments
Post a Comment