How Oracle identified whether it has to do a crash or a media recovery?

From: Goti <aryan.goti_at_gmail.com>
Date: Mon, 18 Jul 2022 10:12:47 +0530
Message-ID: <CAOzfMurFYB0sJ-YPZ5Tj-PmnpjfvRgLP2QMh=bOfZ+5VTeTdbA_at_mail.gmail.com>



Hi,

Recently I happened to read the Oracle 7 Backup and Recovery handbook. In that book it was stated that the datafile headers will have checkpoint count information and the start SCN along with other information. In control file for each datafile we have a stop scn which will be set to NULL / infinity when the DB is open mode. If the DB is shutdown normal, Oracle set the stop scn to the start scn upon checkpoint. Whereas during shutdown abort, the stop scn is left to infinity. So,

For media recovery:

Oracle checks the checkpoint counter values between the datafile header and control file. If that matches no media recovery required, if not a media recovery is performed.

For crash recovery:

Oracle checks the start scn in the datafile header (v$datafile_header) with stop scn in the control file (v$datafile). If that doesn't match , a crash recovery is initiated.

I also see per book "
<https://oracleboss.files.wordpress.com/2018/03/rman-recipes-for-oracle-database-12c-2nd-edition.pdf>RMAN recipes for Oracle database 12c", below details mentioned.

On startup, Oracle checks the instance thread status to determine whether crash recovery is required. When
the database is open for normal operations, the thread status is OPEN. When Oracle is shut down normally (normal,
immediate, or transactional), a checkpoint takes place, and the instance thread status is set to CLOSED.
When your instance abnormally terminates (such as from a shutdown abort command), the thread status
remains OPEN because Oracle didn’t get a chance to update the status to CLOSED. On startup, when Oracle detects that an instance thread was abnormally left open, the system monitor process will automatically perform crash recovery.

So actually what verification is actually performed for crash recovery and what is performed for media recovery?. Can anyone shed some information on this?

Thanks,

Goti

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jul 18 2022 - 06:42:47 CEST

Original text of this message