denrepo

Init parameterOptimizer & SQL

CURSOR_SHARING

Changes immediatelyCan set per session

What it controls

Whether Oracle replaces literals with bind variables before parsing.

Know this before you change it

FORCE is a stopgap for applications flooding the shared pool with literal SQL. It can change plans, so test it and prefer fixing the application.

Default: EXACT

Check and change it

cursor_sharing.sql
1-- Current value on every instance2SELECT inst_id, name, value, isdefault, ismodified3FROM gv$parameter4WHERE name = 'cursor_sharing';5 6-- Value stored in the spfile7SELECT sid, value FROM v$spparameter WHERE name = 'cursor_sharing' AND isspecified = 'TRUE';8 9-- Dynamic: takes effect now and is kept after a restart10ALTER SYSTEM SET cursor_sharing = FORCE SCOPE = BOTH SID = '*';11 12-- Or for your own session only13ALTER SESSION SET cursor_sharing = FORCE;14 15-- Remove it from the spfile to go back to the default at the next restart16ALTER SYSTEM RESET cursor_sharing SCOPE = SPFILE SID = '*';

Related scripts

Open in the parameter referenceOracle's reference

More in Optimizer & SQL