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 > SQL equivalent of RUNSTATS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-04, 18:21
trini0 trini0 is offline
Registered User
 
Join Date: Aug 2003
Posts: 24
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
Reply With Quote
  #2 (permalink)  
Old 06-13-04, 18:53
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 06-13-04, 19:47
trini0 trini0 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 06-14-04, 12:03
rubystep rubystep is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 06-14-04, 12:47
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
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