利用闪回查看Oracle表历史时刻数据
利用闪回查看Oracle表历史时刻数据
1.查看表历史时刻数据
select * from tab_test AS OF TIMESTAMP to_timestamp('20140917 10:00:00','yyyymmdd hh24:mi:ss');
2、利用flashback table恢复表到过去某一时刻
alter table tab_test enable row movement;
flashback table tab_test to timestamp ('20140917 10:00:00','yyyymmdd hh24:mi:ss');
alter table tab_test disable row movement;
3、查看过去某一段时间内对表的操作,以确认需要恢复到的时间点
select SQL_TEXT,LAST_ACTIVE_TIME from v$sqlarea where LAST_ACTIVE_TIME >to_date('20140917 10:00:00','yyyymmdd hh24:mi:ss') and SQL_TEXT like '%tab_test%';
4、确认是否开启闪回
select log_mode,flashback_on from v$database;
相关推荐
lklong 2020-11-22
oraclemch 2020-11-06
shilukun 2020-10-10
周嘉笙 2020-11-09
iilegend 2020-10-19
EricRay 2020-10-16
zhuzhufxz 2020-09-16
dataminer 2020-08-17
bfcady 2020-08-16
Hody 2020-08-16
FightFourEggs 2020-08-16
数据库设计 2020-08-16
Seandba 2020-08-16
Omega 2020-08-16
zjyzz 2020-08-16
yanghuatong 2020-08-16
ktyl000 2020-08-16
dbasunny 2020-08-16