Oracle error
ORA-04031
ORA-04031: unable to allocate %s bytes of shared memory ("%s","%s","%s","%s")
What usually causes it
The shared pool or large pool couldn't find a large enough free chunk, often from literal SQL fragmenting the pool or a pool that's too small.
What to check first
Check pool sizes and look for literal SQL that should use binds. Flushing the shared pool is only a stopgap.
Scripts that help
- SGA components and PGA usageCurrent size of each SGA pool, then PGA target against what's actually allocated. PGA allocated well above target points at sort- or hash-heavy…
- Literal SQL that should use bind variablesGroups statements that are identical apart from literals. Hundreds of copies of the same shape means hard parsing and shared pool churn; show the…