Problem solve Get help with specific problems with your technologies, process and projects.

Row affected by last DML operation

How can I find the row of a table that was affected by the last DML operation?

How can I find the row of a table that was affected by the last DML operation?
The answer all depends on your version. One method that is version-independent is to add a new column to the table called DML_TIME. Then create a trigger which sets the DML_TIME column to SYSDATE on every INSERT, UPDATE or DELETE. Obviously, this method requires the trigger to be set up before the fact.

In Oracle 8i and higher, you can use Log Miner to mine the archived redo logs looking for this information.

In Oracle 10g, you can use the Flashback Versions Query to see the last DML against the table, provided that DML operation occurred less time ago than the number of seconds specified by the UNDO_RETENTION initialization parameter.

This was last published in July 2006

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.