ORA-27125: unable to create shared memory segment的解决方法(转)

原文:http://www.eygle.com/rss/20111202.html  http://www.itpub.net/thread-1739835-1-1.html

在某些操作系统上,当启动数据库或者创建数据库时都可能出现ORA-27125错误,我在Oracle Linux 6上安装Oracle,创建数据库时就遇到了这个错误。

这个错误的解决就是修改 /proc/sys/vm/hugetlb_shm_group 文件。

客户的Linux 5.6 x86-64环境,安装数据库后,启动数据库报错:ORA-27125。

ORA-27125: unable to create shared memory segment
Cause: shmget() call failed
Action: contact Oracle support


[oracle@yans1 ~]$ id oracle
uid=500(oracle) gid=502(oinstall) groups=502(oinstall),501(dba)
[oracle@yans1 ~]$ more /proc/sys/vm/hugetlb_shm_group

# echo 501 > /proc/sys/vm/hugetlb_shm_group


但以上这种方式在重启操作系统后失效, /proc/sys/vm/hugetlb_shm_group又变为了0,建议采用以下方式解决

加入vm.hugetlb_shm_group = 501 到/etc/sysctl.conf中来解决:
# vi /etc/sysctl.conf
vm.hugetlb_shm_group = 501
# sysctl -p

hugetlb_shm_group contains group id that is allowed to create SysV shared memory segment using hugetlb page


When a process uses some memory, the CPU is marking the RAM as used by that process. For efficiency, the CPU allocate RAM by chunks of 4K bytes (it's the default value on many platforms). Those chunks are named pages. Those pages can be swapped to disk, etc.

Since the process address space are virtual, the CPU and the operating system have to remember which page belong to which process, and where it is stored. Obviously, the more pages you have, the more time it takes to find where the memory is mapped. When a process uses 1GB of memory, that's 262144 entries to look up (1GB / 4K). If one Page Table Entry consume 8bytes, that's 2MB (262144 * 8) to look-up.

Most current CPU architectures support bigger pages (so the CPU/OS have less entries to look-up), those are named Huge pages (on Linux), Super Pages (on BSD) or Large Pages (on Windows), but it all the same thing.