Because you do not have to open the database with the RESETLOGS option after complete recovery as you do after incomplete recovery, you have the option of recovering some datafiles at one time and the remaining datafiles later.
This section describes the steps necessary to complete media recovery operations, and includes the following topics:. Performing Open Database Recovery See Also: Chapter 3, "Developing a Backup and Recovery Strategy" to familiarize yourself with fundamental recovery concepts and strategies Performing Closed Database Recovery This section describes steps to perform closed database recovery of either all damaged datafiles in one operation, or individual recovery of each damaged datafile in separate operations.
Restore the necessary files. Recover the database. To prepare for closed database recovery:. If the hardware problem that caused the media failure was temporary, and the data was undamaged for example, a disk or controller power failure , simply start the database and resume normal operations: STARTUP To restore the necessary files:.
If files are permanently damaged, identify the most recent backups for the damaged files. Restore only the datafiles damaged by the media failure: do not restore any undamaged datafiles or any online redo log files. If you do not have a backup of a specific datafile, you may be able to create an empty replacement file that can be recovered. The hardware problem is repaired and you can restore the datafiles to their default locations Restore the datafiles to their default locations and begin media recovery.
The hardware problem persists and you cannot restore datafiles to their original locations Restore the datafiles to an alternative storage device. Indicate the new location of these files to the control file. Use the operation described in "Renaming and Relocating Datafiles" in the Oracle8i Administrator's Guide , as necessary. To recover the restored datafiles:. If you prefer, create a script to bring all datafiles online at once as in the following:.
If you automated recovery, Oracle applies the necessary logs automatically. Oracle continues until all required archived and online redo log files have been applied to the restored datafiles. Oracle notifies you when media recovery is complete. If no archived redo log files are required for complete media recovery, Oracle applies all necessary online redo log files and terminates recovery.
Oracle automatically takes the damaged datafiles offline--but not the tablespaces that contain them--if DBWR fails to be able to write to them. Queries that cannot read damaged files receive errors, but Oracle does not take the files offline for this reason alone. If the hardware problem cannot be repaired quickly, proceed with database recovery by restoring damaged files to an alternative storage device.
To prepare for recovery in an open database:. To restore datafiles in an open database:. If you restored one or more damaged datafiles to alternative locations, indicate the new locations of these files to the control file of the associated database by using the procedure in the Oracle8i Administrator's Guide.
To recover offline tablespaces in an open database:. See "Performing Media Recovery in Parallel". Oracle begins the roll forward phase of media recovery by applying the necessary redo log files archived and online to reconstruct the restored datafiles. Oracle continues until all required archived redo log files have been applied to the restored datafiles.
The online redo log files are then automatically applied to the restored datafiles to complete media recovery. If no archived redo log files are required for complete media recovery, Oracle does not prompt for any. Instead, all necessary online redo log files are applied, and media recovery is complete.
Performing Incomplete Media Recovery This section describes the steps necessary to complete the different types of incomplete media recovery operations, and includes the following topics:. Performing Time-Based Recovery Performing Change-Based Recovery Note that if your database is affected by seasonal time changes for example, daylight savings time , you may experience a problem if a time appears twice in the redo log and you want to recover to the second, or later time.
To deal with time changes, perform cancel-based or change-based recovery to the point in time where the clock is set back, then continue with the time-based recovery to the exact time. Restore backup control files if necessary and backup datafiles. To prepare for cancel-based recovery:. If a media failure occurred, correct the hardware problem that caused the failure. To restore the files necessary for cancel-based recovery:. The restored control file should reflect the database's physical file structure, that is, contain the names of datafiles and online redo log files, at the point at which incomplete media recovery is intended to finish.
Review the list of files that correspond to the current control file as well as each control file backup to determine the correct control file to use. If necessary, replace all current control files of the database with the correct control file backup. Alternatively, create a new control file. Restore backups taken as part of a full or partial backup of all the datafiles of the database.
You must have taken all backup files used to replace existing datafiles before the intended time of recovery. For example, if you intend to recover to redo log sequence number 38, then restore all datafiles with backups completed before redo log sequence number If you do not have a backup of a specific datafile, create an empty replacement file that can be recovered. If you added a datafile after the intended time of recovery, you do not need to restore a backup for this file since it will no longer be used for the database after recovery is complete.
If you solved the hardware problem that caused a media failure and can restore all datafiles to their original locations, then restore the files. If a hardware problem persists, restore damaged datafiles to an alternative storage device. Note: Files in read-only tablespaces should be taken offline if you are using a control file backup. Otherwise, recovery will try to update the headers of the read-only files.
To perform cancel-based recovery:. Oracle applies the necessary redo log files to reconstruct the restored datafiles. Note that if the control file is a backup file, you must supply names of online logs. Note: If you use an OPS configuration, and you are performing incomplete recovery or using a backup control file, then Oracle can only compute the name of the first archived redo log file from the first thread.
The first redo log file from the other threads must be supplied by the user. Once the first log file in a given thread has been supplied, Oracle can suggest the names of the subsequent log files in those threads. Continue applying redo log files until the most recent, undamaged redo log file has been applied to the restored datafiles.
Cancel recovery after Oracle has applied the redo log file just prior to the damaged file: CANCEL Oracle returns a message indicating whether recovery is successful. Note that if you cancel recovery before it is complete and then try to open the database, you will get an ORA error if more recovery is necessary for the file.
This section describes how to perform the time-based media recovery procedure in these stages:. Note: If you are performing time-based, incomplete recovery using a backup control file and have read-only tablespaces, contact Oracle Support before attempting this procedure. To prepare for time-based recovery:. The Oracle docs note this on the ORA error:. Action: First apply media recovery to the file. The ORA error can be thrown when you begin to start Oracle with the "startup" command.
The ORA has many causes:. As a note, if you are using a standby database, many people often make the mistake of using a hot backup, while forgetting to issue an ' alter tablespace Alter database datafile 15 end backup;.
Alter database end backup;. This type of recovery will be required for systems that have a sudden loss of power or database crash while not running a tape backup. This is only required if the database does not open automatically after a Startup command. Recover datafile 12;. Recover datafile 15;.
Alter database datafile 12 online;. Alter database datafile 15 online;. Alter database open;. Shutdown immediate;. If the alter database open command failed in the previous step, then try to recover the database with the following steps:.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.
Linked 3. Related 1. Hot Network Questions.
0コメント