Oracle8 Backup and Recovery Guide Release 8.0 A58396-01 |
|
This chapter offers guidelines and strategies to follow when preparing for database recovery, and includes the following topics:
Before recovering a database, familiarize yourself with the fundamental data structures, concepts and strategies of Oracle recovery. This section describes basic recovery issues, and includes the following topics:
Of course, before learning about the data structures important to recovery operations, you should first understand what is meant by restoring and recovering data.
You restore a file by reconstructing or retrieving an original copy of it from a backup.
When you recover a file, you are making a restored file current, or current to a specific point in time. This process of recovery is also known as "`rolling forward."
There are two types of recovery commands:
The SQL RECOVER command rolls a restored file forward by applying redo (archived and online redo logs).
A Recovery Manager recover command rolls a restored datafile forward by applying incremental backups (if they exist) and then applying redo (archived and online redo logs).
Table 4-1 describes important data structures involved in recovery processes. Be familiar with these data structures before starting any recovery procedure.
Before recovering a database, you should create a recovery plan or strategy. This section describes important issues to consider when defining your plan.
Your recovery strategy will depend upon the answers to the following questions:
After answering these questions, you can choose a recovery strategy that is appropriate for your particular situation.The following sections describe the types of recovery to perform in specific situations.
If your database is not running in ARCHIVELOG mode, you should restore the database from a consistent database backup. This is your only option when the database is not in ARCHIVELOG mode. The control file and all datafiles are restored from a consistent backup and the database is opened. All changes made subsequent to the backup are lost.
Note: The only time you can recover a database while operating in NOARCHIVELOG is when you have not already overwritten the online log files that were current at the time of the most recent backup. |
If one or more datafiles are lost, but the database stays open, you should perform tablespace (or datafile) recovery while the database is open. The tablespaces or datafiles are taken offline, restored from backups, recovered and placed online. No changes are lost and the database remains available during the recovery.
If an archive log or online log that is required for recovery is also lost, then you should perform point-in-time database or tablespace recovery.
If one or more datafiles and/or all control files are lost, and the database is not open, then you cannot use this procedure. All lost files are restored from backups, recovered and the database is opened. No changes are lost, but the database is unavailable during recovery. If an archive log or online log required for recovery is also lost, then you should perform point-in-time database recovery.
You should perform point-in-time database recovery when an archive log or online log required for recovery is lost, or to recover from user errors. All datafiles and the control file are restored from backups taken before the point-in-time, recovered to the point-in-time and the database is opened. All changes made subsequent to the point-in-time are lost. If the database remains open and no tablespaces that contain rollback segments are lost, you can also use point-in-time tablespace recovery.
All changes made to the recovered tablespaces after the point-in-time are lost. The database, excluding the recovered tablespaces, is available during recovery.
You should test your backup and recovery strategies in a test environment before moving to a production system. You should continue to test your system regularly. That way, you can test the thoroughness of your strategies and later avoid real-life crises. Performing test recoveries regularly ensures that your archiving and backup procedures work. It also keeps you familiar with recovery procedures, so that you are less likely to make mistakes in a crisis.
Media recovery restores a database's datafiles to a point-in-time before disk failure, and includes the committed data in memory that was lost due to failure. Following is a list of media recovery operations:
Complete media recovery includes the application of all necessary redo or incremental backups ever generated for the particular incarnation of the database being recovered. Complete media recovery can be performed on offline datafiles while the database is open. Complete media recovery may require an open resetlogs operation if a backup control file is included in the recovery, or a resetlogs operation creating a new control file has been performed. Types of complete media recovery are:
Incomplete media recovery produces a version of the database as it was at some time in the past. Incomplete media recovery must either continue on to become a complete media recovery, or be terminated by an open resetlogs operation that creates a new incarnation of the database. The database must be closed for incomplete media recovery operations. Types of incomplete media recovery are:
You specify the point in time to recover to
You decide to cancel during the recovery operation
For Recovery Manager, types of incomplete media recovery are: