last modified date of a table

Reply

Join Date: Dec 2007
Posts: 9
Reputation: bmantri is an unknown quantity at this point 
Solved Threads: 0
bmantri's Avatar
bmantri bmantri is offline Offline
Newbie Poster

last modified date of a table

 
0
  #1
Dec 5th, 2007
Hello DBAs,

Can any one guide me how can i get the last modified date(insert/update/delete) of a table?



Regards,
B. Mantri
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1
Reputation: pilpip is an unknown quantity at this point 
Solved Threads: 0
pilpip pilpip is offline Offline
Newbie Poster

Re: last modified date of a table

 
0
  #2
Dec 5th, 2007
Originally Posted by bmantri View Post
Hello DBAs,

Can any one guide me how can i get the last modified date(insert/update/delete) of a table?



Regards,
B. Mantri

try all_tab_modifications or user_tab_modifcations
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 9
Reputation: bmantri is an unknown quantity at this point 
Solved Threads: 0
bmantri's Avatar
bmantri bmantri is offline Offline
Newbie Poster

Re: last modified date of a table

 
0
  #3
Dec 6th, 2007
Hello pilpil,
Thanks for reply.
but I am not getting any records when selecting from all_tab_modifications or user_tab_modifications.
I tried connecting to both sys and system user. In system user I have created one table TEST and inserted some rows.


SQL> select * from all_tab_modifications where table_name = 'TEST';

no rows selected
Please respond soon!

Thanks,
BMantri
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 51
Reputation: Nige Ridd is an unknown quantity at this point 
Solved Threads: 9
Nige Ridd Nige Ridd is offline Offline
Junior Poster in Training

Re: last modified date of a table

 
0
  #4
Dec 9th, 2007
If the table has been modified recently and is 10g, you can try

select scn_to_timestamp(max(ora_rowscn))
from test;

Think I've seen things say it's only up to 5 days you can use this.

If you need to and can modify the database, you could always create your own version of the user_tab_modifications by putting an INSERT/UPDATE/DELETE trigger on the tables you want to track and create a small table which holds the same sort of data as the user_tab_modifications does.

Nige
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 9
Reputation: bmantri is an unknown quantity at this point 
Solved Threads: 0
bmantri's Avatar
bmantri bmantri is offline Offline
Newbie Poster

Re: last modified date of a table

 
0
  #5
Dec 10th, 2007
Hello Nige,

Thanks a lot for your valuable suggestion. It is working with some of my tables but for others it is giving the following error.
SQL> select scn_to_timestamp(max(ora_rowscn)) from SLB_FILE_ATTACHMENTS
2 ;
select scn_to_timestamp(max(ora_rowscn)) from SLB_FILE_ATTACHMENTS
*
ERROR at line 1:
ORA-08181: specified number is not a valid system change number
ORA-06512: at "SYS.SCN_TO_TIMESTAMP", line 1
Do you have any idea about this error and how can I find the last modified date for this kind of tables?
Please help me to fix this issue.


Many many Thanks,
BMantri
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: Mukeshkoshym is an unknown quantity at this point 
Solved Threads: 0
Mukeshkoshym Mukeshkoshym is offline Offline
Newbie Poster
 
0
  #6
Oct 12th, 2009
The easiest way to find is

  1. SELECT * FROM all_tab_modifications
Last edited by peter_budo; Oct 13th, 2009 at 5:07 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



Tag cloud for Oracle
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC