SQL> alter database add supplemental log data;
Database altered.
SQL> select count(*) from soe.warehouses;
COUNT(*)
----------
1000
SQL> delete from soe.warehouses where warehouse_id >500;
500 rows deleted.
SQL> commit;
Commit complete.
SQL> select count(*) from soe.warehouses;
COUNT(*)
----------
500
SQL> select to_char(versions_starttime,'yyyy-mm-dd hh24:mi:ss') starttime,to_char(versions_endtime,'yyyy-mm-dd hh24:mi:ss') endtime,
versions_xid xid,versions_operation operation from soe.warehouses versions
between timestamp to_date('2021-07-15 13:00:00','yyyy-mm-dd hh24:mi:ss') and sysdate where versions_xid is not null order by starttime;
STARTTIME ENDTIME XID O
------------------- ------------------- ---------------- -
2021-07-15 13:02:26 0A00070015030000 D
略......
SQL> set heading off
SQL> set line 250
SQL> spool undo.sql
SQL> select undo_sql from flashback_transaction_query where xid = hextoraw('0A00070015030000');
insert into "SOE"."WAREHOUSES"("WAREHOUSE_ID","WAREHOUSE_NAME","LOCATION_ID") values ('1000','82PeaUDdrydEazffQaLwi','2361');
略......
SQL> spool off
SQL> @undo.sql
SQL> commit;
Commit complete.
SQL> select count(*) from soe.warehouses;
COUNT(*)
----------
1000
【Oracle Database】闪回版本查询与闪回事务查询
原创dbprofessional 博主文章分类:Oracle ©著作权
©著作权归作者所有:来自51CTO博客作者dbprofessional的原创作品,谢绝转载,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
测试闪回查询与闪回版本
测试闪回查询功能
闪回查询 -
oracle 闪回事务
flashback
flashback 闪回事物 -
Oracle 闪回查询权限
Oracle 闪回查询权限
Oracle 闪回查询权限 -
oracle闪回查询和闪回数据库
oracle闪回查询和闪回数据库
oracle 技术 数据库 -
FlashBack总结之闪回查询与闪回表(原创)
前言 本文主要介绍利用UNDO表空间的闪回技术,主要包括:闪回表,闪回版本查询,闪回事务查询,闪回查询。这的是 UNDO_RETENTION参数。关于UNDO_RE...
SQL Linux Oracle 数据结构 Flash