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.
An ORA-04031 error is often related to
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:

Getting a snapshot of the shared pool when the error occurs

Oracle creates a trace file in the ADR (or user_dump_dest before 11g) directory.

Before Oracle 9.2.0.5

Possible values for level seem to be 1, 2, 3 or 32.
alter session set events '4031 trace name errorstack level 3';
Adding 536870912 to the level will generate the 5 largest supheaps and the 5 largest heap areas within each of those.
alter session set events '4031 trace name heapdump level 536870914';

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 for the PGA.
Shared pool heap manager: allocation memory.
Other Oracle error messages

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1788533389, '216.73.217.21', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-04031_unable-to-allocate_bytes-of-shared-memory(73): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78