Oracle Flashback Transaction Query
Version 12.1.0.1

Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 11.2.0.3 to 12.1.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.
 
Flashback Transaction Query Functionality Demo
Demo using the flashback_transaction_query view SELECT operation, undo_sql, logon_user
FROM flashback_transaction_query
WHERE xid = HEXTORAW(<version_xid>);
conn uwclass/uwclass

CREATE TABLE t (
mycol VARCHAR2(20));

INSERT INTO t VALUES ('ABC');

COMMIT;

INSERT INTO t VALUES ('DEF');

COMMIT;

INSERT INTO t VALUES ('GHI');

COMMIT;

SELECT versions_xid, versions_startscn, versions_endscn, versions_operation, mycol
FROM t
VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE;

conn / as sysdba

desc flashback_transaction_query

set linesize 121
col operation format a10
col undo_sql format a65

-- choose the 'DEF' entry's xid
SELECT operation, undo_sql, logon_user
FROM flashback_transaction_query
WHERE xid = HEXTORAW('0A0009005F060000');

delete from "UWCLASS"."T" where ROWID = 'AAAPHYAAGAAABgqAAB';

COMMIT;

SELECT * FROM uwclass. t;

SELECT versions_xid, versions_startscn, versions_endscn, versions_operation, mycol
FROM uwclass.t
VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE;

UPDATE uwclass.t
SET mycol = 'MNO'
WHERE mycol = 'GHI';

INSERT INTO uwclass.t VALUES ('XYZ');

COMMIT;

SELECT versions_xid, versions_startscn, versions_endscn, versions_operation, mycol
FROM uwclass.t
VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE;

Related Topics
Flashback Archive
Flashback Database
Flashback Drop
Flashback Query
Flashback Table
Flashback Transaction Backout
Flashback Version Query
Pseudocolumns
Recycle Bin

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved