Oracle/RMAN

RMAN 복구 중 RMAN-20005: target database name is ambiguous 에러해결

에몽이ㅋ 2012. 2. 21. 16:56
RMAN 카탈로그가 저장되어 있는 DB에서 조회해보면

SQL> select * from rc_database;

    DB_KEY  DBINC_KEY       DBID NAME                                          RESETLOGS_CHANGE#
---------- ---------- ---------- --------------------------------------------- -----------------
       161        162 2554593878 TESTDB                                                   940423
         1          2 2554588056 TESTDB                                                   920136


아래 처럼 같은 DBNAME이 2개가 저장되어있습니다.(DBID를 보면 다른 DB인 것을 알 수 있죠)

해당 상태에서 client쪽에서  RMAN> restore controlfile; 을 실행시키면

Starting restore at 21-FEB-12
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/21/2012 16:45:53
RMAN-12010: automatic channel allocation initialization failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20005: target database name is ambiguous

가 뜨는데, 같은 DB이름중에 어디꺼를 복구할지 몰라서 생성되는 에러입니다.

해결방법  

RMAN> set dbid=2554588056  << DBID를 원하는 DB의 ID에 맞게 지정해주세요.

executing command: SET DBID
database name is "TESTDB" and DBID is 2554588056

RMAN> restore controlfile;  << DBID가 지정된 이후에 실행시키면 됩니다.

Starting restore at 21-FEB-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: reading from backup piece /app/oracle/fast_recovery_area/TESTDB/backupset/2012_02_21/o1_mf_ncnnf_TAG20120221T153842_7n6hj478_.bkp
channel ORA_DISK_1: piece handle=/app/oracle/fast_recovery_area/TESTDB/backupset/2012_02_21/o1_mf_ncnnf_TAG20120221T153842_7n6hj478_.bkp tag=TAG20120221T153842
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/app/oracle/oradata/testdb/control01.ctl
Finished restore at 21-FEB-12