Automatic tuning advice for a specified SQL_ID
A SQL*Plus script for tuning a query using dbms_sqltune
Let's say you have a poorly performing SQL statement in your production system. Due to the requirements for an audit trail and so on, DBAs cannot just go to Enterprise Manager and press the button - they need a named script in the support ticket.
Or maybe this is just a dev/test system, but copying and pasting the SQL statement onto the SQL*Plus command line changes the SQL ID. Or you have identified the ID anyway, and so it's just more convenient to specify it. Either way, now you can simply run something like:
@tune_sql_id dnrtsnqgfqzsz
This will run a dbms_sqltune tuning task,
just as Enterprise Manager would, and display the recommendations, together
with instructions for applying them. (It doesn't actually make any changes itself, other than defining the tuning task.)
Tested in 10.2.0.4.
[an error occurred while processing this directive]