OCP-IZO-053_QUESTION382

QUESTION NO: 382 

Which of the following can be used in conjunction with a Flashback Versions Query to filter the results? (Choose all that apply.)

A. A range of SCN values

B. A list of SCN values

C. A starting and ending timestamp

D. Minimum and maximum sequence values

E. A list of sequence values

 

【题目示意】

此题考查有关于Flashback Versions Query 的相关知识。

【解析】

Flashback Versions Query是Oracle来检索在一个给定的时间间隔特定行存在的不同版本。每执行一次COMMIT语句创建一行版本。

Oracle Flashback Version Query Row Data Pseudocolumns

Pseudocolumn Name

Description

VERSIONS_STARTSCN

VERSIONS_STARTTIME

Starting System Change Number (SCN) or TIMESTAMP when the row version was created. This pseudocolumn identifies the time when the data first had the values reflected in the row version. Use this pseudocolumn to identify the past target time for Oracle Flashback Table or Oracle Flashback Query.

If this pseudocolumn is NULL, then the row version was created before start.

VERSIONS_ENDSCN

VERSIONS_ENDTIME

SCN or TIMESTAMP when the row version expired.

If this pseudocolumn is NULL, then either the row version was current at the time of the query or the row corresponds to a DELETE operation.

VERSIONS_XID

Identifier of the transaction that created the row version.

VERSIONS_OPERATION

Operation performed by the transaction: I for insertion, D for deletion, or U for update. The version is that of the row that was inserted, deleted, or updated; that is, the row after an INSERT operation, the row before a DELETEoperation, or the row affected by an UPDATE operation.

For user updates of an index key, Oracle Flashback Version Query might treat an UPDATE operation as two operations, DELETE plus INSERT, represented as two version rows with a D followed by an I VERSIONS_OPERATION.

 

【实验】

1)执行DML操作

SYS@ENMOEDU >create table test (a int);

 

Table created.

 

SYS@ENMOEDU >insert into test values(1);

 

1 row created.

 

SYS@ENMOEDU >insert into test values(2);

 

1 row created.

 

SYS@ENMOEDU >insert into test values(3);

 

1 row created.

 

SYS@ENMOEDU >commit;

 

Commit complete.

 

SYS@ENMOEDU >select * from test;

 

         A

----------

         1

         2

         3

 

SYS@ENMOEDU >commit;

 

Commit complete.

SYS@ENMOEDU >delete from test where a=1;

 

1 row deleted.

 

SYS@ENMOEDU >commit;

 

Commit complete.

 

SYS@ENMOEDU >delete from test where a=2;

 

1 row deleted.

 

SYS@ENMOEDU >commit;

 

Commit complete.

 

SYS@ENMOEDU >select * from test;

 

         A

----------

         3

 

SYS@ENMOEDU >update test set a=4;

 

1 row updated.

 

SYS@ENMOEDU >commit;

 

Commit complete.

 

SYS@ENMOEDU >select * from test;

 

         A

----------

         4

 

SYS@ENMOEDU >commit;

 

Commit complete.

 

2)执行闪回查询

 SYS@ENMOEDU >select versions_startscn, versions_endscn, versions_xid,

                versions_operation, a

                   from test versions between scn minvalue and maxvalue;

 

VERSIONS_STARTSCN VERSIONS_ENDSCN VERSIONS_XID     V          A

----------------- --------------- ---------------- - ----------

          1404855                 02000B0078030000 U          4

          1404831                 04000900D5020000 D          2

          1404827                 010001008F020000 D          1

          1404787         1404855 0300050075030000 I          3

          1404787         1404831 0300050075030000 I          2

          1404787         1404827 0300050075030000 I          1

 

6 rows selected.

 

SYS@ENMOEDU > select versions_starttime, versions_endtime, versions_xid,

               versions_operation, a

                 from test versions between timestamp minvalue and maxvalue;

 

VERSIONS_STARTTIME   VERSIONS_ENDTIME             VERSIONS_XID         V     A

---------------- - ----------------------- - ----------------------- - ----------

03-FEB-14 11.33.57 AM                            02000B0078030000       U    4

03-FEB-14 11.33.17 AM                            04000900D5020000       D    2

03-FEB-14 11.33.11 AM                            010001008F020000       D    1

03-FEB-14 11.31.58 AM  03-FEB-14 11.33.57 AM     0300050075030000       I    3

03-FEB-14 11.31.58 AM  03-FEB-14 11.33.17 AM     0300050075030000       I    2

03-FEB-14 11.31.58 AM  03-FEB-14 11.33.11 AM     0300050075030000       I    1

 

6 rows selected.

 

【小结】

可以得出在闪回查询的时候,即可以是用SCN指定查询的范围,也可以是timestamp指定查询的时间范围,因此选择AC

【答案】 AC

 

相关参考

http://docs.oracle.com/cd/E11882_01/appdev.112/e41502/adfns_flashback.htm#ADFNS622

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29435844/viewspace-1078500/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29435844/viewspace-1078500/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值