ORACLE 11G 禁用 SQL TUNING ADVISOR

來源:互聯網
上載者:User

標籤:autotask sql_tuning

  生產上有一套11g資料庫alert.log報錯ORA-16957: SQL Analyze time limit interrupt。

  查詢MOS相關文檔Troubleshooting: ORA-16957: "SQL Analyze time limit interrupt" Errors (文檔 ID 1275248.1)  

  The ORA-16957 error is an internal error code used to indicate that SQL Tuning Task has reached the time limit for tuning a specific sql.

  The default time limit is 3600 seconds.

  1. Check the current timing:

COLUMN parameter_value FORMAT A30 SELECT parameter_name, parameter_value FROM dba_advisor_parameters WHERE task_name = ‘SYS_AUTO_SQL_TUNING_TASK‘ AND parameter_name IN (‘TIME_LIMIT‘, ‘DEFAULT_EXECUTION_TYPE‘, ‘LOCAL_TIME_LIMIT‘);


  Then, increase the time:

Using:

BEGIN   DBMS_SQLTUNE.SET_TUNING_TASK_PARAMETER(task_name => ‘SYS_AUTO_SQL_TUNING_TASK‘, parameter => ‘TIME_LIMIT‘, value => 7200); END;/

  意思是後台自動分析sql耗時超過了預設的時間限制3600s,需要使用DBMS_SQLTUNE.SET_TUNING_TASK_PARAMETER包增長時間限制。

  一般在生產上不預設是不開啟SQL TUNING ADVISOR。可以使用下面代碼關閉自動SQL TUNING ADVISOR。

--查詢當前任務狀態[email protected]> select client_name,status from DBA_AUTOTASK_CLIENT;CLIENT_NAME                                                      STATUS---------------------------------------------------------------- --------auto optimizer stats collection                                  ENABLEDauto space advisor                                               ENABLEDsql tuning advisor                                               ENABLED--禁用sql tuning advisor[email protected]> BEGIN  2  dbms_auto_task_admin.disable(  3      client_name => ‘sql tuning advisor‘,  4      operation   => NULL,  5      window_name => NULL);  6  END;  7  /PL/SQL procedure successfully completed.--重新查詢狀態[email protected]> select client_name,status from DBA_AUTOTASK_CLIENT;CLIENT_NAME                                                      STATUS---------------------------------------------------------------- --------auto optimizer stats collection                                  ENABLEDauto space advisor                                               ENABLEDsql tuning advisor                                               DISABLED--啟用sql tuning advisorBEGINdbms_auto_task_admin.enable(    client_name => ‘sql tuning advisor‘,    operation   => NULL,    window_name => NULL);END;

參考文檔:http://blog.chinaunix.net/uid-25528717-id-3172008.html

參考文檔:http://www.cnblogs.com/suredandan/p/3200157.html

參考文檔:http://blog.itpub.net/235507/viewspace-1137629/

官方文檔:http://docs.oracle.com/cd/E11882_01/server.112/e25494/tasks.htm#ADMIN12332

本文出自 “DBA Fighting!” 部落格,請務必保留此出處http://hbxztc.blog.51cto.com/1587495/1870577

ORACLE 11G 禁用 SQL TUNING ADVISOR

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.