Implications of Setting Oracle9iR2's Statistics Collection Level - Page 2April 2, 2003 It's DynamicAs 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 ConfusingIf 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 ControlUnder 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 collectedSELECT 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 controlSQL> show parameter timed_statistics NAME TYPE VALUE ------------------------------------ ----------- ---------- timed_statistics boolean TRUE And my statistics level is set to BASICSQL> show parameter statistics_level NAME TYPE VALUE ------------------------------------ ----------- ----------- statistics_level string BASIC |