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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Tuning Regarding System CPU Stats

Re: SQL Tuning Regarding System CPU Stats

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: 17 May 2007 13:55:13 -0700
Message-ID: <1179435313.607337.130100@o5g2000hsb.googlegroups.com>


On May 17, 11:55 am, andrew.markiew..._at_gmail.com wrote:
> Hello all.
> We are in the process of upgrading from 9i to 10g and starting to use
> system statistics. Since the system statistics are used per database
> instance and not per user/schema, what approach is recommended for
> tuning a production system within a development environment?
>
> A few issues we are contending with,
>
> 1) Different machines for production and development may have
> different system performance stats. We are planning to collect system
> statistics on the production machines and import those system
> statistics to the development database so programmers will be tuning
> execution plans to run on a production system. That may make tuning a
> bit more confusing since it may not be using the optimal plan for that
> machine, but we are mainly concerned with production performance. If
> the stats for the test and production machines are close enough, this
> is a non-issue, but we do not know that at the moment nor can be
> guaranteed that future hardware upgrades won't upset that balance.
>
> 2) OLTP stats and batch processing stats seem to be different enough
> that we may need to use a different set of statistics in production at
> each of these times. But since the database is only allowed one set of
> system statistics, how do we allow developers that may be working
> concurrently on both OLTP and batch programs to use the system
> statistics each will need to tune each of their respective SQL?
>
> Short of providing multiple test databases, each with the system
> statistics representative of the type of work the database will do at
> that time, we are having a some difficulty coming up with a single
> test environment that will work for all developers at once.
>
> Any suggestions or experience in this regard?
> Thanks
> Andrew Markiewicz

The developers should be tuning for best performance, and not for the best looking execution plan. Thus, the optimal execution plan may look different on the development and production systems, while delivering the optimal performance on each system. Make certain that CPU statistics are gathered when the database instance is under normal to heavy load, otherwise the statistics gathered will be inappropriate, and will cause inappropriate execution plans to be developed due to incorrectly determined execution cost - this may be hard to accomplish on the test database instances. It is possible to manually specify the CPU statistics, if necessary.

You may need to resort to using Outlines to maintain plan stability between the two databases.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Thu May 17 2007 - 15:55:13 CDT

Original text of this message

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