Beruflich Dokumente
Kultur Dokumente
will!
Or…
How To Show All Stored Outline Hints to force a query to follow a specific
execution plan
See also: “How To – show the complete list of stored outline hints to force a fast execution Plan.doc”
It is important to note that the SQL Profile does not freeze the execution plan of a SQL statement, as done by stored
outlines. As tables grow or indexes are created or dropped, the execution plan can change with the same SQL Profile.
The information stored in it continues to be relevant even as the data distribution or access path of the corresponding
statement change. However, over a long period of time, its content can become outdated and would have to be
regenerated. This can be done by running Automatic SQL Tuning again on the same statement to regenerate the SQL
Profile.
Method #1
1) GRANT CREATE ANY OUTLINE TO <username>;
2) enable storing of outlines using this command
ALTER SESSION SET CREATE_STORED_OUTLINES=TRUE;
ALTER SESSION SET USE_STORED_OUTLINES=TRUE;
How to enable stored outlines and use them once they are stored
ALTER SESSION SET query_rewrite_enabled=TRUE;
ALTER SESSION SET use_stored_outlines= CITIBANK_OUTLINES; (or whatever your category was)
How to get a list of all the hints that would make up a stored outline
Method #1
1) Explain the plan in your fast server
2) Use this command to format the execution plan / explain plan:
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY( null, null, 'all +outline')) ;
3) Your list of hints is found in the “Outline Data” section
a. Important: Copy all the hints except the “IGNORE_OPTIM_EMBEDDED_HINTS” hint
b. Also, you won’t really need the “BEGIN_OUTLINE_DATA” or “END_OUTLINE_DATA” hints
4) Use all the hints in the SQL statement
Method #2
Create a stored outline then query the USER_OUTLINE_HINTS view like this:
COLUMN hint FORMAT A50
SELECT node, stage, join_pos, hint FROM user_outline_hints WHERE name = '&OUTLINE_NAME';
Then the idea would be to send the resulting dmp file to the customer, tell them to import it.
Then they must enable outlines using these commands: