Steps to generate SQL tuning Advisory Manually
SQL Tuning Advisor is SQL diagnostic software in the Oracle Database Tuning Pack. SQL Tuning Advisor is a mechanism for resolving problems related to sub optimally performing SQL statements. Use SQL Tuning Advisor to obtain recommendations for improving performance of high-load SQL statements, and prevent regressions by only executing optimal plans.
Step1: Create task
variable stmt_task VARCHAR2(64); variable sts_task VARCHAR2(64); EXEC :sts_task := DBMS_SQLTUNE.CREATE_TUNING_TASK( - sql_id => '&sql_id', - task_name => 'sql_tuning_task1',- description => 'Tune my query');
Step2: Execute task
EXEC DBMS_SQLTUNE.EXECUTE_TUNING_TASK('sql_tuning_task1');
Step3: Review task
SET LONG 1000000 SET LONGCHUNKSIZE 1000 SET LINESIZE 100 SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'sql_tuning_task1') from DUAL;
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally.
Comments
Post a Comment