Recovering from a Lost SPFILE or Control File
Recovering from a Lost SPFILE or Control File
Recovery from loss of the control file or SPFILE must be started with the database shut down. Note that the instance cannot be running if the control file is lost.
Typically, diagnosis of the lost control file occurs when you attempt to start the database and the startup fails. The basic steps are as follows:
1. From the database home page, click Startup to attempt to start the database.
2. If the startup fails, click View Details to view the reason.
3. If the cause is a failure to locate the SPFILE or control file, return to the database home page and click Perform Recovery.
4. From this point, Enterprise Manager's Guided Recovery walks you through the process to restore the lost files.
After the control file is restored from backup, the database is mounted. When a control file restored from backup is used to start the database, you must perform complete recovery of the datafiles, even if none of the datafiles have been restored from backup. The database must be opened with the RESETLOGS option after the datafiles are recovered.
To perform complete recovery of the datafiles, use the following steps:
1. On the Perform Recovery page, select Recover to the current time or a previous point in time and click Perform Whole Database Recovery.
2. On the Perform Whole Database Recovery: Rename page, select Restore files to the default location and click Next.
3. On the Perform Whole Database Recovery: Review page, click Submit to start the media recovery process.
When recovery is complete, you are prompted to open the database with the RESETLOGS option.
Validating the Restore of Datafiles from RMAN Backup
Validating the restore of datafiles from a backup tests whether a sufficient set of backups exists that can be used to restore the specified files. After you specify which tablespaces to restore and, possibly, a point in time as of which to restore them, RMAN selects a set of backups that contain the needed data. RMAN then reads the selected backups in their entirety to confirm that they are not corrupt.
Note: This operation corresponds to the RESTORE ... VALIDATE command in Recovery Manager. See Oracle Database Backup and Recovery Basics for more information.
Validating the restore of files tests whether the file can be restored given the available backups, but it does not test whether all backups of the specified object are valid.
Validating particular backups and validating specific restore tasks are both useful in validating your backup strategy. For more information, see "Validating Backups and Testing Your Backup Strategy" on page 9-16.
9-20 Oracle Database 2 Day DBA
1. In the Backup/Recovery section of the Maintenance property page, click Perform Recovery .
The Perform Recovery page appears.
2. Specify the datafiles to validate individually or you can specify entire tablespaces. In the Object Level Recovery section, select Datafiles or Tablespaces. For the Operation Type, select Restore Datafiles or Restore Tablespaces. Make sure the host credentials are correct, and click Perform Object Level Recovery.
The Perform Object Level Recovery page appears.
3. Click Add to add tablespaces or datafiles for the validate operation. After making your selections, click Next.
The Perform Object Level Recovery: Restore page appears.
4. In the Backup Selection section, specify which backups to restore from. In the Backup Validation section, be sure to check Validate the specified backup without restoring the datafiles . Then click Next.
The Perform Object Level Recovery: Schedule page appears.
5. Specify a job name and description. The job will run immediately, so you are not prompted for a scheduled time. Click Next.
The Perform Object Level Recovery: Review page appears.
6. You can edit the RMAN script to be run or leave it as-is. Click Submit Job to run the validation.
The Perform Recovery: Result page appears.
7. Click View Job to view the progress of the running job, or click OK to return to the database home page.
Returning a Table to a Past State: Flashback Table
Oracle Flashback Table lets you revert one or more tables back to their contents at a previous time without affecting other objects in your database. This recovery technique lets you recover from logical data corruptions, such as erroneously inserting rows into a table or deleting data from a table. Flashback Table lets you return tables you select to their state at a past point in time without undoing desired changes to the other objects in your database, as would be required by a point-in-time recovery of the entire database. Also, unlike point-in-time recovery, your database remains available during the operation.
For this example, you will perform Flashback Table on the employees table in the hr schema. Assume that an erroneous update shortly after October 23, 2005, 15:30:00 has changed the lastname column for all employees to an empty string and you need to return the original lastname values to the table.
Before you can perform Flashback Table, you must ensure that row movement is enabled on the table to be flashed back.
Enabling Row Movement on a Table
To enable row movement on a table, or if you do not know whether row movement is enabled on the table, follow these steps:
1. In the Database Objects section of the Administration page, click Tables to administer tables.
The Tables page appears.
Performing Backup and Recovery 9-21
2. To find the target table for flashback table, you can enter one or both of the schema name in the Schema field and the table name in the Object Name field. Then click Go to search for the table. For example, search for tables in the hr schema. You may need to page through the search results to find your table.
3. After you find your table in the schema, select the table from the list of tables. For example, select employees. Click Edit.
The Edit Table: table_name page appears.
4. Click Options to navigate to the Options property page. Make sure Enable Row Movement is set to Yes, and click Apply to update the options for the table.
When the page has refreshed, you can click Tables in the locator link at the top of the page to return to the search results, and enable row movement on more tables by repeating these steps for each table.