ORA-13754: “SQL Tuning Set” “string” does not exist for user “string”. ORACLE 报错 故障修复 远程处理
文档解释
ORA-13754: “SQL Tuning Set” “string” does not exist for user “string”.
Cause: The user attempted to access a SQL Tuning Set that does not exist.
Action: Check the speelling of the SQL Tuning Set name and retry the operation.
Oracle 在执行 SQL Tuning Set 时抛出 ORA-13754 错误,这表示用户指定的 SQL Tuning Set 不存在。
官方解释
常见情况:当 SQL Tuning Set 不存在时,会出现该错误。
正常处理方法及步骤
1.确认用户指定的 SQL Tuning Set 是否存在,SQL如下:
SELECT NAME FROM DBA_SQLTUNE_SETS;
2.如果指定的 SQL Tuning Set 不存在,可以创建该 SQL Tuning Set:
SQL> EXECUTE DBMS_SQLTUNE.create_sqlset(sqlset_name =>’TEST_SET’,description => ‘TEST SET’);
3.然后将要查询的 SQL 语句添加到测试的 SQL Tuning Set 中:
SQL> EXEC DBMS_SQLTUNE.load_sqlset(sqlset_name=>’TEST_SET’, sql_text=>’select job, department_id,avg (salary) from HR.EMPLOYEES group by job, department_id’);
4.最后可以运行一个建议来优化 SQL Tuning Set:
SQL> EXECUTE DBMS_SQLTUNE.CREATE_SQLSET(SQLSET_NAME=>’MY_SQLSET’);