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.
ret_val := dbms_sqltune.create_tuning_task( task_name=>'task_01', sql_id=>'bjyanqt9q718f');
If the procedure is completed successfully(it can sometimes cause problems), we can see the improvement proposal created with the following query.
SQL> SELECT dbms_sqltune.report_tuning_task('task_01') FROM dual;