10g以上的版本,oracle有个自动分析表的job:GATHER_STATS_JOB,默认情况下该job每天晚上10点执行.
1.查看该job的状态以及执行情况
Select a.Enabled, Last_Start_Date, Next_Run_Date
From Dba_Scheduler_Jobs a
Where Job_Name = 'GATHER_STATS_JOB';
2.关闭和启动该job
方法一:
exec dbms_scheduler.disable('SYS.GATHER_STATS_JOB');
exec dbms_scheduler.enable('SYS.GATHER_STATS_JOB');
方法二:
alter system set "_optimizer_autostats_job"=false scope=spfile;
alter system set "_optimizer_autostats_job"=true scope=spfile;
11G虽然没有这个名字的job,但同样有其他类似的job会不定时的收集统计信息,同样的需要关闭之.
SQl>select client_name,operation_name
from dba_autotask_operation t;
------------------ ---------------------------
CLIENT_NAME OPERATION_NAME
auto optimizer stats collection auto optimizer stats job
auto space advisor auto space advisor job
sql tuning advisor automatic sql tuning task
逐个将其关闭
Declare
Begin
Dbms_Auto_Task_Admin.Disable(Client_Name => 'sql tuning advisor',
Operation => 'automatic sql tuning task',
Window_Name => Null);
End;
这里的参数client_name和operation分别对应dba_autotask_operation中的client_name和operation_name
-- The End --
阅读(3702) | 评论(2) | 转发(0) |