實驗環境:
操作系統 :Oracle Linux Server release 5.7 64 bit
數據庫版本:Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
案例說明:
為了測試、驗證備份的有效性,需要將服務器A上的數據庫的備份集還原到服務器B上,服務器B上已經創建了相同名稱的ORACLE_SID和DB Name,對應數據文件目錄環境完全一致
Step 1: startup nomount
Step 2: restore spfile
Step 3: restore controlfile
Step 4: startup mount;
Step 5: restore database
Step 6: recover database
由於在沒有在RMAN還原時忘記設置 DBID,結果在執行recover database時報ORA-19698: /u01/oradata/SCM2/redo01.log is from different database: id=4146921064, db_name=SCM2
SQL> alter database drop logfile group 1;
Database altered.
RMAN> recover database;
Starting recover at 14-MAY-14
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/14/2014 10:28:49
ORA-19698: /u01/oradata/SCM2/redo02.log is from different database: id=4146921064, db_name=SCM2
SQL> alter database drop logfile group 2;
ERROR at line 1:
ORA-01567: dropping log 2 would leave less than 2 log files for instance SCM2
(thread 1)
ORA-00312: online log 2 thread 1: '/u01/oradata/SCM2/redo02.log'
SQL> alter database add logfile group 1('/u01/oradata/SCM2/redo01.log') size 50M reuse;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
RMAN> recover database;
Starting recover at 14-MAY-14
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/14/2014 10:32:09
ORA-19698: /u01/oradata/SCM2/redo03.log is from different database: id=4146921064, db_name=SCM2
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance SCM2 (thread 1) - cannot drop
ORA-00312: online log 3 thread 1: '/u01/oradata/SCM2/redo03.log'
[oracle@DB-Server SCM2]$ rm redo03.log
刪除redo03.log後,recover database成功