denrepo

OracleSQL tuning

Purge one statement from the shared pool

Forces a single SQL_ID to hard parse again, usually to pick up new statistics or drop a bad plan, without flushing the whole shared pool.

Changes dataPrompts for input

Not yet verified. How scripts are tested

This script changes the database. Check the names and values before you run it.
ora-purge-cursor.sql
1SET VERIFY OFF2COLUMN purge_arg NEW_VALUE purge_arg3 4SELECT address || ',' || hash_value AS purge_arg5FROM v$sqlarea6WHERE sql_id = '&sql_id';7 8EXEC DBMS_SHARED_POOL.PURGE('&purge_arg', 'C');

Save it as ora-purge-cursor.sql and run it with SQL> @ora-purge-cursor.

Open in denrepo

More Oracle scripts: SQL tuning