PART III: QUERYING THE LOGS
Still with me? Good, we're almost done. Now, what we're about to do is search through a bunch of SQL UNDO and REDO statements, which are the logically equivalent and inverse statements to all of the changes in the database, both committed and uncommitted. We need some way to narrow down the query to what we're looking for. The entire list of parameters is available from Oracle
here, but for this example, I'm going to just look for all of the changes to the U_KGREPORTCARD table.
SELECT SQL_REDO FROM V$LOGMNR_CONTENTS WHERE SQL_REDO LIKE '%U_KGREPORTCARD%'
(Note: ****s below indicate redacted information below; the actual information appears in the results.)
update "PS"."U_KGREPORTCARDS"
set
"LAST_MODIFIED" = '8/15/2023',
"MODIFIED_BY" = 'f369340',
"WHOMODIFIED" = 'Lasley, Collin',
"WHENMODIFIED" = '15-AUG-23 10.43.00.162000 AM'
where
****
SQL_REDO
--------------------------------------------------------------------
update "PS"."U_KGREPORTCARDS"
set
"WHENMODIFIED" = '15-AUG-23 10.44.05.599000 AM'
where
****
update "PS"."U_KGREPORTCARDS"
set
"SOCIAL_DEV_1" = 'NNNN'
where
****
Well, there's good news and there's bad news. The good news is that we found the assailant. The bad news is that the assailant was me. If you need to undo the changes and don't know what they were before, simply re-run your query against the SQL_UNDO column: it will give you the exact SQL needed to undo the changes made by the offending statement.
Don't forget: before you close your SQL*PLUS Session, you will need to end your LogMiner session, otherwise you will consume unneeded resources on your server:
EXECUTE DBMS_LOGMNR.END_LOGMNR;
I hope someone finds this helpful, and that y'all can add it to your toolbox of catching baddies, assailants, and hooligans. The only other tip I have is that sometimes the "Who Modified" ID will seem to correspond to a number that you can't recognize. In this case, you simply need to match this number against the DCID column of the USERS table.