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 - Page 2

By James Koopmann

It's Dynamic

As with most of the new tuning parameters that Oracle is putting into their product, this parameter is dynamic. This means that you can set and unset it at any time. It is available for setting at the system level or at the session level. There is one small difference between dynamically changing this parameter for the system compared to changing it at the session level. If you modify this parameter for your particular session through the ALTER SESSION command, only certain advisories and statistics are affected. Take a look at the Session Affected column in the preceding matrix for what you will affect. If modified at the system level through the ALTER SYSTEM command, all advisories and statistics are affected for the database and every session.

It's Confusing

If you have any of the three parameters set in your SPFILE, that particular parameter setting will override the setting of the STATISTICS_LEVEL parameter. In order to use the STATISTICS_LEVEL parameter, you must reset the parameters you want the STATISTICS_LEVEL parameter to control.

To do this you should issue the following command:

ALTER SYSTEM RESET <parameter> SCOPE=SPFILE SID='*';

To Switch from SPFILE Control to STATISTICS_LEVEL Control

Under this example, I do not want to collect any statistics or advisories. I will take you through a current setting where I will show you that timed statistics are being collected even though the STATISTICS_LEVEL is set to BASIC. In order to not collect timed statistics, I will have to get rid of the SPFILE entry so that timed statistics is under complete control by the STATISTICS_LEVEL parameter.

Currently timed statistics are being collected

SELECT STATISTICS_NAME,
       SYSTEM_STATUS
  FROM v$statistics_level
 ORDER BY 1
/
                               System
Statistics Name                Status
------------------------------ ----------
Buffer Cache Advice            DISABLED
MTTR Advice                    DISABLED
PGA Advice                     DISABLED
Plan Execution Statistics      DISABLED
Segment Level Statistics       DISABLED
Shared Pool Advice             DISABLED
Timed OS Statistics            DISABLED
Timed Statistics               ENABLED

Currently I have timed_statistics under SPFILE control

SQL> show parameter timed_statistics
NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------
timed_statistics                     boolean     TRUE

And my statistics level is set to BASIC

SQL> show parameter statistics_level
NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------
statistics_level                     string      BASIC


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