Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: how to keep statistics up to date for CBO

RE: how to keep statistics up to date for CBO

From: David Wagoner <dwagoner_at_arsenaldigital.com>
Date: Wed, 08 Oct 2003 13:24:33 -0800
Message-ID: <F001.005D26C4.20031008132433@fatcity.com>


I like to use a cron job that runs the following in SQL Plus:

begin
dbms_stats.gather_schema_stats(ownname=> 'YOUR_SCHEMA_NAME', options=> 'GATHER AUTO');
end;

You should search the Oracle docs for your version of Oracle (you didn't specify version) to determine the best method for gathering statistics. You'll also see the different options there, like GATHER AUTO, which lets Oracle determine when it's time to compute new statistics for tables and indexes.

For 9iR2, the best method for CBO is dbms_stats, rather than "analyze table compute statistics", according to the Oracle docs.

Best regards,

David B. Wagoner
Database Administrator
Arsenal Digital Solutions
Web: http://www.arsenaldigital.com

"the most trusted source for

            STORAGE MANAGEMENT SERVICES" The contents of this e-mail message may be privileged and/or confidential. If you are not the intended recipient, any review, dissemination, copying, distribution or other use of the contents of this message or any attachment by you is strictly prohibited. If you receive this communication in error, please notify us immediately by return e-mail or by telephone (919-466-6700), and please delete this message and all attachments from your system.
Thank you.

-----Original Message-----
Sent: Wednesday, October 08, 2003 4:54 PM To: Multiple recipients of list ORACLE-L

How does one keep CBO statistics for an applications base tables up to date?

We are about to implement the CBO any must read documents.

Many thanks
bob
--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Bob Metelsky
  INET: bmetelsky_at_cps92.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: David Wagoner
  INET: dwagoner_at_arsenaldigital.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Oct 08 2003 - 16:24:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US