943,968 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Unsolved
  • Views: 34283
  • Oracle RSS
Dec 5th, 2007
0

last modified date of a table

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bmantri is offline Offline
9 posts
since Dec 2007
Dec 5th, 2007
0

Re: last modified date of a table

Click to Expand / Collapse  Quote originally posted by bmantri ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pilpip is offline Offline
1 posts
since Sep 2007
Dec 6th, 2007
0

Re: last modified date of a table

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bmantri is offline Offline
9 posts
since Dec 2007
Dec 9th, 2007
0

Re: last modified date of a table

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
Reputation Points: 13
Solved Threads: 9
Junior Poster in Training
Nige Ridd is offline Offline
51 posts
since Nov 2007
Dec 10th, 2007
0

Re: last modified date of a table

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bmantri is offline Offline
9 posts
since Dec 2007
Oct 12th, 2009
0
Re: last modified date of a table
The easiest way to find is

sql Syntax (Toggle Plain Text)
  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)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mukeshkoshym is offline Offline
1 posts
since Oct 2009
Feb 5th, 2010
0
Re: last modified date of a table
try:

select to_char(scn_to_timestamp(max(ora_rowscn))) from table_name
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arturozz is offline Offline
1 posts
since Feb 2010
Apr 27th, 2010
0

Snapshot

Click to Expand / Collapse  Quote originally posted by bmantri ...
Hello Nige,

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.
This only works as long as the snapshot is still around. After that, it appears to go into a frozen state. All off my records older than a certain point have the same SCN.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
amadensor is offline Offline
4 posts
since Dec 2009
Jun 27th, 2011
-1
Re: last modified date of a table
This query works:

select dba_objects where object_name='table_name';
Reputation Points: 7
Solved Threads: 0
Newbie Poster
Khadhar is offline Offline
1 posts
since Jun 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: Procedure creation
Next Thread in Oracle Forum Timeline: How to join 4 tables in oracle?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC