Implications of Setting Oracle9iR2's Statistics Collection Level - Page 2

April 2, 2003

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:


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

  FROM v$statistics_level
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