Let’s assume that the sql_id of the query that we will improve is “bjyanqt9q718f”.
First of all, we run the following procedure and create the improvement task.
1 2 3 4 5 6 7 | DECLARE ret_val VARCHAR2(4000); BEGIN ret_val := dbms_sqltune.create_tuning_task( task_name=>'task_01', sql_id=>'bjyanqt9q718f'); dbms_sqltune.execute_tuning_task('task_01'); END; / |
If the procedure is completed successfully(it can sometimes cause problems), we can see the improvement proposal created with the following query.
1 | SQL> SELECT dbms_sqltune.report_tuning_task('task_01') FROM dual; |