You execute the following FLASHBACK TABLE command:
SQL> FLASHBACK TABLE emp TO TIMESTAMP TO_TIMESTAMP(‘2008-01-04 11:00:00’,’YYYY-MMDD
HH24:MI:SS’);
Which two statements are correct? (Choose two.)
A.
The emp table that was dropped by mistake earlier is restored.
B.
The FLASHBACK TABLE statement is executed as a single transaction.
C.
The FLASHBACK TABLE statement does not maintain existing indexes on the emp table.
D.
The changes made to the emp table since the specified time are undone if no constraint is violated during
flashback.
Explanation:
FLASHBACK TABLE (Link)
Purpose
Use the FLASHBACK TABLE statement to restore an earlier state of a table in the event of human or
application error. The time in the past to which the table can be flashed back is dependent on the amount of
undo data in the system. Also, Oracle Database cannot restore a table to an earlier state across any DDL
operations that change the structure of the table.
Semantics
During an Oracle Flashback Table operation, Oracle Database acquires exclusive DML locks on all the tables
specified in the Flashback list. These locks prevent any operations on the tables while they are reverting to their
earlier state.
The Flashback Table operation is executed in a single transaction, regardless of the number of tables specified
in the Flashback list. Either all of the tables revert to the earlier state or none of them do. If the Flashback Table
operation fails on any table, then the entire statement fails.
At the completion of the Flashback Table operation, the data in table is consistent with table at the earlier time.
However, FLASHBACK TABLE TO SCN or TIMESTAMP does not preserve rowids, and FLASHBACK TABLE
TO BEFORE DROP does not recover referential constraints.
Oracle Database does not revert statistics associated with table to their earlier form. Indexes on table that exist
currently are reverted and reflect the state of the table at the Flashback point. If the index exists now but did not
yet exist at the Flashback point, then the database updates the index to reflect the state of the table at the
Flashback point. However, indexes that were dropped during the interval between the Flashback point and the
current time are not restored.
Logical Flashback Features Useful in Backup and Recovery (Link)
The remaining flashback features operate at the logical level. The logical features documented in this chapter
are as follows:
Flashback Table
You can recover a table or set of tables to a specified point in time in the past without taking any part of the
database offline. In many cases, Flashback Table eliminates the need to perform more complicated point-intime recovery operations. Flashback Table restores tables while automatically maintaining associated attributes
such as current indexes, triggers and constraints, and not requiring you to find and restore application-specific
properties.
“Rewinding a Table with Flashback Table” explains how to use this feature.
Flashback Drop
You can reverse the effects of a DROP TABLE statement.
“Rewinding a DROP TABLE Operation with Flashback Drop” explains how to use this feature.
Note:
Because the logical flashback features have uses not specific to backup and recovery, some documentation for
them is located elsewhere in the documentation set.
All logical flashback features except Flashback Drop rely on undo data. Used primarily for providing read
consistency for SQL queries and rolling back transactions, undo records contain the information required to
reconstruct data as it existed at a past time and examine the record of changes since that past time.