Search notes:

ORA-04031: unable to allocate … bytes of shared memory

The ORA-04031 unable to allocate … bytes of shared memory might cause some irritation when it reports, that a (relatively small) amount of memory cannot be allocated even though there is plenty of free memory in the System.
This is because the Shared pool heap manager allocates contiguous memory and the largest chunk of contiguous memory might be well below the total amount of free memory.
The most obvious fix for ORA-04031 errors is to increase the size of the Shared Pool. When doing that, it might be useful to consult v$shared_pool_advice.
Others solutions include:

See also

While ORA-04031 indicates a problem in the SGA, the error message ORA-04030: out of process memory when trying to allocate … bytes is related to a similar problem in the SGA.
Shared pool heap manager: allocation memory.
Other Oracle error messages

Index