Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    24

    Unanswered: SQL equivalent of RUNSTATS

    According to the DB2 manual, I didn't notice an SQL command for RUNSTATS.
    Is it possible to perform something like RUNSTATS via an SQL statement?
    Im using 8.1.3 PE on w2k.
    Thanks

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Some of the statistics in the catalog can be updated manually with an SQL statement. For example you could count the rows in an SQL statement and update the CARD column in syscat.tables. But you will not get all statistics, and it will not be as efficient, so I can't imagine why you want to do that.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Aug 2003
    Posts
    24
    Thanks for your reply.
    To add some more background information, the reason why I was asking, was
    because Im interfacing via php, and Im looking to see if I can maintain tables,
    like how mySQL/PostgreSQL has Optimize/Vacuum.

    So Im taking it as it cannot be done, and thats not a problem for me.
    Just wanted to make sure that I didn't miss anything in the manual...
    Thanks

  4. #4
    Join Date
    Sep 2003
    Posts
    85
    If you can issue a db2look command, so you can get the UPDATE statements to SYSSTAT.xxx to update info for the table.
    db2look -d db-alias -z schemaname -t tablename -e -m

    HTH,
    Ruby

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    If you will be able to issue OS commands from a php script (Some languages, eg C, Java ,provide options to call system commands ...

    From the system command shell, you can issue RUNSTATS

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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