错误信息:
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
00845, 00000, "MEMORY_TARGET not supported on this system"
// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was not sized correctly on Linux.
// *Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running on the system
数据库版本: 11.2.0.1.0
操作系统版本: Ubuntu 12.04.5
原由:
想扩大oracle内存使用,在/etc/fstab中已经添加:
tmpfs /dev/shm tmpfs defaults,size=40G 0 0
然而oracle还是无法使用到超过20G的内存,开始是报:
ORA-00845 MEMORY_TARGET not supported on this system
解决:
1.先解决ORA-00845, 由于是ubuntu 12的系统,没有了/dev/shm
处理:
在/etc/init/mounted-dev.conf文件中删除下面一行 (看语句应该是ubuntu 12增加了个软链接将/dev/shm改名为/run/shm了,而oracle又只认识/dev/shm)
[ -e /dev/shm ] || ln -s /run/shm /dev/shm
2.处理ORA-27102,这个错误一般是由于内核参数文件/etc/sysctl.conf设置导致的(大部分情况下,我们都按默认设置来的)
主要是两个参数值kernel.shmall和kernel.shmmax
关于kernel.shmmax
官方解释为:Available physical memory Defines the maximum allowable size of one shared memory segment. The SHMMAX setting should be large enough to hold the entire SGA in one shared memory segment. A low setting can cause creation of multiple shared memory segments which may lead to performance degradation.
意思就是最大共享内存段,应该设的比SGA要大,我这里就直接设置为kernel.shmmax = 42212254720, 大约40多G的样子
kernel.shmall:
This parameter sets the total amount of shared memory pages that can be used system wide. Hence, SHMALL should always be at least ceil(shmmax/PAGE_SIZE)
它是设置系统共享内存页的最大数量, shmall*4096应该大于或等于shmmax,那么我这里就要至少设为kernel.shmall = 10305728