Performing Flashback Table
Performing Flashback Table
To perform the Flashback Table operation:
1. In the Backup/Recovery section of the Maintenance page, select Perform Recovery .
The Perform Recovery page appears.
2. In the Object Level Recovery section, select Tables for the object type. The page reloads with options appropriate for object level recovery of tables. Choose the Flashback Existing Tables option and click Perform Object Level Recovery.
The Perform Object Level Recovery: Point-in-time page appears.
3. Choose the target time for your Flashback Table operation.
Note: If you do not know the time at which the unwanted changes occurred, you can investigate the history of transactions affecting this table by choosing Evaluate row changes and transactions to decide upon a point in time . A feature called Oracle Flashback Versions Query lets you review all recent changes to the target table. Use of this feature is beyond the scope of this manual.
For this example, assume that the time of the corruption is known to be October
23, 2005, 15:36:00. In the form offered, select Flashback to a timestamp, and enter your target time. Click Next to continue with the Flashback Table process.
The Perform Object Level Recovery: Flashback Tables page appears.
4. Specify the target tables for Flashback Table by entering table names (one on each line) in the Tables to Flashback text box. You can enter multiple table names to flash several tables back to the same time. You can also click Add Tables and search for more tables to add. For this example, manually enter the
hr.employees table in the Tables to Flashback text box. Click Next to continue with the Flashback Table process.
If your table has other dependent tables, then the Dependency Options page appears. This page asks how dependencies should be handled.
5. You can choose Cascade (flashing back any dependent tables), Restrict (flashing back only the target table), or Customize (selecting which dependent tables to flashback and which to leave as they are). You can click Show Dependencies to
9-22 Oracle Database 2 Day DBA 9-22 Oracle Database 2 Day DBA
hr.employees has dependent tables hr.jobs and hr.departments. For this example, assume that it is safe to cascade any changes, flashing back those two tables as well as the hr.employees table.
Note: Row movement must be enabled on all affected tables, not just the initial target tables.
Click Next to continue. The Perform Object Level Recovery: Review page appears.
6. Review the target timestamp and tables to be flashed back. Click Submit to perform the Flashback Table operation.
When the operation is completed, a Confirmation page displays the results. Click OK to return to the database home page.
Recovering Dropped Tables: Flashback Drop
Oracle Flashback Drop lets you reverse the effects of dropping a table, returning the dropped table to the database along with its dependent objects such as indexes and triggers. It works by storing dropped objects in a Recycle Bin, from which they may be retrieved until the Recycle Bin is purged, either explicitly or because space is needed for new database objects.
As with Flashback Table, Flashback Drop can be used while the rest of your database remains open, and without undoing desired changes in objects not affected by the Flashback Drop operation. It is more convenient than forms of recovery that require taking the database offline and restoring files from backup.
Note: For a table to be recoverable using Flashback Drop, it must reside in a locally managed tablespace. Also, tables in the SYSTEM tablespaces cannot recovered using Flashback Drop regardless of the tablespace type.
To perform the Flashback Drop operation:
1. In the Backup/Recovery section of the Maintenance page, select Perform Recovery .
The Perform Recovery page appears.
2. In the Object Level Recovery section, select Tables for the object type. The page reloads with options appropriate for tables in the Object Level Recovery section. For the Operation Type, select Flashback dropped tables and click Perform Object Level Recovery .
The Perform Object Level Recovery: Dropped Objects Selection page appears.
3. The Search form lets you search among the dropped objects in the Recycle Bin for the objects you want to recover. Provide values for one or both of the Schema Name and Table fields, and click Go to search.
When the page refreshes, the Results section lists the objects matching your search. If you only see the Recycle Bin listed, then click the arrow next to the Recycle Bin
Performing Backup and Recovery 9-23 Performing Backup and Recovery 9-23
Note: When a table is retrieved from the Recycle Bin, all of the dependent objects for the table that are in the recycle bin are retrieved with it. They cannot be retrieved separately.
When you have selected all of the objects to restore, click Next. The Perform Object Level Recovery: Rename page appears.
4. If needed, specify new names for any dropped objects you are returning to your database. The primary reason for renaming objects when you retrieve them from the recycle bin is if you have created new tables with the same names as tables being retrieved. If you need to rename some objects, then enter new names as needed in the New Name field in the list of tables being flashed back. Click Next to continue.
The Perform Object Level Recovery: Review page appears. This page displays an impact analysis, showing the full set of objects to be flashed back, including the dependent objects, as well as the names they will have when the Flashback Drop operation is complete.
5. If you are satisfied with the changes listed in the review, click Submit to perform the Flashback Drop.
A confirmation page should indicate the success of the operation.
6. Click OK to return to the database home page.
Managing Your Backups
Managing RMAN backups, with or without Enterprise Manager, consists of two tasks: managing the backups of your database that are stored on disk or tape, and managing the record of those backups in the RMAN repository. Enterprise Manager simplifies both backup management tasks.
Backup Management: Concepts
A backup recorded in the RMAN repository can be in one of the following states:
Available, meaning that the backup is still present on disk or tape, as recorded in the repository
Expired, meaning that the backup no longer exists on disk or tape but is still listed in the repository
Unavailable, meaning that the backup is temporarily not available for data recovery operations (because, for example, it is stored on a tape that is stored off-site or a disk that is not mounted at the moment)
Backups can also be obsolete. An obsolete backup is one which, based on the currently configured retention policy, is no longer needed to satisfy data recovery goals.
9-24 Oracle Database 2 Day DBA
Backup maintenance tasks that you can perform in Enterprise Manager include the following:
Viewing details about your backups
Crosschecking your repository, which checks whether backups listed in the repository exist and are accessible and marks as expired any backups not accessible at the time of the crosscheck
Deleting the record of expired backups from your RMAN repository
Deleting obsolete backups from the repository and from disk
Validating backups, to ensure that a given backup is still available and has not been corrupted
Note: If a backup no longer exists, immediately delete the record of that backup from the RMAN repository. Without an accurate record of available backups, you may discover that you no longer have complete backups of your database when you try to perform a database recovery operation.
Note that if you use a flash recovery area for your backup storage, many maintenance activities are reduced or eliminated. The flash recovery area's automatic disk space management mechanisms delete backups and other files as needed, to satisfy demands for space in ongoing database operations, without compromising the retention policy.
Using the Manage Current Backups Page
To access backup management functions, navigate to the database home page and click Maintenance to open the Maintenance property page. In the Backup/Recovery section, click Manage Current Backups.
The Manage Current Backups page has two property pages you can choose: Backup Set and Image Copy. Each serves a similar purpose, listing backups (stored as backup sets or image copies), based on the record in the Recovery Manager repository, and allowing for management of the backups listed. Figure 9–3, "Manage Current Backups Page" shows a typical view of the Backup Set property page.
Performing Backup and Recovery 9-25
Figure 9–3 Manage Current Backups Page
The Image Copies property page is similar, with the same operations supported. The elements on the Manage Current Backups page can be categorized as follows:
Buttons at the top of the page that allow you to perform maintenance tasks related to your entire collection of backups
The Search section, which enables you to select a subset of your backup sets or image copies for maintenance actions
The Results section, where you can select individual backups for maintenance actions, invoked using buttons at the top of the Results section
9-26 Oracle Database 2 Day DBA
Searching for Backups on the Manage Current Backups Page
The Search section of each property page lets you restrict the listed backups based on the following:
Backup status (available, unavailable, or expired)
The types of files contained in the backup (archived log, datafile, control file, or SPFILE)
How recently the backup was completed By default, all available backups from the last month are listed. Specify criteria as
necessary to filter the backup list, and click Go to search the backups. The Results section of the page lists backups that match the criteria specified in the
Search section. Different details are listed for backup sets (on the Backup Sets property page) and for image copies (on the Image Copies property page).