flashback version query(待完善)
SQL> create table dep(id number,name varchar2(10));
Table created. SQL> insert into dep values(1,'dep1'); 1 row created. SQL> commit; Commit complete. SQL> select ora_rowscn,id,name from dep; ORA_ROWSCN???????? ID NAME ---------- ---------- ---------- ?? 1445309????????? 1 dep1 SQL> update dep set name='dep11' where id=1; 1 row updated. SQL> commit; Commit complete. SQL> select ora_rowscn,name from dep; ORA_ROWSCN???????? ID NAME ---------- ---------- ---------- ?? 1445369????????? 1 dep11 SQL> / ORA_ROWSCN???????? ID NAME ---------- ---------- ---------- ?? 1445369????????? 1 dep11 SQL> update dep set name='dep12' where id=1; 1 row updated. SQL> commit; Commit complete. SQL> select ora_rowscn,name from dep; ORA_ROWSCN???????? ID NAME ---------- ---------- ---------- ?? 1445404????????? 1 dep12 col versions_xid format a16 heading 'XID' col versions_startscn format 99999999 heading 'VSN|start|scn' col versions_endscn format 99999999 heading 'vsn|end|scn' col versions_operation format a12 heading 'operation' select versions_xid,versions_startscn,versions_endscn, decode(versions_operation,'I','INSERT','U','UPDATE','D','DELETE','ORIGINAL') "OPERATION", ID,NAME FROM DEP VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE WHERE ID=1; ?????????????????????? VSN?????? vsn ----------------------------------------------------------------------- 通过SCN和STAMPSTAMP查询 SQL> select salary from emp ? 2? versions between ? 3? scn minvalue and maxvalue ? 4? where id=1; ??? SALARY ---------- ?????? 120 ?????? 100 select salary from emp versions between timestamp to_timestamp('2012-04-15 15:30:01','yyyy-mm-dd hh24:mi:ss') and to_timestamp('2012-04-15 17:30:00','yyyy-mm-dd hh24:mi:ss') where id=1; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- Swoole源码学习记录(八)——Reactor模块-epoll
- ruby-on-rails – Rails Counter Cache及其实现
- 在AIR下,用Actionscript3.0 输出日志到外部文件
- c – 错误:“对’gluNewQuadric @ 0’的未定义引用”
- applicationContext.xml整合hibernate mybatis
- 如何将xpath的返回xml数组转换为Postgres中的int数组
- c# – 当valueFactory有副作用时,ConcurrentDictionary.Get
- get set 注解 以及public属性 依赖注入该怎么写
- 开始使用 swift 的 c语言 库
- MySQL安全性指南(3)(转)