ITPub博客

首页 > 数据库 > Oracle > OCP题库解析-1z0-053-QUESTION-NO.615

OCP题库解析-1z0-053-QUESTION-NO.615

原创 Oracle 作者:dearloki 时间:2014-01-29 00:20:27 0 删除 编辑

【关键词】 Flashback,闪回

     615.Before a Flashback Table operation, you execute the following command: ALTER TABLE employees ENABLE ROW MOVEMENT;

     Why would you need this to be executed?

     A. Because row IDs may change during the flashback operation

     B. Because the object number changes after the flashback operation

     C. Because the rows are retrieved from the recycle bin during the flashback operation

     D. Because the table is moved forward and back to a temporary during the flashback opertion 

【题目示意】

     考察Flashback相关知识

【解析】

      Before you can use Flashback Table, you must ensure that row movement is enabled on the table to be flashed back, or returned to a previous state. Row movement indicates that rowids will change after the flashback occurs. This restriction exists because if rowids before the flashback were stored by an application, then there is no guarantee that the rowids will correspond to the same rows after the flashback.

       当flashback时会造成rowID改变。

【实验】

     实验环境:CenOS_6.3-x86,Oracle 11G x86

     实验目的:证明在flashback table前,需要执行ALTER TABLE xxxx ENABLE ROW MOVEMENT

     实验步骤:

          1、创建表,并查询当前SCN

 

 

2、对表中数据进行更改,并提交

 

 

3、不执行ALTER TABLE scott.emp ENABLE ROW MOVEMENT进行闪回,和执行ALTER TABLE scott.emp ENABLE ROW MOVEMENT返回的结果

 

 

      实验结果 :

       flashback table前,需要执行ALTER TABLE xxxx ENABLE ROW MOVEMENT

       不执行将会报错ORA-08189

       实验代码:

http://app.yinxiang.com/shard/s8/sh/28b6b798-958e-4c29-8c3b-ded460a9cc5b/80618e55191431fe9a7ef38c6febb9f5
http://pan.baidu.com/s/1gdeJtjt

【小结】

               在flashback 时,为了保证rowID不发生变化,应该使用ALTER TABLE xxxxx ENABLE ROW MOVEMENT;

【答案】:A


相关参考:

http://docs.oracle.com/cd/E11882_01/server.112/e10897/backrest.htm#ADMQS09431


                                                                                                                                                                 DB_Loki

                                                                                                                                                               2014-01-28

Mail:dearloki@hotmail.com

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

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2014-01-18

  • 博文量
    4
  • 访问量
    23810