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

  1. # Kernel sysctl configuration file for Red Hat Linux
  2. #
  3. # For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
  4. # sysctl.conf(5) for more details.
  5. # Controls IP packet forwarding
  6. net.ipv4.ip_forward = 0
  7. # Controls source route verification
  8. net.ipv4.conf.default.rp_filter = 1
  9. # Do not accept source routing
  10. net.ipv4.conf.default.accept_source_route = 0
  11. # Controls the System Request debugging functionality of the kernel
  12. kernel.sysrq = 0
  13. # Controls whether core dumps will append the PID to the core filename.
  14. # Useful for debugging multi-threaded applications.
  15. kernel.core_uses_pid = 1
  16. # Controls the use of TCP syncookies
  17. net.ipv4.tcp_syncookies = 1
  18. # Disable netfilter on bridges.
  19. net.bridge.bridge-nf-call-ip6tables = 0
  20. net.bridge.bridge-nf-call-iptables = 0
  21. net.bridge.bridge-nf-call-arptables = 0
  22. # Controls the default maxmimum size of a mesage queue
  23. kernel.msgmnb = 65536
  24. # Controls the maximum size of a message, in bytes
  25. kernel.msgmax = 65536
  26. # Controls the maximum shared segment size, in bytes
  27. kernel.shmmax = 68719476736
  28. # Controls the maximum number of shared memory segments, in pages
  29. kernel.shmall = 4294967296
  30. ###########oracle#################
  31. kernel.shmall = 2097152
  32. kernel.shmmax = 2147483648
  33. kernel.shmmni = 4096
  34. kernel.sem = 250 32000 100 128
  35. net.ipv4.ip_local_port_range = 1024 65000
  36. net.core.rmem_default = 4194304
  37. net.core.rmem_max = 4194304
  38. net.core.wmem_default = 262144
  39. net.core.wmem_max = 262144
  40. vm.hugetlb_shm_group = 501

上面是我的完整的 sysctl.conf文件

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 10.2.0.1,创建数据库时就遇到了这个错误。

这个错误的解决就是修改 /proc/sys/vm/hugetlb_shm_group 文件。
以下是老杨提到过的一个问题,解决方法相同:

帮客户解决一个Linux上数据库无法启动的问题。
客户的Linux 5.6 x86-64环境,安装数据库后,启动数据库报错:ORA-27125。
Oracle文档上关于ORA-27125错误的描述为:

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

查询了一下,发现问题和linux上的hugetbl有关。
解决方法也很简单,首先检查oracle用户的组信息:

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

下面用root执行下面的命令,将dba组添加到系统内核中:
# 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
加入如下的内容,其中501为dba组号,需要根据你实际的情况进行改变。
vm.hugetlb_shm_group = 501
# sysctl -p

那么hugetlb_shm_group组是什么呢?以下是解释:
hugetlb_shm_group contains group id that is allowed to create SysV shared memory segment using hugetlb page

这里反复提到了HugePage,以下是关于HugePage的说明和解释:

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.

ORA-27125: unable to create shared memory segment的解决方法(转)的更多相关文章

  1. 【ORA】ORA-27125:unable to create shared memory segment

    在安装Oracle 10g的时候出现一个了错误,在网上总结了一下大牛写的文章 ORA-27125:unable to create shared memory segment 安装时出现这个错误安装会 ...

  2. ORA-27125: unable to create shared memory segment

    平台环境   :  Oracle Linux Server release 5.7 x86_64 数据库版本 :  Oracle Database 10g Enterprise Edition Rel ...

  3. RAC数据库的ORA-27123: Unable To Attach To Shared Memory Segment Linux-x86_64 Error: 22: Invalid argument

    RAC数据库的 ORA-27123: Unable To Attach To Shared Memory Segment Linux-x86_64 Error: 22: Invalid argumen ...

  4. shared memory segment exceeded your kernel's SHMMAX parameter

    http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server IpcMemoryCreate: shmget(key=5432001, s ...

  5. java.lang.OutOfMemoryError: unable to create new native thread如何解决

    工作中碰到过这个问题好几次了,觉得有必要总结一下,所以有了这篇文章,这篇文章分为三个部分:认识问题.分析问题.解决问题. 一.认识问题: 首先我们通过下面这个 测试程序 来认识这个问题:运行的环境 ( ...

  6. Xcode6 运行程序后,右侧Debug区域的Memory显示空白解决方法

    http://chenyh-blog.com/%E8%9B%8B%E7%96%BC%E7%9A%84%E5%86%85%E5%AD%98-%E7%AC%AC%E4%B8%89%E7%AF%87-sdw ...

  7. Unable to connect to your virtual device!解决方法

    使用Genymotion安卓模拟器的用户,很多朋友在启动安卓系统的时候就弹出了以下英文,不知道如何处理,今天电脑知识网小编来教您处理Genymotion安卓模拟器启动出错的问题. Error Unab ...

  8. 安装tensorflow报ImportError: libcublas.so.9.0: cannot open shared object file的解决方法【转】

    本文转载自:https://blog.csdn.net/qq_37274615/article/details/81099738 转载自:https://blog.csdn.net/qysh123/a ...

  9. mysql错误:Can’t create TCP/IP socket (10106) 解决方法

    错误描述 “mysql错误:Can’t create TCP/IP socket (10106)”,目测是socket端口被占用的原因,然后在打开tomcat,报的错误中也包含了“socket”,再一 ...

随机推荐

  1. C#进行数据筛选(一)

    这里介绍数据筛选的第一种方式,不用过滤器,给新手看得 public DataTable SourceList(string Wmain, string OrderNo, string Process) ...

  2. Linux常用基本命令wc-统计文件的字节,字符,行数

    wc命令 作用:统计文件的字节,单词,行数 用法:wc [option] [file] -c:统计字节 ghostwu@dev:~/linux/uniq$ cat ghostwu.txt 192.16 ...

  3. python-观察者模式

    源码地址:https://github.com/weilanhanf/PythonDesignPatterns 说明: 存在这样的一种情况:公司领导再开例会那天临时有事,他让秘书给所有会上员工群发了一 ...

  4. Map对象以及for of的使用方法

  5. JS 显示隐藏DIV

    JS关闭DIV HTML <div id="bar1"> <p onclick="removeElement('bar1')">关闭&l ...

  6. webpack学习笔记—优化缓存、合并、懒加载等

    除了前面的webpack基本配置,还可以进一步添加配置,优化合并文件,加快编译速度.下面是生产环境配置文件webpack.production.js,与wenbpack.config.js相比其不需要 ...

  7. SpringMVC在Controller层中注入request的坑

    记一次为了节省代码没有在方法体中声明HttpServletRequest,而用autowire直接注入所钻的坑 结论 给心急的人. 直接在Controller的成员变量上使用@Autowire声明Ht ...

  8. Double Array Trie 的Python实现

    不多介绍,可自行Google,或者其它关键词: "datrie" 放代码链接: double_array_trie.py 因为也是一段学习代码,参考的文章都记在里面了,主要参考gi ...

  9. Ubuntu 16.04 Server 设置静态IP

    一.前言 最近需要在虚拟机当中装个Ubuntu Server 16.04的系统,但是在虚拟机安装的时候,并不像Ubuntu Server 18.04那样能一步步的进行配置,因此导致装好后的虚拟机是动态 ...

  10. Asp.Net Core使用System.Drawing.Common部署到docker报错问题

    Asp.Net Core 2.1发布后,正式支持System.Drawing.Common绘图了,可以用来做一些图片验证码之类的功能.但是把网站部署到docker容器里运行会遇到很多问题,也是非常闹心 ...