ITPub博客

首页 > 数据库 > Oracle > 基本闪回查询和闪回表

基本闪回查询和闪回表

Oracle 作者:壹頁書 时间:2015-05-26 23:32:15 0 删除 编辑
参考:
http://blog.csdn.net/leshami/article/details/6112607

基本闪回查询
select * from t1
as of timestamp to_timestamp('2015-05-26 22:04:08','yyyy-mm-dd hh24:mi:ss');
或者
select * from t1
as of timestamp current_timestamp - interval '15' minute;

查询误删除的数据
select * from t1
as of timestamp to_timestamp('2015-05-26 22:04:08','yyyy-mm-dd hh24:mi:ss')minus
select * from t1;

将会话设置在固定的时间
execute dbms_flashback.enable_at_time(to_timestamp('2015-05-26 22:04:08','yyyy-mm-dd hh24:mi:ss'));

execute dbms_flashback.disable;


闪回表
alter table t1 enable row movement;
alter table t2 enable row movement;
flashback table t1,t2 to timestamp to_timestamp('2015-05-26 22:35:08','yyyy-mm-dd hh24:mi:ss');
flashback table t1,t2 to timestamp current_timestamp- interval '10' minute;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29254281/viewspace-1673034/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-10-19

  • 博文量
    620
  • 访问量
    6340005