Home / Oracle Errors / ORA-04031

ORA-04031

Unable to allocate bytes of shared memory

What it means

The shared pool or large pool could not find a free chunk of memory.

Common causes

How to fix it

  1. Check pool use: SELECT pool,name,bytes FROM v$sgastat ORDER BY bytes DESC FETCH FIRST 10 ROWS ONLY;
  2. Increase memory: ALTER SYSTEM SET sga_target=8G SCOPE=BOTH;
  3. Fix the application to use bind variables
  4. As a short-term step: ALTER SYSTEM FLUSH SHARED_POOL;

How to prevent it

Use bind variables and automatic memory management.

Still stuck? Ask the community in Q&A.

Get the weekly Vismo digestNew Oracle articles and Q&A in your inbox. No spam.

One email a week. Unsubscribe any time.