Monday 5 August 2019

Recovery of Database in non Archivelog mode -- Mount State


Preview:

  • Database in no archivelog
  • We have consistant rman backup
  • No Recovery Catalog on database 

Solution:

  • startup Mount
  • validate database
  • rman target /
  • restore database
  • recover database
  •  database open in resetlogs
  • Check Incarnation number

ASMCMD> ls
IDATA.269.1014653909
ILOG.271.1014656841
INDX.270.1014656575
SOETBS.273.1015005687
SYSAUX.257.1011959959
SYSTEM.258.1011960053
UNDOTBS1.260.1011960171
UNDOTBS2.265.1011960859
USERS.259.1011960169
ASMCMD> rm -rf ILOG.271.1014656841
ASMCMD> ls


  • start database  using SRVCTL command
[root@srv1 oracle]# srvctl start database -d rac
PRCR-1079 : Failed to start resource ora.rac.db
CRS-5017: The resource action "ora.rac.db start" encountered the following error:
ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
ORA-01110: data file 8: '+DATA/RAC/DATAFILE/ilog.271.1014656841'
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/srv2/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.rac.db' on 'srv2' failed
CRS-2632: There are no more servers to try to place resource 'ora.rac.db' on that would satisfy its placement policy
CRS-5017: The resource action "ora.rac.db start" encountered the following error:
ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
ORA-01110: data file 8: '+DATA/RAC/DATAFILE/ilog.271.1014656841'
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/srv1/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.rac.db' on 'srv1' failed
[root@srv1 oracle]#

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1795162112 bytes
Fixed Size                  2925456 bytes
Variable Size             603982960 bytes
Database Buffers         1174405120 bytes
Redo Buffers               13848576 bytes
Database mounted.


RMAN> validate database;

Starting validate at 05-AUG-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 instance=rac1 device type=DISK
RMAN-06169: could not read file header for datafile 8 error reason 4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of validate command at 08/05/2019 16:21:39
RMAN-06056: could not access datafile 8

RMAN>

[oracle@srv1 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Mon Aug 5 16:35:52 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RAC (DBID=2599942250, not open)

  • Restore database
RMAN> restore database;

Starting restore at 05-AUG-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 instance=rac1 device type=DISK

skipping datafile 8; already restored to file +DATA/RAC/DATAFILE/ilog.271.1015518129
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/RAC/DATAFILE/system.258.1011960053
channel ORA_DISK_1: restoring datafile 00002 to +DATA/RAC/DATAFILE/idata.269.1014653909
channel ORA_DISK_1: restoring datafile 00003 to +DATA/RAC/DATAFILE/sysaux.257.1011959959
channel ORA_DISK_1: restoring datafile 00004 to +DATA/RAC/DATAFILE/undotbs1.260.1011960171
channel ORA_DISK_1: restoring datafile 00005 to +DATA/RAC/DATAFILE/undotbs2.265.1011960859
channel ORA_DISK_1: restoring datafile 00006 to +DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: restoring datafile 00007 to +DATA/RAC/DATAFILE/indx.270.1014656575
channel ORA_DISK_1: restoring datafile 00009 to +DATA/RAC/DATAFILE/soetbs.273.1015005687
channel ORA_DISK_1: reading from backup piece /u01/Backup/ora_df1015515357_s220_s1
channel ORA_DISK_1: piece handle=/u01/Backup/ora_df1015515357_s220_s1 tag=FULL_DB_MOUNT
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:09:06
Finished restore at 05-AUG-19

  • Recover database 
RMAN> recover database;

Starting recover at 05-AUG-19
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 468 is already on disk as file +DATA/RAC/ONLINELOG/group_2.263.1011960241
archived log for thread 1 with sequence 469 is already on disk as file +DATA/RAC/ONLINELOG/group_1.262.1011960239
archived log for thread 2 with sequence 364 is already on disk as file +DATA/RAC/ONLINELOG/group_4.267.1011961123
RMAN-08187: WARNING: media recovery until SCN 16289785 complete
Finished recover at 05-AUG-19

  • Open database in reset logs mode
RMAN> alter database open resetlogs;

Statement processed

  • Check incarnation point 

RMAN>

SQL> SELECT INCARNATION#, RESETLOGS_CHANGE#, PRIOR_RESETLOGS_CHANGE#, STATUS FROM V$DATABASE_INCARNATION ORDER BY 1;

INCARNATION# RESETLOGS_CHANGE# PRIOR_RESETLOGS_CHANGE# STATUS
------------ ----------------- ----------------------- -------
           1                 1                       0 PARENT
           2           1594143                       1 PARENT
           3          16289786                 1594143 CURRENT

No comments:

Post a Comment