Например 1. Вставить.Использование функций Flashback.
insert into test2(p1,p2,p3)
values(1,'test_insert','test')
==>
1 row(s) inserted
SELECT versions_xid XID, versions_startscn START_SCN,
versions_endscn END_SCN, versions_operation OPERATION,
p1, p2, p3, ROWIDTOCHAR(ROWID)
FROM manager.test2
VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE;
XID, START_SCN, END_SCN, OPERATION, p1, p2, p3, ROWIDTOCHAR(ROWID)
04000A0054FD0A00 1404377619968 I 1 test_insert test AAA2wgAAbAAAAEsAAO
22 AAA2wgAAbAAAAEsAAA
24 AAA2wgAAbAAAAEsAAB
54 AAA2wgAAbAAAAEsAAC
10 AAA2wgAAbAAAAEsAAD
10 test2 test1 AAA2wgAAbAAAAEsAAE
225 test10 AAA2wgAAbAAAAEsAAF
225 test10 AAA2wgAAbAAAAEsAAG
225 test10 AAA2wgAAbAAAAEsAAH
225 test10 AAA2wgAAbAAAAEsAAI
225 test10 AAA2wgAAbAAAAEsAAJ
225 test10 AAA2wgAAbAAAAEsAAK
225 test10 test4 AAA2wgAAbAAAAEsAAL
225 test10 test4 AAA2wgAAbAAAAEsAAM
50 test insert test AAA2wgAAbAAAAEsAAN
SQL> SELECT SCN_TO_TIMESTAMP('1404377619968') FROM dual;
SCN_TO_TIMESTAMP('1404377619968')
---------------------------------------------------------------------------
25.01.19 07:32:12,000000000
SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN),p1,p2,p3 FROM test2
25.01.19 07:32:12,000000000 22
25.01.19 07:32:12,000000000 24
25.01.19 07:32:12,000000000 54
25.01.19 07:32:12,000000000 10
25.01.19 07:32:12,000000000 10 test2 test1
25.01.19 07:32:12,000000000 225 test10
25.01.19 07:32:12,000000000 225 test10
25.01.19 07:32:12,000000000 225 test10
25.01.19 07:32:12,000000000 225 test10
25.01.19 07:32:12,000000000 225 test10
25.01.19 07:32:12,000000000 225 test10
25.01.19 07:32:12,000000000 225 test10 test4
25.01.19 07:32:12,000000000 225 test10 test4
25.01.19 07:32:12,000000000 50 test insert test
25.01.19 07:32:12,000000000 1 test_insert test
Например, 2. Обновление.Использование функций Flashback.
CREATE TABLE manager.test2
(p1 NUMBER,
p2 VARCHAR2(200 BYTE),
p3 VARCHAR2(100 BYTE)
)
select * from test2;
p1 p2 p3
---------- --------------- --------
22
24
54
124
124 test2 test1
225 test10
225 test10
225 test10
225 test10
225 test10
225 test10
225 test10 test4
225 test10 test4
update test2 set p1=10 where p1=124
==>
2 row(s) updated
SELECT versions_xid XID, versions_startscn START_SCN,
versions_endscn END_SCN, versions_operation OPERATION,
p1, p2, p3, ROWIDTOCHAR(ROWID)
FROM manager.test2
VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE;
XID, START_SCN, END_SCN, OPERATION, p1, p2, p3, ROWIDTOCHAR(ROWID)
07000F0051030B00 1404163252291 U 10 test2 test1 AAA2wgAAbAAAAEsAAE
07000F0051030B00 1404163252291 U 10 AAA2wgAAbAAAAEsAAD
22 AAA2wgAAbAAAAEsAAA
24 AAA2wgAAbAAAAEsAAB
54 AAA2wgAAbAAAAEsAAC
1404163252291 124 AAA2wgAAbAAAAEsAAD
1404163252291 124 test2 test1 AAA2wgAAbAAAAEsAAE
225 test10 AAA2wgAAbAAAAEsAAF
225 test10 AAA2wgAAbAAAAEsAAG
225 test10 AAA2wgAAbAAAAEsAAH
225 test10 AAA2wgAAbAAAAEsAAI
225 test10 AAA2wgAAbAAAAEsAAJ
225 test10 AAA2wgAAbAAAAEsAAK
225 test10 test4 AAA2wgAAbAAAAEsAAL
225 test10 test4 AAA2wgAAbAAAAEsAAM
SQL> SELECT SCN_TO_TIMESTAMP('1404163252291') FROM dual;
SCN_TO_TIMESTAMP('1404163252291')
--------------------------------------------------------------------------
24.01.19 14:08:27,000000000
SELECT xid, start_scn , commit_scn COMMIT,operation OP, logon_user ,undo_sql FROM flashback_transaction_query
WHERE xid = HEXTORAW('07000F0051030B00');
07000F0051030B00 1404163252288 1404163252291 UPDATE MANAGER update "MANAGER"."TEST2" set "P1" = '124' where ROWID = 'AAA2wgAAbAAAAEsAAE';
07000F0051030B00 1404163252288 1404163252291 UPDATE MANAGER update "MANAGER"."TEST2" set "P1" = '124' where ROWID = 'AAA2wgAAbAAAAEsAAD';
07000F0051030B00 1404163252288 1404163252291 BEGIN MANAGER