How to troubleshoot ORA-04031 errors when running utlrp. SQL in 11.2.0.4
The last case:
The following error occurs when the utlrp. SQL script is compiled at the client site in version 11.2.0.4:
ORA-12801: error signaled in parallel query server P237
ORA-12853: insufficient memory for PX buffers: current 84352 K, max needed 13280400 K
ORA-04031: unable to allocate 65560 bytes of shared memory ("large pool", "unknown object", "large pool", "PX msg pool ")
ORA-06512: at "SYS. UTL_RECOMP", line 804
ORA-06512: at line 4
The reason is:
Cause
The degree of parallelism used for recompilation is determined automatically based on instance parameters cpu_count and parallel_threads_per_cpu.
On systems with high number of cpus that can lead to high degree of parallelism and lead to high memory usage overall and high memory usage in the large pool since it is used by parallel execution for message buffers.
By default utlrp. SQL passes a 0 to utlrp. SQL:
From the above explanation, we can know that the value of cpu_count depends on the value of parallel_threads_per_cpu. If there are more CPUs, the degree of parallelism will be high, and the large pool will use more memory.
So it's easy to solve this problem.
Reduces the degree of parallelism of an instance.
Alter system set PARALLEL_MAX_SERVERS = 5 scope = both;
Alter system set PARALLEL_SERVERS_TARGET = 2 scope = both;
Compiled successfully.