QUESTION NO: 380
Which of the following statements best describes Flashback Versions Query?
A. Flashback Versions Query is used to make changes to multiple versions of data that existed between two points in time.
B. Flashback Versions Query is used to view all version changes on rows that existed between the time the query was executed and a point in time in the past.
C. Flashback Versions Query is used to view version changes and the SQL to undo those changes on rows that existed between two points in time.
D. Flashback Versions Query is used to view all version changes on rows that existed between two points in time.
【题目示意】
此题考查有关于 Flashback Versions Query的相关知识。
【解析】
Flashback Versions Query是Oracle来检索在一个给定的时间间隔特定行存在的不同版本。每执行一次COMMIT语句创建一行版本。
Oracle Flashback版本查询返回任何时候在指定的时间间隔为每个版本的一行存在的一个表。这些信息时,可以揭示特定发生改变(可能是错误的)数据库。
【实验】
1)执行DML操作
SQL> create table test (a int);
Table created.
SQL> insert into test values(1);
1 row created.
SQL> insert into test values(2);
1 row created.
SQL> insert into test values(3);
1 row created.
SQL> select * from test;
A
----------
1
2
3
SQL> commit;
Commit complete.
SQL> delete from test where a=1;
1 row deleted.
SQL> commit;
Commit complete.
SQL> delete from test where a=2;
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from test;
A
----------
3
SQL> update test set a=4;
1 row updated.
SQL> commit;
Commit complete.
SQL> select * from test;
A
----------
4
SQL> commit;
Commit complete.
2)执行闪回版本查询
SQL> select versions_starttime, versions_endtime, versions_xid,
2 versions_operation, a
3 from test versions between timestamp minvalue and maxvalue;
VERSIONS_STARTTIME VERSIONS_ENDTIME VERSIONS_XID V A
---------------------------------------------------------------------------
02-FEB-14 07.04.25 PM 0A000F0087020000 U 4
02-FEB-14 07.03.42 PM 03000B0066030000 D 2
02-FEB-14 07.03.24 PM 05001300FF030000 D 1
02-FEB-14 07.02.44 PM 02-FEB-14 07.04.25 PM 04000800CC020000 I 3
02-FEB-14 07.02.44 PM 02-FEB-14 07.03.42 PM 04000800CC020000 I 2
02-FEB-14 07.02.44 PM 02-FEB-14 07.03.24 PM 04000800CC020000 I 1
从VERSIONS_XID可以看出commit一次就会有一个行版本号。
【小结】
闪回版本查询就是两个时间点之间,所有版本数据行的更改。因此选择D
【答案】 D
相关参考
http://docs.oracle.com/cd/E11882_01/appdev.112/e41502/adfns_flashback.htm#ADFNS622
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29435844/viewspace-1078496/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29435844/viewspace-1078496/