Database Reference
In-Depth Information
WHEN ((a.checkpoint_change# - b.checkpoint_change#) < 0) THEN 'Old Control File'
ELSE 'what the ?'
END datafile_status
FROM v$datafile a -- control file SCN for datafile
,v$datafile_header b -- datafile header SCN
WHERE a.file# = b.file#
ORDER BY a.file#;
If the control file SCN values are greater than the data file SCN values, then media recovery is most likely
required. This would be the case if you restored a data file from a backup, and the SCN in the restored data file had an
SCN less than the data file in the current control file.
the V$DATAFILE_HEADER view uses the physical data file on disk as its source. the V$DATAFILE view uses the
control file as its source.
Tip
You can also directly query the V$DATAFILE_HEADER for more information. The ERROR and RECOVER columns report
any potential problems. For example, a YES or null value in the RECOVER column indicates that there is a problem:
SQL> select file#, status, error, recover from v$datafile_header;
Here is some sample output:
FILE# STATUS ERROR REC
---------- ------- -------------------- ---
1 ONLINE FILE NOT FOUND
2 ONLINE NO
3 ONLINE NO
Determining What to Restore
Media recovery requires that you perform manual tasks to get your database back in one piece. These tasks usually
involve a combination of RESTORE and RECOVER commands. You will have to issue an RMAN RESTORE command if, for
some reason (accidental deleting of files, disk failure, and so on), your data files have experienced media failure.
How the Process Works
When you issue the RESTORE command, RMAN automatically decides how to extract the data files from any of the
following available backups:
Full database backup
Incremental level-0 backup
BACKUP AS COPY command
After the files are restored from a backup, you are required to apply redo to them via the RECOVER command.
When you issue the RECOVER command, Oracle examines the SCNs in the affected data files and determines whether
any of them need to be recovered. If the SCN in the data file is less than the corresponding SCN in the control file, then
media recovery will be required.
Image copy backup generated by
 
 
Search WWH ::




Custom Search