How to Disable Database Auto Task

1. Check the status of your auto task jobs before disabling it.


As you can notice, sql tuning advisor task is already disabled, but the remaining two tasks are enabled. Also, the overall task status is enabled (From DBA_AUTOTASK_STATUS view).

Let us now, disable the two individual task:

EXEC DBMS_AUTO_TASK_ADMIN.DISABLE('AUTO OPTIMIZER STATS COLLECTION',NULL,NULL);

EXEC DBMS_AUTO_TASK_ADMIN.DISABLE('AUTO SPACE ADVISOR',NULL,NULL);


Now, check the task status again:


As you can see, the indivdual status and window client is disabled. But, the Auto Task in itself is enabled. (DBA_AUTOTASK_STATUS)
At this stage, the individual task will not run, even if the auto task status is enabled.
Also, note that the status on DBA_AUTOTASK_TASK is still Enabled. This status has no impact on the actual run of the task. So, you can ignore this status column.

Next, we will disable the auto task check the status again:


The status on DBA_AUTOTASK_STATUS is now shows "DISABLED".

So, you can either disable a single auto task or all the auto task together. As per Oracle Documentation:

"
The best way to understand how this works is this - think of an electrical panel supplying current to a house.

There are a number of circuit breakers on the panel and the main switch which turns off all power to the house. Each individual circuit breaker can be in an ON or OFF position, however if the main switch is OFF, then no power is reaching the circuit breakers, regardless of their position. Individual circuit breakers are controlled by DBMS_AUTO_TASK_ADMIN.DISABLE('AUTO OPTIMIZER STATS COLLECTION', NULL, NULL), etc.

The main switch is controlled by DBMS_AUTO_TASK_ADMIN.DISABLE().

DBA_AUTOTASK_CLIENTS view simply displays the switch position for each client (ENABLED or DISABLED). DBA_AUTOTASK_WINDOW_CLIENTS view is designed to give an idea as to when the jobs for the specific client may run. This view has a separate column for the"main switch", AUTOTASK_STATUS, in addition to the client-specific switches. This view also takes into account status of DBMS_SCHEDULER objects (window groups, individual windows, etc), providing the most realistic picture of when maintenance jobs can run.
"


No comments:

Post a Comment

ASM and Database does not auto start in Oracle restart environment (After Server start)

 If you are supporting Any Oracle restart environment and if you notice that your ASM instance and Database instance does not start automati...