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’);