Nic*_*nov 29
您无法回滚已经提交的内容.在这种特殊情况下,作为最快的选项之一,您可以执行的操作是针对已删除行的表发出闪回查询并将其插回.这是一个简单的例子:
注意:此操作的成功取决于undo_retention
参数的值(默认值为900秒)- 在撤消表空间中保留撤消信息的时间段(可以自动减少).
/* our test table */
create table test_tb(
col number
);
/* populate test table with some sample data */
insert into test_tb(col)
select level
from dual
connect by level <= 2;
select * from test_tb;
COL
----------
1
2
/* delete everything from the test table */
delete from test_tb;
select * from test_tb;
no rows selected
Run Code Online (Sandbox Code Playgroud)
插入已删除的行:
/* flashback query to see contents of the test table
as of specific point in time in the past */
select * /* specify past time */
from test_tb as of timestamp timestamp '2013-11-08 10:54:00'
COL
----------
1
2
/* insert deleted rows */
insert into test_tb
select * /* specify past time */
from test_tb as of timestamp timestamp '2013-11-08 10:54:00'
minus
select *
from test_tb
select *
from test_tb;
COL
----------
1
2
Run Code Online (Sandbox Code Playgroud)