Error code

Oracle ORA-04031

ORACLEORA-04031
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

unable to allocate shared memory — the shared pool or large pool is exhausted.

How to fix it

  1. Increase the SGA component size by raising SHARED_POOL_SIZE or enabling automatic memory management (MEMORY_TARGET).
  2. Flush the shared pool with ALTER SYSTEM FLUSH SHARED_POOL to clear fragmentation as a temporary measure.
  3. Use bind variables to improve cursor sharing and reduce the number of unique SQL texts stored in the shared pool.

Not affiliated with Oracle. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.