Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
4.96 Mб

Overview of Flashback Features

Overview of Flashback Features

Oracle Database has a group of features, known collectively as flashback, that provide ways to view past states of database objects, or to return database objects to a previous state, without using traditional point-in-time recovery.

Flashback features of the database can be used to:

Perform queries that return past data.

Perform queries that return metadata showing a detailed history of changes to the database.

Recover tables or individual rows to a previous point in time.

Flashback features use the Automatic Undo Management system to obtain metadata and historical data for transactions. They rely on undo data: records of the effects of individual transactions. Undo data is persistent and survives a database malfunction or shutdown. Using flashback features, you employ undo data to query past data or recover from logical corruptions. Besides your use of it in flashback operations, undo data is used by Oracle Database to do the following:

rollback active transactions

recover terminated transactions using database or process recovery

provide read consistency for SQL queries

See Also: Oracle Database Concepts for more information about flashback features and automatic undo management

Application Development Features

In application development, flashback features can be used to report on historical data or undo erroneous changes. Flashback features that allow you to do this include:

Oracle Flashback Query - retrieve data for a time in the past that you specify using the AS OF clause of the SELECT statement.

Oracle Flashback Version Query - retrieve metadata and historical data for a specific time interval. You can view all the rows of a table that ever existed during a given time interval. Metadata about the different versions of rows includes start and end time, type of change operation, and identity of the transaction that created the row version. You use the VERSIONS BETWEEN clause of the SELECT statement to create a Flashback Version Query.

15-2 Oracle Database Application Developer's Guide - Fundamentals

Overview of Flashback Features

Oracle Flashback Transaction Query - retrieve metadata and historical data for a given transaction, or for all transactions within a given time interval. You can also obtain the SQL code to undo the changes to particular rows affected by a transaction. You typically use Flashback Transaction Query in conjunction with a Flashback Version Query that provides the transaction IDs for the rows of interest. To perform a Flashback Transaction Query, you select from the


DBMS_FLASHBACK package – set the clock back to a time in the past, to examine data current at that time.

Database Administration Features

You can use the DBMS_FLASHBACK package, Flashback Query, Flashback Version Query, and Flashback Transaction Query for application development or interactively, as a database user or administrator.

Other flashback features are typically used only in database administration tasks:

Oracle Flashback Table - recover a table to its state at a previous point in time. You can restore table data while the database is on line, undoing changes to only the specified table.

Oracle Flashback Drop - recover a dropped table. This reverses the effects of a DROP TABLE statement.

Oracle Flashback Database – quickly return the database to an earlier point in time, by undoing all of the changes that have taken place since then. This is fast, because you do not have to restore database backups.

Flashback Database, Flashback Table, and Flashback Drop are primarily provided as data recovery mechanisms and are therefore documented elsewhere. The other flashback features, while valuable in data recovery scenarios, are also used in contexts such as application development. They are therefore the focus of this chapter.

Using Flashback Features 15-3

Соседние файлы в папке Oracle 10g