Tuesday, May 15, 2007

RMAN Backup Report to get SCN for Recovery

Two methods.

1) >rman target / log=rmanlistbackup.log
Rman>list backup;
Rman>exit

vi rmanlistbackup.log. The last entry in the file shows this:
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
22021 Full 27M DISK 00:00:01 15-MAY-07
BP Key: 22025 Status: AVAILABLE Tag:
Piece Name: /ora01/oracle/product/9.2.0.4.0/dbs/c-4049168349-20070515-02 <-- control file backup at the very end of the last disk backup.
Controlfile Included: Ckp SCN: 607710483792 Ckp time: 15-MAY-07

2) login to database
check following dictionary Views

from v$backup_set where start_time > sysdate -1
from v$backup_piece
from v$backup_datafile
from v$backup_redolog


This will provide last SCN number
set numwidth 18
select max(CHECKPOINT_CHANGE#) from v$backup_datafile;

MAX(CHECKPOINT_CHANGE#)
-----------------------
607710483792