【关键词】 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
实验代码:
【小结】
在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
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26751012/viewspace-1076365/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26751012/viewspace-1076365/