共计 1949 个字符,预计需要花费 5 分钟才能阅读完成。
生产上有一套 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:
1234567 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。
– 查询当前任务状态
SYS@db2> select client_name,status from DBA_AUTOTASK_CLIENT;
CLIENT_NAME STATUS
—————————————————————- ——–
auto optimizer stats collection ENABLED
auto space advisor ENABLED
sql tuning advisor ENABLED
– 禁用 sql tuning advisor
SYS@db2> 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.
– 再次查询状态
SYS@db2> select client_name,status from DBA_AUTOTASK_CLIENT;
CLIENT_NAME STATUS
—————————————————————- ——–
auto optimizer stats collection ENABLED
auto space advisor ENABLED
sql tuning advisor DISABLED
– 启用 sql tuning advisor
BEGIN
dbms_auto_task_admin.enable(
client_name => ‘sql tuning advisor’,
operation => NULL,
window_name => NULL);
END;
更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-01/139270.htm