053 V10.02 1-100

来源:互联网 发布:95年nba总决赛数据 编辑:程序博客网 时间:2024/06/11 12:16
1.What are the prerequisites for performing flashback transactions? (Choose all that apply)
A.Supplemental log must be enabled
B.Supplemental log must be enabled for the primary key
C.Undo retention guarantee for the database must be configured
D.EXECUTE permission on the DBMS_FLASHBACK package must be granted to the user
Oracle Flashback Query feature lets you specify a target time and then run queries against your database, viewing results as they would have appeared at that time. To recover from an unwanted change like an erroneous update to a table, a user could choose a target time before the error and run a query to retrieve the contents of the lost rows. 
行级别的恢复查询,一般是误更新数据,或者误删除部分表数据,可以让你查询某个时刻的表数据。
·  Oracle Flashback Version Query lets you view all the versions of all the rows that ever existed in one or more tables in a specified time interval. You can also retrieve metadata about the differing versions of the rows, including start time, end time, operation, and transaction ID of the transaction that created the version. This feature can be used both to recover lost data values and to audit changes to the tables queried. 
也属于行级别的,不同的是可以查询某段时间数据的变化。
·  Oracle Flashback Transaction Query lets you view changes made by a single transaction, or by all the transactions during a period of time. 
事务级别的查询。
·  Oracle Flashback Table returns a table to its state at a previous point in time. You can restore table data while the database is online, undoing changes only to the specified table. 
表级别的闪回,使表恢复到过去某一个时刻。
·  Oracle Flashback Drop reverses the effects of a DROP TABLE statement. 
表级别的闪回,使表恢复到被删除前的状态。
·  Oracle Flashback Database provides a more efficient alternative to database point-in-time recovery. When you use flashback database, your current datafiles revert to their contents at a past time. The result is much like the result of a point-in-time recovery using datafile backups and redo logs, but you do not have to restore datafiles from backup and you do not have to re-apply as many individual changes in the redo logs as you would have to do in conventional media recovery.
数据库级别的闪回,使整个数据库恢复到过去的某一个时刻。

Flashback Table, Flashback Query, Flashback Transaction Query and Flashback Version Query all rely on undo data, undo_retention 参数决定了flashback Query所能回去的时间,Flashback Drop使用的是表空间的空间,Flashback Database依赖于归档日志,所以Flashback Database必须数据库在归档模式下。


Configuring Your Database for Flashback Transaction

To configure your database for the Flashback Transaction feature, you or your database administrator must:

  • With the database mounted but not open, enable ARCHIVELOG:

    ALTER DATABASE ARCHIVELOG;
  • Open at least one archive log:

    ALTER SYSTEM ARCHIVE LOG CURRENT;
  • If not done, enable minimal and primary key supplemental logging:

    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
  • If you want to track foreign key dependencies, enable foreign key supplemental logging:

    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS;

Note:

If you have very many foreign key constraints, enabling foreign key supplemental logging might not be worth the performance penalty.