If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > date of runstats and reorg?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-09, 11:07
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
date of runstats and reorg?

where can i find a date (timestamp) when runstats were done on a table? same for reorg. On z/OS I think it was in some SYSIBM or so table but could not find it for UDB on Unix.

Thanks in advance
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #2 (permalink)  
Old 04-08-09, 11:20
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
For runstats: select stats_time from syscat.tables

For Reorg: This is a little tougher. If the database has been restarted since the reorg, then the information is lost. If the database has remained active then you can do something like this:

select reorg_end from table (snapshot_tbreorg('MYDB',-1)) as x where table_schema = ? and table_name = ? and reorg_status = 4

Andy
Reply With Quote
  #3 (permalink)  
Old 04-08-09, 14:36
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
thank you, Andy
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #4 (permalink)  
Old 04-08-09, 20:20
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
you can also find reorg info from the history file (list history reorg...)
Reply With Quote
  #5 (permalink)  
Old 04-09-09, 07:29
oracle10gsingh oracle10gsingh is offline
Registered User
 
Join Date: Nov 2007
Posts: 72
"select stats_time,tabname,tabschema,nleaf,nlevels from syscat.indexes"


stats_time will tell you when was the last time runstats was done


if nleaf and nlevel has a value -1 then they need runstats if any other value then its ok
Reply With Quote
  #6 (permalink)  
Old 04-13-09, 10:15
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by db2girl
you can also find reorg info from the history file (list history reorg...)
thx Bella, i find using list history command better than a query on syscat table
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #7 (permalink)  
Old 04-13-09, 10:18
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by oracle10gsingh
"select stats_time,tabname,tabschema,nleaf,nlevels from syscat.indexes"


stats_time will tell you when was the last time runstats was done


if nleaf and nlevel has a value -1 then they need runstats if any other value then its ok
thank you, Oracle. That columns should I look at if I run a query on SYSCAT.TABLES?
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS

Last edited by MarkhamDBA; 04-13-09 at 10:29.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On