1.查看自动收集统计信息的任务及状态

禁用sql tuning advisor功能
1 sys@ora11g> select client_name,status from dba_autotask_client;
2 
3 CLIENT_NAME STATUS
4 ------------------------------------- --------
5 auto optimizer stats collection ENABLED
6 auto space advisor ENABLED
7 tuning advisor ENABLED
禁用sql tuning advisor功能

 

其中“auto optimizer stats collection”便是我们要寻找的自动收集统计信息的任务名称,它的状态目前是启用状态。

2.禁止自动sql tuning advisor的任务
我们可以使用DBMS_AUTO_TASK_ADMIN包完成这个任务。

禁用sql tuning advisor功能
 1 sys@ora11g> exec DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => 'sql tuning advisor',operation => NULL,window_name => NULL);
 2 
 3 PL/SQL procedure successfully completed.
 4 
 5 sys@ora11g> select client_name,status from dba_autotask_client;
 6 
 7 CLIENT_NAME STATUS
 8 ------------------------------------- --------
 9 auto optimizer stats collection ENABLED
10 auto space advisor ENABLED
11 sql tuning advisor DISABLED
禁用sql tuning advisor功能

 

此时“sql tuning advisor”任务已经被禁用,目的达到。

3.启用sql tuning advisor的任务

禁用sql tuning advisor功能
 1 sys@ora11g> exec DBMS_AUTO_TASK_ADMIN.ENABLE(client_name => 'sql tuning advisor',operation => NULL,window_name => NULL);
 2 
 3 PL/SQL procedure successfully completed.
 4 
 5 sys@ora11g> select client_name,status from dba_autotask_client;
 6 
 7 CLIENT_NAME STATUS
 8 ------------------------------------- --------
 9 auto optimizer stats collection ENABLED
10 auto space advisor ENABLED
11 sql tuning advisor ENABLED
禁用sql tuning advisor功能

 

相关文章:

  • 2021-06-20
  • 2022-12-23
  • 2021-09-18
  • 2021-08-15
  • 2021-06-16
  • 2021-09-22
  • 2021-09-25
猜你喜欢
  • 2021-09-15
  • 2021-07-14
  • 2021-11-04
  • 2022-12-23
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案