Saturday, May 24, 2008

How to recover Database by SCN number (incomplete recovery) -RMAN

• Log sequence recovery

1. Mount the database.
2. Restore all data files.
3. Recover the database by using UNTIL SCN
4. Open the database by using RESETLOGS.

Know last SCN no.
SQL> select first_change#,status,group# from v$log;

------------- ---------------- ----------
8793770 CURRENT 1
8785734 ACTIVE 2
8793669 ACTIVE 3

The FIRST_CHANGE# is the first SCN stamped in the missing log. This implies that the last
SCN stamped in the previous log is 8793769 (FIRST_CHANGE#-1). This is the highest SCN
that we can recover to. In order to do the recovery we must first restore ALL datafiles to this
SCN, followed by recovery (also up to this SCN).

RMAN> shutdown immediate;

using target database control file instead of re
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 683671552 bytes

Fixed Size 1250836 bytes
Variable Size 125831660 bytes
Database Buffers 549453824 bytes
Redo Buffers 7135232 bytes

RMAN> restore database until scn 8793769;
channel ORA_DISK_1: restore complete, elapsed time: 00:02:17
Finished restore at 23-MAY-08

RMAN> recover database until scn 8793769;
media recovery complete, elapsed time: 00:00:16
Finished recover at 23-MAY-08

RMAN> alter database open resetlogs;

database opened

1 comment:

Jack Walsh said...

I am glad to read this beneficial post.
The failure of data almost always leads a person to a sense of disappointment.
So as to solve this concern, the gurus have launched a lot of personal information recovery alternatives.
Consumer should be well aware of possible info retrieval resources with the intention that he'll handle the data damage situation in just a correct way.Data Recovery Kansas City