Thursday, September 6, 2007

How to Enable and Disable Automatic Statistics Collection in 10G

The Automatic Statistics collection feature is enabled by default in 10G.
You can verify this by checking the following :

SQL> SELECT STATE FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'GATHER_STATS_JOB';
STATE
---------------
SCHEDULED

To Disable the automatic statistics collection in 10G , you can execute the following procedure

SQL >Exec DBMS_SCHEDULER.DISABLE('GATHER_STATS_JOB');

In order to enable statistics collection you will follow following steps

SQL> SELECT STATE FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'GATHER_STATS_JOB';

STATE
---------------
DISABLED

SQL> Exec DBMS_SCHEDULER.enable('GATHER_STATS_JOB');

No comments: