Tuesday, March 29, 2011

RMAN-20035: invalid high recid

This is to simulate the scenario of RMAN-20035: invalid high recid issue.


RMAN-20035: invalid high recid won’t happen that frequent, but somehow, it happen to me recently.


This is the steps to reproduce this RMAN error.


RMAN> backup database;


Starting backup at 29-MAR-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=26 devtype=DISK



channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

input datafile fno=00001 name=/u02/oradata/ORCL/datafile/o1_mf_system_6s2rw3hg_.dbf

input datafile fno=00002 name=/u02/oradata/ORCL/datafile/o1_mf_sys_undo_6s2rwcrn_.dbf

input datafile fno=00003 name=/u02/oradata/ORCL/datafile/o1_mf_sysaux_6s2rwdj6_.dbf

channel ORA_DISK_1: starting piece 1 at 29-MAR-11


channel ORA_DISK_1: finished piece 1 at 29-MAR-11

piece handle=/u03/flash_recovery_area/ORCL/backupset/2011_03_29/o1_mf_nnndf_TAG20110329T130711_6s2t7z1x_.bkp tag=TAG20110329T130711 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

including current control file in backupset

including current SPFILE in backupset

channel ORA_DISK_1: starting piece 1 at 29-MAR-11

channel ORA_DISK_1: finished piece 1 at 29-MAR-11

piece handle=/u03/flash_recovery_area/ORCL/backupset/2011_03_29/o1_mf_ncsnf_TAG20110329T130711_6s2t8346_.bkp tag=TAG20110329T130711 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02

Finished backup at 29-MAR-11



SYS @ orcl> select name from v$controlfile;


NAME

--------------------------------------------------------------------------------

/u02/oradata/ORCL/controlfile/o1_mf_6s2rw1j6_.ctl

/u03/flash_recovery_area/ORCL/controlfile/o1_mf_6s2rw1l3_.ctl


SYS @ orcl> desc v$logfile;

Name                                           Null?    Type

----------------------------------------- -------- ----------------------------

GROUP#                                             NUMBER

STATUS                                             VARCHAR2(7)

TYPE                                                    VARCHAR2(7)

MEMBER                                             VARCHAR2(513)

IS_RECOVERY_DEST_FILE                                    VARCHAR2(3)


SYS @ orcl> select member from v$logfile;


MEMBER

--------------------------------------------------------------------------------

/u02/oradata/ORCL/onlinelog/o1_mf_1_6s2rw1nz_.log

/u03/flash_recovery_area/ORCL/onlinelog/o1_mf_1_6s2rw1tj_.log

/u02/oradata/ORCL/onlinelog/o1_mf_2_6s2rw24s_.log

/u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log


SYS @ orcl> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SYS @ orcl> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@db10g ~]$ cp -r /u02/oradata/ORCL/datafile /u02/oradata/ORCL/datafile_backup


[oracle@db10g ~]$

[oracle@db10g ~]$ cp /u02/oradata/ORCL/onlinelog/o1_mf_1_6s2rw1nz_.log /u02/oradata/ORCL/onlinelog/o1_mf_1_6s2rw1nz_.log_backup

[oracle@db10g ~]$ cp /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_1_6s2rw1tj_.log /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_1_6s2rw1tj_.log_backup

cp [oracle@db10g ~]$ cp /u02/oradata/ORCL/onlinelog/o1_mf_2_6s2rw24s_.log /u02/oradata/ORCL/onlinelog/o1_mf_2_6s2rw24s_.log_backup

cp[oracle@db10g ~]$ cp  /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log_backup

cp: missing destination file operand after `/u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log_backup'

Try `cp --help' for more information.

[oracle@db10g ~]$ cp /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log_backup

[oracle@db10g ~]$ cp /u02/oradata/ORCL/controlfile/o1_mf_6s2rw1j6_.ctl /u02/oradata/ORCL/controlfile/o1_mf_6s2rw1j6_.ctl_backup

[oracle@db10g ~]$ cp /u03/flash_recovery_area/ORCL/controlfile/o1_mf_6s2rw1l3_.ctl /u03/flash_recovery_area/ORCL/controlfile/o1_mf_6s2rw1l3_.ctl_backup


RMAN> backup database ;


Starting backup at 29-MAR-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=25 devtype=DISK

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

input datafile fno=00001 name=/u02/oradata/ORCL/datafile/o1_mf_system_6s2rw3hg_.dbf

input datafile fno=00002 name=/u02/oradata/ORCL/datafile/o1_mf_sys_undo_6s2rwcrn_.dbf

input datafile fno=00003 name=/u02/oradata/ORCL/datafile/o1_mf_sysaux_6s2rwdj6_.dbf

channel ORA_DISK_1: starting piece 1 at 29-MAR-11

channel ORA_DISK_1: finished piece 1 at 29-MAR-11

piece handle=/u03/flash_recovery_area/ORCL/backupset/2011_03_29/o1_mf_nnndf_TAG20110329T131258_6s2tlty8_.bkp tag=TAG20110329T131258 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

including current control file in backupset

including current SPFILE in backupset

channel ORA_DISK_1: starting piece 1 at 29-MAR-11

channel ORA_DISK_1: finished piece 1 at 29-MAR-11

piece handle=/u03/flash_recovery_area/ORCL/backupset/2011_03_29/o1_mf_ncsnf_TAG20110329T131258_6s2tly1c_.bkp tag=TAG20110329T131258 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02

Finished backup at 29-MAR-11


RMAN> exit



Recovery Manager complete.

[oracle@db10g ~]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 29 13:13:13 2011


Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.



Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SYS @ orcl> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.


SYS @ orcl> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@db10g ~]$ rm -r  /u02/oradata/ORCL/datafile/

[oracle@db10g ~]$ mv   /u02/oradata/ORCL/datafile_backup/ /u02/oradata/ORCL/datafile

[oracle@db10g ~]$ mv /u02/oradata/ORCL/onlinelog/o1_mf_1_6s2rw1nz_.log

o1_mf_1_6s2rw1nz_.log         o1_mf_1_6s2rw1nz_.log_backup  

[oracle@db10g ~]$ mv /u02/oradata/ORCL/onlinelog/o1_mf_1_6s2rw1nz_.log_backup  /u02/oradata/ORCL/onlinelog/o1_mf_1_6s2rw1nz_.log

[oracle@db10g ~]$ mv /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_1_6s2rw1tj_.log_backup /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_1_6s2rw1tj_.log

[oracle@db10g ~]$ mv /u02/oradata/ORCL/onlinelog/o1_mf_2_6s2rw24s_.log_ba_backup /u02/oradata/ORCL/onlinelog/o1_mf_2_6s2rw24s_.log

[oracle@db10g ~]$ mv /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log_backup /u03/flash_recovery_area/ORCL/onlinelog/o1_mf_2_6s2rw2on_.log

[oracle@db10g ~]$ mv /u03/flash_recovery_area/ORCL/controlfile/o1_mf_6s2rw1l3_.ctl

o1_mf_6s2rw1l3_.ctl         o1_mf_6s2rw1l3_.ctl_backup  

[oracle@db10g ~]$ mv /u03/flash_recovery_area/ORCL/controlfile/o1_mf_6s2rw1l3_.ctl_backup /u03/flash_recovery_area/ORCL/controlfile/o1_mf_6s2rw1l3_.ctl

[oracle@db10g ~]$

[oracle@db10g ~]$

[oracle@db10g ~]$ mv /u02/oradata/ORCL/controlfile/o1_mf_6s2rw1j6_.ctl_backup /u02/oradata/ORCL/controlfile/o1_mf_6s2rw1j6_.ctl

[oracle@db10g ~]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 29 13:15:36 2011


Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to an idle instance.


SYS @ orcl> startup ;

ORACLE instance started.


Total System Global Area  314572800 bytes

Fixed Size                    1267260 bytes

Variable Size                  100665796 bytes

Database Buffers          209715200 bytes

Redo Buffers                    2924544 bytes

Database mounted.

Database opened.


SYS @ orcl> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@db10g ~]$ rman target sys/xxx@orcl catalog rman/rman@catdb

Recovery Manager: Release 10.2.0.4.0 - Production on Tue Mar 29 13:15:57 2011


Copyright (c) 1982, 2007, Oracle.  All rights reserved.


connected to target database: ORCL (DBID=1274840961)

connected to recovery catalog database


RMAN> backup database;


Starting backup at 29-MAR-11

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 03/29/2011 13:16:10

RMAN-03014: implicit resync of recovery catalog failed

RMAN-06004: ORACLE error from recovery catalog database: RMAN-20035: invalid high recid




Note 273446.1 from Support Oracle basically suggest to either


1) Unregister the database in the recovery catalog using DBMS_RCVCAT.UNREGISTERDATABASE procedure.


2) After unregistering the database re-register the database in the recovery catalog:


I would suggest that don’t mix offline backup into your online restoration procedure.


Please feel free to comment/suggest .