flashback query
来源:互联网 发布:zepto.js 滑动不流 编辑:程序博客网 时间:2024/06/06 19:38
flashback query 是基于 undo 表空间的,对于10g,11g的数据库是不需要额外设置的。
对于 undo_retention设置比较大,同时又设置了 retention guarantee 的数据库是大大的有用。
下面做一些简单操作演示下。
--创建临时表
create table tmp_pyb_20160418
as
select *
from dba_objects do
where 1=1
and rownum < 1000
;
--查看临时表的记录
select *
from tmp_pyb_20160418
where 1=1
;
--查看临时表的记录
select distinct owner
from tmp_pyb_20160418
where 1=1
;
OWNER
PUBLIC
OUTLN
SYS
--获取删除前的SCN
select dbms_flashback.get_system_change_number
from dual;
10806245540173
--删除临时表的一些记录
delete from tmp_pyb_20160418 tp
where 1=1
and tp.owner='SYS'
;
commit;
--临时表中owner='SYS'的记录都已经被删除了
select *
from tmp_pyb_20160418 tp
where 1=1
and tp.owner='SYS'
;
--使用 as of timestamp 或者 as of scn 查询删除前的数据
select *
from tmp_pyb_20160418 as of timestamp to_timestamp('2016-04-18 10:47:00','yyyy-mm-dd hh24:mi:ss') tp
where 1=1
and tp.owner='SYS'
;
select *
from tmp_pyb_20160418 as of scn 10806245540173 tp
where 1=1
and tp.owner='SYS'
;
- FlashBack Query
- Flashback Query!
- Flashback Query
- Flashback Query
- Flashback Query
- flashback query
- flashback query
- flashback query
- flashback query
- flashback之flashback query
- Flashback Query, Flashback Version Query
- Flashback Query Flashback Version Query Flashback Table Flashback Transaction
- Oracle Flashback之Flashback Query
- Oracle Flashback之Flashback Query
- Oracle flashback之flashback query
- Flashback Version Query和Flashback Transaction Query!
- Flashback version query and Flashback transaction query
- Flashback Version Query && Flashback Transaction Query
- POJ 1475
- C#—抽象类使用及方法重写与重载
- C#循环结构
- Todd.log - a place to keep my thoughts on programming
- RSA算法整理
- flashback query
- JAVA 中BIO,NIO,AIO的理解
- MySQL各版本的区别
- MBIST:用于嵌入式存储器的可测试设计技术
- Java相对路径/绝对路径总结
- 战争迷雾
- 【day0418 Android】1. 使用Android的日志工具Log
- android handler的警告Handler Class Should be Static or Leaks Occur
- svn报错cleanup failed–previous operation has not finished; run cleanup if it was interrupted的解决办法