Oracle Flashback Transaction Query
Version 12.1.0.2

Library Note Morgan's Library Page Header
The Library is currently in the process of being upgraded from Oracle Database Version to 12.2.0.1 and version 18.0 is going to be available soon. 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 and beyond.

Have you viewed the Library's main Table of Contents? If not ... [Click Here] ... scroll down the page and you will find links to the largest collection of Oracle Database demos on the net.
 
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@pdbdev

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 sys@pdbdev 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
Built-in Functions
Built-in Packages
Flashback Archive
Flashback Database
Flashback Drop
Flashback Query
Flashback Table
Flashback Transaction Backout
Flashback Version Query
Pseudocolumns
Recycle Bin
What's New In 12cR1
What's New In 12cR2

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-2017 Daniel A. Morgan All Rights Reserved