一、
查看某一张表的的行移动功能是不是开启的
SQL> select row_movement from user_tables where table_name = 'ZSX';
ROW_MOVE
--------
DISABLED
查看某一张表的的行移动功能是不是开启的
SQL> select row_movement from user_tables where table_name = 'ZSX';
ROW_MOVE
--------
DISABLED
二、
启动某张表的行移动功能
SQL> alter table zsx enable row movement;
Table altered.
SQL> select row_movement from user_tables where table_name = 'ZSX';
ROW_MOVE
--------
ENABLED
启动某张表的行移动功能
SQL> alter table zsx enable row movement;
Table altered.
SQL> select row_movement from user_tables where table_name = 'ZSX';
ROW_MOVE
--------
ENABLED
三、
禁止某张表的行移动功能
SQL> alter table zsx disable row movement;
Table altered.
SQL> select row_movement from user_tables where table_name = 'ZSX';
ROW_MOVE
--------
DISABLED
禁止某张表的行移动功能
SQL> alter table zsx disable row movement;
Table altered.
SQL> select row_movement from user_tables where table_name = 'ZSX';
ROW_MOVE
--------
DISABLED
四、
实例:
将一张表闪回到过去的某个时间点,主要是用于某张表错误的更新
1、
启动表的行移动功能
SQL> alter table zsx enable row movement;
2、
查询表中的数据
SQL> select * from zsx;
ID
----------
1
3、
查询现在的SCN
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
692434
4、
删除表中的数据
SQL> delete from zsx;
1 row deleted.
SQL> commit;
Commit complete.
5、
现在再次查看表中的数据
SQL> select * from zsx;
no rows selected
6、
闪回这张表到scn692434
SQL> flashback table zsx to scn 692434;
Flashback complete.
7、
再次查询这张表,如果有数据,就证明闪回生效了
SQL> select * from zsx;
ID
----------
1
实例:
将一张表闪回到过去的某个时间点,主要是用于某张表错误的更新
1、
启动表的行移动功能
SQL> alter table zsx enable row movement;
2、
查询表中的数据
SQL> select * from zsx;
ID
----------
1
3、
查询现在的SCN
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
692434
4、
删除表中的数据
SQL> delete from zsx;
1 row deleted.
SQL> commit;
Commit complete.
5、
现在再次查看表中的数据
SQL> select * from zsx;
no rows selected
6、
闪回这张表到scn692434
SQL> flashback table zsx to scn 692434;
Flashback complete.
7、
再次查询这张表,如果有数据,就证明闪回生效了
SQL> select * from zsx;
ID
----------
1
flashback table emp3 to timestamp sysdate-10/1440;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29107230/viewspace-769172/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29107230/viewspace-769172/