ORA-04031: unable to allocate … shared memory--------------------------------------------------------------------------------Symptom: The Oracle error:ORA-04031: unable to allocate nnn bytes of shared memoryCause: More shared memory is needed than was allocated. SGA private memory has been exhausted.Fragmentation of shared pool memory is a common problem and ORA-04031 is commonly a result of such fragmentation. Application programmers usually get this error while attempting to load a big package or while executing a very large procedure and there is not sufficient contiguous free memory available in the shared pool. This may be due to fragmentation of the shared pool memory or insufficient memory in the shared pool.Possible remedies: Use the dbms_shared_pool package to pin large packages.Attempt to reduce the use of shared memory.Increase the initialisation parameter ‘SHARED_POOL_SIZE’. --------------------------------------------------------------------------------Alternate symptom An error of the form (Oracle 8.1.5):ORA-04031: unable to allocate NNNNN bytes of shared memory ("large pool","unknown object","large pool hea","PX msg pool")Cause: This error indicates that Oracle is unable to allocate memory from the ‘large’ pool.To determine the number of free bytes in the ‘large’ pool execute the following SQL:SELECT NAME, SUM(BYTES) FROM V$SGASTAT WHERE POOL='LARGE POOL' GROUP BY ROLLUP (NAME);Possible Remedy: To resolve the problem, consider increasing the value for ‘LARGE_POOL_SIZE’.
4. ORA-04031 错误与 Large Pool 大池是个可选的内存区,为以下的操作提供大内存分配:MTS会话内存和 Oracle XA 接口 Oracle 备份与恢复操作和I/O服务器进程用的内存(缓冲) 并行执行消息缓冲 大池没有LRU列表。这和共享池中的保留空间不同,保留空间和共享池中其他分配的内存使用同样的LRU列表。大块内存从不会换出大池中,内存必须是显式的被每个会话分配并释放。一个请求如果没有足够的内存,就会产生类似这样的一个ORA-4031错误: ORA-04031: unable to allocate XXXX bytes of shared memory ("large pool","unknown object","session heap","frame") 这个错误发生时候可以检查几件事情: 1- 使用如下语句检查 V$SGASTAT ,得知使用和空闲的内存: SELECT pool,name,bytes FROM v$sgastat where pool = 'large pool'; 2- 你还可以采用 heapdump level 32 来 dump 大池的堆并检查空闲的大块内存的大小 从大池分配的内存如果是LARGE_POOL_MIN_ALLOC 子节的整块数有助于避免碎片。任何请求分配小于LARGE_POOL_MIN_ALLOC 大块尺寸都将分配LARGE_POOL_MIN_ALLOC的大小。一般来说,你会看到使用大池的时候相对共享池来说要用到更多的内存。通常要解决大池中的ORA-4031错误必须增加 LARGE_POOL_SIZE 的大小。
这就是我的问题。 parallel_automatic_tunning unset(defaults to FALSE) shared_pool_size a large value,including space required for parallel execution. large_pool_size unset(default to zero)要改成 parrallel_automatic_tunning true(我不清楚该不该加等号) shared_pool_size a large value(我不清楚多大算大,也许象各位提出的10M) large_pool_size a large value(同上)以上是我看资料所得,看的一头雾水, 有这方面经验的帮忙解释一下,最好能帮我测试一下。 我这里的数据库一只要应用,重启一次很麻烦。 鞠躬!
ORA-04031的产生一般几种可能: 1, bug,把该打的补丁都打上。 2, shared_pool_size过小,加大shared_pool_size 3, 在MTS下large_pool_size过小,加大large_pool_size 4, 未应用好绑定变量,导致shared_pool过渡使用。调应用改绑定变量。临时解决: alter system flush shared_pool;建议先调大shared_pool_size应用一段时间,10M太小了,你物理内存有多少?
如果是8i,你找到init.ora文件
修改LARGE_POOL_SIZE = XXX
保存,然后重新启动数据库.就可以了如果是9i,也可以修改参数文件。to:无本之木
LARGE_POOL_SIZE 是一个静态参数,能用Alter system 修改吗?
可以的!其实你打开修改,和用命令修改应该是一样的!
另:操作系统为linux
要把两个都改掉?
The Oracle error:ORA-04031: unable to allocate nnn bytes of shared memoryCause:
More shared memory is needed than was allocated. SGA private memory has been exhausted.Fragmentation of shared pool memory is a common problem and ORA-04031 is commonly a result of such fragmentation. Application programmers usually get this error while attempting to load a big package or while executing a very large procedure and there is not sufficient contiguous free memory available in the shared pool. This may be due to fragmentation of the shared pool memory or insufficient memory in the shared pool.Possible remedies:
Use the dbms_shared_pool package to pin large packages.Attempt to reduce the use of shared memory.Increase the initialisation parameter ‘SHARED_POOL_SIZE’.
--------------------------------------------------------------------------------Alternate symptom
An error of the form (Oracle 8.1.5):ORA-04031: unable to allocate NNNNN bytes of shared memory ("large pool","unknown object","large pool hea","PX msg pool")Cause:
This error indicates that Oracle is unable to allocate memory from the ‘large’ pool.To determine the number of free bytes in the ‘large’ pool execute the following SQL:SELECT NAME, SUM(BYTES) FROM V$SGASTAT WHERE POOL='LARGE POOL' GROUP BY ROLLUP (NAME);Possible Remedy:
To resolve the problem, consider increasing the value for ‘LARGE_POOL_SIZE’.
大池是个可选的内存区,为以下的操作提供大内存分配:MTS会话内存和 Oracle XA 接口
Oracle 备份与恢复操作和I/O服务器进程用的内存(缓冲)
并行执行消息缓冲
大池没有LRU列表。这和共享池中的保留空间不同,保留空间和共享池中其他分配的内存使用同样的LRU列表。大块内存从不会换出大池中,内存必须是显式的被每个会话分配并释放。一个请求如果没有足够的内存,就会产生类似这样的一个ORA-4031错误:
ORA-04031: unable to allocate XXXX bytes of shared memory
("large pool","unknown object","session heap","frame") 这个错误发生时候可以检查几件事情:
1- 使用如下语句检查 V$SGASTAT ,得知使用和空闲的内存: SELECT pool,name,bytes FROM v$sgastat where pool = 'large pool'; 2- 你还可以采用 heapdump level 32 来 dump 大池的堆并检查空闲的大块内存的大小
从大池分配的内存如果是LARGE_POOL_MIN_ALLOC 子节的整块数有助于避免碎片。任何请求分配小于LARGE_POOL_MIN_ALLOC 大块尺寸都将分配LARGE_POOL_MIN_ALLOC的大小。一般来说,你会看到使用大池的时候相对共享池来说要用到更多的内存。通常要解决大池中的ORA-4031错误必须增加 LARGE_POOL_SIZE 的大小。
parallel_automatic_tunning unset(defaults to FALSE)
shared_pool_size a large value,including space required for parallel execution.
large_pool_size unset(default to zero)要改成
parrallel_automatic_tunning true(我不清楚该不该加等号)
shared_pool_size a large value(我不清楚多大算大,也许象各位提出的10M)
large_pool_size a large value(同上)以上是我看资料所得,看的一头雾水,
有这方面经验的帮忙解释一下,最好能帮我测试一下。
我这里的数据库一只要应用,重启一次很麻烦。
鞠躬!
1, bug,把该打的补丁都打上。
2, shared_pool_size过小,加大shared_pool_size
3, 在MTS下large_pool_size过小,加大large_pool_size
4, 未应用好绑定变量,导致shared_pool过渡使用。调应用改绑定变量。临时解决: alter system flush shared_pool;建议先调大shared_pool_size应用一段时间,10M太小了,你物理内存有多少?
哪个文件夹?哪个文件?如何改?
如何使改动生效?如何看到改动已经生效?
如果使用命令,那么在什么环境里使用命令?
另:oracle8.1.7 Linux
麻烦大家能给我一个详细的说明,
本人想象不到的菜。
ERROR 位于第 1 行:
ORA-02095: specified initialization parameter cannot be modified
要是这个文件里面有指向另一个目录的文件,那你就去改那个文件。如果直接里面是参数那就直接改这个文件改完重启数据库。
终于有人解释sid了。
谢谢。
shared_pool_size 设个50M,large_pool_size 512k差不多了。