RMAN异机还原遭遇ORA-19698错误案例

时间:2021-05-17 07:37:26

实验环境:

              操作系统    :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

RMAN异机还原遭遇ORA-19698错误案例

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:15:30

ORA-19698: /u01/oradata/SCM2/redo01.log is from different database: id=4146921064, db_name=SCM2

此时需要删除redo日志文件,结果在sqlplus里面删除redo日志文件,遇到下面一系列问题。其实可以直接使用rm命令直接删除redo日志文件这样简单方便得多。

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成功

RMAN异机还原遭遇ORA-19698错误案例