Oracle Flashback Version Query and Oracle Flashback Transaction Query
====================================================================
No need to db archive mode , recyclebin on
You are informed that the record empno=7499 is missing from
the scott.EMP table. You need to identify the following:
delete from emp where empno=7499;
commit ;
* The transaction identifier of the transaction that deleted the empno record
* The SQL statements necessary to undo the delete
* The user who executed the transaction
Which would you use?
A. Oracle Flashback Drop only
B. Oracle Flashback Version Query only
C. Oracle Flashback Version Query and Oracle Flashback Transaction Query
D. RMAN REPORT command only
Ans : C
Practical example :
-----------------
1. --SHOW all rows of emp table
select * from emp
2. --Delete one row
delete from emp where empno=7499
3. --commit the change
commit
4.----Oracle Flashback Version Query to find out the identified (history) of the transaction.
SELECT versions_xid, versions_operation
FROM emp
VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE
WHERE empno=7499;
5.---Oracle Flashback Transaction Query to see the all information (audit) as well as undo sql
SELECT XID, COMMIT_TIMESTAMP, LOGON_USER,OPERATION, TABLE_NAME, TABLE_OWNER, UNDO_SQL
FROM FLASHBACK_TRANSACTION_QUERY
WHERE xid=HEXTORAW('09002700CE180000');
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years ago
-
No comments:
Post a Comment