Skip to content
March 17, 2017 / doganay

EXTRACT SQL HINTS FROM A RUNNING SQL


1)

SELECT EXTRACTVALUE (VALUE (d), '/hint')
 FROM XMLTABLE (
 '/*/outline_data/hint'
 PASSING (SELECT xmltype (other_xml) AS xmlval
 FROM v$sql_plan
 WHERE sql_id = '7p4v0d48jsdzd'
 AND CHILD_NUMBER = 0
 AND other_xml IS NOT NULL)) d;


2)
This also prints current sql hints:

select * from table(dbms_xplan.display_cursor('&V_SQL_ID',null,'OUTLINE'));
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: