Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to get last update/insert/delete time for a table?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
chandraBE

New User


Joined: 02 Feb 2010
Posts: 40
Location: Bangalore

PostPosted: Thu Jul 01, 2010 10:57 am    Post subject: How to get last update/insert/delete time for a table?
Reply with quote

Hi,

I need to know when a perticular table DB.TBALENAME last updated(i.e the the date/time when a last row added/deleted/updated in this table). As I do not have the timestamp column in the DB.TBALENAME table, I could not look into this table for date/time.

Can you please help me to get details?.

Regards,
Chandra
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1280
Location: Belgium

PostPosted: Thu Jul 01, 2010 3:29 pm    Post subject:
Reply with quote

updatestatstime in Real time statistics tables gets updated about 30 minutes after the last update/insert/delete/reorg/load.

So if you want accuracy it's no good, but if you want to know the tables that haven't been touched in 3 months it can be useful.

In DB 9 there is also a (hidden) row change timestamp even when you didn't define a column for it, but I think it is actually pagechange.

SELECT ROW CHANGE TIMESTAMP FOR TAB , col1 FROM TAB
Back to top
View user's profile Send private message
chandraBE

New User


Joined: 02 Feb 2010
Posts: 40
Location: Bangalore

PostPosted: Thu Jul 08, 2010 11:15 am    Post subject:
Reply with quote

Hi GuyC,

Thanks GuyC for the deyails. They are pretty useful.

Can you please provide me sample query for getting this. I have tried using query like above, but did not work. Can you please provide some more details on this?.

Regards,
Chandra
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 08, 2010 2:03 pm    Post subject:
Reply with quote

Chandra,
what version of db2 is running on your machine?
Back to top
View user's profile Send private message
chandraBE

New User


Joined: 02 Feb 2010
Posts: 40
Location: Bangalore

PostPosted: Fri Jul 09, 2010 11:22 am    Post subject:
Reply with quote

We are using version 8.1 in our shop. Do we have any facility to get this details in version 8.1?.

Please advice.

Thanks & Regards,
Chandra
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1280
Location: Belgium

PostPosted: Fri Jul 09, 2010 1:18 pm    Post subject:
Reply with quote

*deleted*
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 09, 2010 1:33 pm    Post subject:
Reply with quote

GuyC wrote:
*deleted*


sometimes it is really hard to pass them up!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us