APPLIES TO:
Oracle Database Cloud Schema Service - Version N/A and laterOracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
GOAL
Using this ""SELECT * FROM TABLE(dbms_xplan.display_cursor('xxxxxxxxxx')) "" to check the plan hash value.
SOLUTION
Purging the sql id in question is a generic way to Since you were using the display_cursor command , it will show the plan which is in cursor.
Using DBMS_SHARED_POOL.PURGE procedure, you can flush a single SQL statement from the shared pool quite easily. The procedure call is overloaded to allow you to flush a named object using the address and hash_value found in V$SQLAREA. There are a couple of other call signatures that allow you to identify an object by schema and object name or hash value and namespace (to flush an object like a procedure or function) but the one we want for flushing a single SQL statement is the following:
( name varchar2,
flag char default 'P',
heaps number deafult 1
)
If the SQL_ID of the statement is known, then can look up the cursor information to build the name parameter value using the following query:
ADDRESS HASH_VALUE
---------------- ----------
00000000A9F34F98 1799024353
With the values, simply execute the call to the purge procedure:
PL/SQL procedure successfully completed.
Check the shared pool again after the purge successfully completes which should show no rows.
no rows selected
No comments:
Post a Comment