Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1544
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: 1783
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us