Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

Oracle

Posted Apr 2, 2003

Implications of Setting Oracle9iR2's Statistics Collection Level

By James Koopmann

Concerned about looking at statistics within Oracle? You should take a quick look at Oracles' new method of turning collections on or off.

It's New

In Oracle9iR2, Oracle has introduced a new initialization parameter called STATISTICS_LEVEL. Through this parameter, Oracle gives you the option to set different levels of statistical collection for major statistics and advisories.

Its Settings

There are three settings for this parameter: BASIC, TYPICAL, and ALL. The default setting is TYPICAL. Here is a quick matrix of what statistics and advisories are turned on depending on the setting you choose. I have added two columns to this matrix. The first is Session Affected which indicates those statistics that are affected by issuing the ALTER SESSION command for the STATISTICS_LEVEL parameter. The second is the initialization parameter that you can set in the SPFILE to override the STATISTICS_LEVEL setting.

Statistic / Advisory

BASIC

TYPICAL

ALL

Session Affected

Control Through SPFILE

Buffer Cache Advice


X

X


db_cache_advice

MTTR Advice

 

X

X

   

Shared Pool Advice

 

X

X

   

Segment Level Statistics

 

X

X

   

PGA Advice

 

X

X

   

Timed Statistics

 

X

X

X

timed_statistics

Timed OS Statistics

   

X

X

timed_os_statistics

Plan Execution Statistics

   

X

X

 

To take a look at the advisories and statistics controlled by the setting of the STATISTICS_LEVEL parameter or the entries in the SPFILE and what their current settings are, just issue the following SQL:

col statistics_name      for a30 head "Statistics Name"
col session_status       for a10 head "Session|Status"
col system_status        for a10 head "System|Status"
col activation_level     for a10 head "Activation|Level"
col session_settable     for a10 head "Session|Settable"

SELECT STATISTICS_NAME,
       SESSION_STATUS,
       SYSTEM_STATUS,
       ACTIVATION_LEVEL,
       SESSION_SETTABLE
  FROM v$statistics_level
 ORDER BY 1
/
 Session    System     Activation Session
Statistics Name                Status     Status     Level      Settable
------------------------------ ---------- ---------- ---------- ----------
Buffer Cache Advice            ENABLED    ENABLED    TYPICAL    NO
MTTR Advice                    ENABLED    ENABLED    TYPICAL    NO
PGA Advice                     ENABLED    ENABLED    TYPICAL    NO
Plan Execution Statistics      DISABLED   DISABLED   ALL        YES
Segment Level Statistics       ENABLED    ENABLED    TYPICAL    NO
Shared Pool Advice             ENABLED    ENABLED    TYPICAL    NO
Timed OS Statistics            DISABLED   DISABLED   ALL        YES
Timed Statistics               ENABLED    ENABLED    TYPICAL    YES


Oracle Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
Oracle Forum
Topic By Replies Updated
Oracle Data Mining: Classification jan.hasller 0 July 5th, 07:19 AM
Find duplicates - Unique IDs Lava 5 July 2nd, 08:30 AM
no matching unique or primary key rcanter 1 April 25th, 12:32 PM
Update values of one table based on condition of values in other table using Trigger Gladiator 3 February 29th, 06:01 PM


















Thanks for your registration, follow us on our social networks to keep up-to-date