Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find out the data / time a table was last updated???

Status
Not open for further replies.

RogerBarton

Programmer
Sep 23, 2004
7
AU
Is there a way to find out the data / time a table was updated?

Regards,
Roger Barton
 
Roger,

If, by "updated", you mean most recent structural change (e.g. "CREATE" or "ALTER": [Data Definition Language (DDL)]), then you can say:
Code:
select last_ddl_time from user_objects
where object_name = upper('<subject table name>');

If, instead, you mean most recent "INSERT", "UPDATE", or "DELETE" [Data Manipulation Language (DML)], then the only method to document that is by creating a trigger that stores the date/time of changes in an audit-style table.

Oracle does not store "last update" times resulting from DML due to performance considerations.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Greetings Mufasa!

Thanks for your reply ...
I can now see how my request was somewhat vague! Thanks for correcting the error of my ways!!!

I was actually after the last INSERT, UPDATE or DELETE - ie DML. So thankfully, you have given me an answer to this too. It was the answer that my internet searches seemed to say, but I thought it could hurt to post a question here.

Thanks again!

Regards,
Roger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top