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
 

 

Last update date?

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

New User


Joined: 13 Jun 2012
Posts: 49
Location: United States

PostPosted: Tue May 07, 2013 11:59 pm    Post subject: Last update date?
Reply with quote

Forgive me if this is a dumb question, but I don't know where to look:

Is there an easy way to tell when a table was last updated, maybe in the system tables or something?
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed May 08, 2013 12:07 am    Post subject:
Reply with quote

Table update means the structure of the table or the records in the table?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed May 08, 2013 12:09 am    Post subject:
Reply with quote

I believe that the DBAs and application developers would have to collaborate on that, the DBAs providing a table with a "last updated" column, the developers in keeping it current for modified rows.
Back to top
View user's profile Send private message
John Poulakos

New User


Joined: 13 Jun 2012
Posts: 49
Location: United States

PostPosted: Wed May 08, 2013 12:30 am    Post subject:
Reply with quote

I meant records in the table. I thought there might be a better way than check for a last changed date column.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 08, 2013 10:49 am    Post subject:
Reply with quote

Just being nit-picky - there are rows in the DB2 Tables.

What release of DB2 are you using at your shop? By "updated", you did not mean - "loaded"?

With DB2 9.1 and above -- UPDATESTATSTIME in Real time statistics tables gets updated about 30 minutes after the last update/insert/delete/reorg. If you want "accuracy" - possibly this is not what you need; if accuracy is not concern - this might serve the purpose.

In DB 9 there is also a hidden row change timestamp even when you didn't define a column for it - issue a SELECT statement with the ROW CHANGE TIMESTAMP column in the column list. If a qualifying row does not have a value for the ROW CHANGE TIMESTAMP column, DB2 returns the time that the page in which that row resides was updated.
Back to top
View user's profile Send private message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Wed May 08, 2013 12:43 pm    Post subject: Reply to: Last update date?
Reply with quote

John,
You can get the last updated time of a table using the SYSIBM.SYSTABLESPACESTATS table. You can get the info by using NAME(Table space name of the table) in SYSIBM.SYSTABLESPACESTATS.
Back to top
View user's profile Send private message
John Poulakos

New User


Joined: 13 Jun 2012
Posts: 49
Location: United States

PostPosted: Wed May 08, 2013 11:28 pm    Post subject: Reply to: Last update date?
Reply with quote

Thanks a lot! Those last 2 answers will give me everything I need.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 09, 2013 1:13 pm    Post subject:
Reply with quote

Glad, we had been helpful.

Good Luck!
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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