Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399

    Unanswered: 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 9.5/9.7 on Unix/AIX 6.1/Linux

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  3. #3
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    thank you, Andy
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

  4. #4
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    you can also find reorg info from the history file (list history reorg...)

  5. #5
    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

  6. #6
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    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 9.5/9.7 on Unix/AIX 6.1/Linux

  7. #7
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    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?
    Last edited by MarkhamDBA; 04-13-09 at 11:29.
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •