DECLARE
my_task_name VARCHAR2(30);
my_sqltext CLOB;
Begin
my_sqltext := 'select * from emp where empno=66';
My_Task_Name := Dbms_Sqltune.Create_Tuning_Task(
Sql_Text=> My_Sqltext,
user_name => 'SCOTT',
scope => 'COMPREHENSIVE',
Time_Limit => 60,
task_name => 'sql_tuning_task_11',
Description => 'Task to tune a query on a specified table');
END;
Exec Dbms_Sqltune.Execute_Tuning_Task( Task_Name => 'my_sql_tuning_task_11');
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_task_11') from DUAL;
check sql profile
select * from dba_Sql_Profiles
delete sql profile
EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('NAME');
No comments:
Post a Comment