053-56

You discover that your Recycle Bin contains two tables with the same name, MY_TABLE. You also
have a table named MY_TABLE in your schema. You execute the following statement:
FLASHBACK TABLE my_table TO BEFORE DROP RENAME TO my_table2;
What will be the result of executing this statement?
A. One of the tables is recovered from the Recycle Bin using a First In First Out (FIFO) approach.
B. One of the tables is recovered from the Recycle Bin using a Last In First Out (LIFO) approach.
C. Both the tables are recovered from the Recycle Bin with one table renamed to MY_TABLE2 and the other to a system-generated name.
D. None of the tables are recovered from the Recycle Bin, and the statement returns an error.

flashback table to before drop 恢复的时最近被回收站收纳的表,所以后进last in先出first out.
此题考点是使用 FLASHBACK TABLE ... TO BEFORE DROP 语句从回收站内恢复表。
你可以指定其原始名称或者在回收站内的系统生成的名称。在多次删除一个表时,回收站中系统的名称对于恢复是有帮助的,其名称是唯一的。可以通过下列语句查询:
SELECT object_name, original_name, createtime FROM recyclebin;
SELECT * FROM RECYCLEBIN;
SELECT * FROM USER_RECYCLEBIN;
注意,表上相关的索引对象不会恢复(位图连接索引和全文索引不能恢复,触发器会自动关联,除非已经 关联到其他对象上),需要手动的执行恢复,例如:
SELECT INDEX_NAME FROM USER_INDEXES WHERE TABLE_NAME = 'JOB_HISTORY';
ALTER INDEX "BIN$DBo9UChtZSbgQFeMiAdCcQ==$0" RENAME TO JHIST_JOB_IX;
--物化视图 log 也不能恢复
如果在恢复时,指定了原始名称,并且回收站内包含多个这个名称的表,那么数据库会检索最近移动到回收 站 内 的 表 来 恢 复 。 如 果 你 想 恢 复 更 早 的 表 , 除 了 执 行 系 统 名 称 外 , 还 可 以 不 断 的 执 行FLASHBACK TABLE ... TO BEFORE DROP 语句知道恢复了你想恢复的表为止
注意:如果新表被创建到相同方案中,但是这个表名称已经有了,那么数据库会返回一个错误,除非你指定了 RENAME TO 子句。
此题使用原始名称恢复,所以是后进先出进行恢复,在方案中虽然存在相同名称的表,由于指定了 RENAME TO 子句所以可以正常恢复,不会报错。
答案:B


原文地址:https://www.cnblogs.com/Babylon/p/7845203.html