Oracle Flashback Technology

Oracle Database provides a group of features known as Oracle Flashback Technology that support viewing past states of data, and winding data back and forth in time, without requiring the restore of the database from backup. Depending on the changes to your database, Flashback features can often reverse the unwanted changes more quickly and with less impact on database availability than media recovery.

Oracle Flashback Database

Oracle Flashback Database enables you to rewind an Oracle database to a previous time to correct problems caused by logical data corruptions or user errors.

If a flash recovery area is configured, and if you have enabled the Flashback database functionality, then you can use the RMAN or SQL FLASHBACK DATABASE command to return the database to a prior time. Flashback Database is not true media recovery because it does not involve restoring physical files. Flashback Database is preferable to using the RESTORE and RECOVER commands in some cases because it is faster and easier and does not require restoring the whole database.

When you use Flashback Database, Oracle Database uses past block images to back out changes to the database. During normal database operation, Oracle Database occasionally logs these block images in flashback logs. Flashback logs are written sequentially and are not archived. Oracle Database automatically creates, deletes, and resizes flashback logs in the flash recovery area. You only need to be aware of flashback logs for monitoring performance and deciding how much disk space to allocate to the flash recovery area for flashback logs.

The time it takes to rewind a database with FLASHBACK DATABASE is proportional to how far back in time you must go and the amount of database activity after the target time. The time it would take to restore and recover the whole database could be much longer. The before images in the flashback logs are only used to restore the database to a point in the past, and forward recovery is used to bring the database to a consistent state at some time in the past. Oracle Database returns datafiles to the previous point-in-time, but not auxiliary files, such as initialization parameter files.

Flashback database can also be used to compliment Data Guard, Recovery Advisor, and for synchronizing clone databases.

Oracle Flashback Table

Oracle Flashback Table enables you to rewind tables to a specified point in time with a single statement. You can restore table data along with associated indexes, triggers, and constraints, while the database is online, undoing changes to only the specified tables. Oracle Flashback Table does not address physical corruption such as bad disks or data segment and index inconsistencies.

Oracle Flashback Table works like a self-service repair tool. Suppose a user accidentally deletes some important rows from a table and wants to recover the deleted rows. You can restore the table to the time before the deletion and see the missing rows in the table with the FLASHBACK TABLE statement.

You can restore the table and its contents to a certain wall clock time or user-specified system change number (SCN). Use Oracle Flashback Table with Oracle Flashback Version Query and Oracle Flashback Transaction Query to find a time to which to restore the table.

For Oracle Flashback Table to succeed, the system must retain enough undo information to satisfy the specified SCN or timestamp, and the integrity constraints specified on the tables cannot be violated. Also, row movement must be enabled on the table.

The availability of retained undo information for Oracle Flashback Table is controlled by the automatically tuned undo retention period of the system. The undo retention period indicates the amount of time that must pass before old undo information—that is, undo information for committed transactions—can be overwritten. The database collects usage statistics and tunes the undo retention period based on these statistics and on undo tablespace size. You can request a minimum undo retention period by setting the UNDO_RETENTION initialization parameter.

Oracle Flashback Drop

Oracle Flashback Drop reverses the effects of a DROP TABLE operation. Flashback Drop is substantially faster than other recovery mechanisms that can be used in this situation, such as point-in-time recovery, and does not lead to any loss of recent transactions or downtime.

When you drop a table, the database does not immediately remove the space associated with the table. Instead, the table is renamed and, along with any associated objects, is placed in the recycle bin of the database. Oracle Database uses the recycle bin to manage dropped database objects until the space they occupied is needed to store new data. The recycle bin is actually a data dictionary table that contains information about the dropped objects.

posted @ 2009-08-15 21:44  Derek_nr  阅读(418)  评论(0编辑  收藏  举报