ORA-27102: out of memory 故障

      最近的UAT数据库迁移,由于是多个DB需要迁移到同一台机器,一部分完成后,启动后续数据库碰到了ORA-27102错误,提示内存超出,查看系统可用内存,远大于需要启动数据库的sga和pga,究竟是怎么一回事呢?如果你也碰到类似错误,不妨往下看。

1、故障现象 oracle@v2013db02u:~> cat /etc/issue

Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel \r (\l).

oracle@v2013db02u:~> sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Sat Mar 30 09:46:57 2013

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup pfile=/u02/database/MHUAT02/initMHUAT02.ora ORA-27102: out of memory Linux-x86_64 Error: 28: No space left on device SQL> ho oerr ora 27102 27102, 00000, "out of memory" // *Cause: Out of memory // *Action: Consult the trace file for details

2、分析与解决 --首先查看了系统实际可用内存 --系统实际可用内存还剩50多个GB呢 SQL> exit Disconnected oracle@v2013db02u:/u02/database> free -m              total       used       free     shared    buffers     cached Mem:         64435       5968      58467          0          3       4045 -/+ buffers/cache:       1919      62516 Swap:        32773       1232      31540

--MetaLink上给出了关于这个问题的描述 [ID 301830.1] --是由于kernel.shmall值设置太小引起的

kernel.shmall       该参数用于配置系统一次能够使用的最大的共享页面数,该参数的值总是ceil(shmmax/PAGE_SIZE)       Oracle 9i,10g的x86以及x86-64平台推荐以及缺省的大小通常为2097152       在大多数情况下,该参数是够用的。按照上述计算方式页面内存总大小可以达到8GB(2097152*4096 bytes (shmall*PAGE_SIZE))       通常情况下,PAGE_SIZE 的大小为4096byte,除非使用了Big Pages 或 Huge Pages       对于超出8GB系统内存,如共享内存段(shmmax)的最大大小是16G,则所需要共享内存页数(shmall)为16GB/4KB=16777216KB/4KB=4194304(页)       32GB,64GB可以依上述方式类推。

--下面查看本机的设置 v2013db02u:~ # getconf PAGE_SIZE 4096

v2013db02u:~ # /sbin/sysctl -a | grep shm vm.hugetlb_shm_group = 0 kernel.shmmni = 4096         --定义共享内存段的最大数量,也就是可以开辟多少个共享内存段,一般够用  kernel.shmall = 2097152     --由于当前server有多个db运行,应该是总页数超出所致 kernel.shmmax = 4294967296  --定义单个共享内存段的最大值,由于当前server没有sga大于4gb的,可以保留原值

--前面我们在使用free时,系统使用内存已经超出了4gb,也表明shmall的超出了最大的共享页面数

--Author : Robinson --Blog   : http://blog.csdn.net/robinson_0612

v2013db02u:~ # vi /etc/sysctl.conf  --修改kernel.shmall的值,将其改为16gb能容纳的页面数,使用root身份 v2013db02u:~ # sysctl -p                --使修改立即生效,无需重启server v2013db02u:~ # /sbin/sysctl -a | grep shm vm.hugetlb_shm_group = 0 kernel.shmmni = 4096 kernel.shmall = 4194304 kernel.shmmax = 4294967296

--再次启动db正常 oracle@v2013db02u:~> export ORACLE_SID=MHUAT02 oracle@v2013db02u:~> sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Sat Mar 30 10:29:18 2013

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup pfile=/u02/database/MHUAT02/initMHUAT02.ora ORACLE instance started.

Total System Global Area  599785472 bytes Fixed Size                  2074568 bytes Variable Size             167774264 bytes Database Buffers          423624704 bytes Redo Buffers                6311936 bytes Database mounted. Database opened.

3、[ID 301830.1] Upon startup of Linux database get ORA-27102: out of memory Linux-X86_64 Error: 28: No space left on device [ID 301830.1] To Bottom  -------------------------------------------------------------------------------- Modified:Oct 4, 2012Type:PROBLEMStatus:PUBLISHEDPriority:3 Comments (0)    

In this Document  Symptoms   Ask Questions, Get Help, And Share Your Experiences With This Article  Changes  Cause  Solution  References -------------------------------------------------------------------------------- Applies to: Oracle Server - Standard Edition - Version 9.2.0.1 and later Oracle Server - Enterprise Edition - Version 9.2.0.1 and later Linux x86-64

Symptoms       When trying to increase the SGA to approach half available RAM with an Oracle 64-bit version on a Linux 64-bit operating system, even though shmmax is set to match half the amount of  RAM, you get the following error when trying to start the instance:

SQL> startup nomount ORA-27102: out of memory Linux-x86_64 Error: 28: No space left on device Ask Questions, Get Help, And Share Your Experiences With This Article Would you like to explore this topic further with other Oracle Customers, Oracle Employees, and Industry Experts?

Click here to join the discussion where you can ask questions, get help from others, and share your experiences with this specific article. Discover discussions about other articles and helpful subjects by clicking here to access the main My Oracle Support Community page for Database Install/Upgrade.

Changes       shmall is too small, most likely is set to the default setting of 2097152

$ cat /proc/sys/kernel/shmall 2097152

Cause       shmall is the total amount of shared memory, in pages, that the system can use at one time.

Solution       Set shmall equal to the sum of all the SGAs on the system, divided by the page size.

The page size can be determined using the following command:

$ getconf PAGE_SIZE 4096 For example, if the sum of all the SGAs on the system is 16Gb and the result of  '$ getconf PAGE_SIZE' is 4096 (4Kb) then set shmall to 4194304 pages

As the root user set the shmall to 4194304 in the /etc/sysctl.conf file:

kernel.shmall = 4194304

then run the following command:

$ sysctl -p $ cat /proc/sys/kernel/shmall 4194304

NOTE:

The above command loads the new value and a reboot is not necessary. Switch back to being the oracle user and retry the startup command. Modifying /etc/sysctl.conf is a permanent workaround (applies at boot time). If for some reason you DO NOT want to change the system wide configuration, you can do it on the fly by directly changing the kernel pseudo FS AKA procfs.

e.g. echo "4194304" > /proc/sys/kernel/shmall

Using HUGEPAGES does not alter the calculation for configuring shmall.

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏向治洪

ActivityManagerService启动过程分析

之前讲Android的View的绘制原理和流程的时候,讲到过在Android调用setContentView之后,Android调用了一个prepreTravl...

2678
来自专栏Ryan Miao

SpringCloud学习5-如何创建一个服务提供者provider

1353
来自专栏安恒网络空间安全讲武堂

HackTheBox - Poison Writeup

来源:https://www.absolomb.com/2018-09-08-HackTheBox-Poison/

1422
来自专栏个人分享

spark单机模式简单搭建

待安装列表 hadoop hive scala spark 一.环境变量配置: ~/.bash_profile PATH=$PATH:$HOME/bin

5501
来自专栏运维技术迷

crontab执行python脚本提示ImportError解决方法

早上看到hadoop的计算结果没有进入到mysql数据库,查看关于hadoop计划任务的输出日志发现有报错信息。果断拿来手动执行相关的python脚本,并没有错...

3865
来自专栏Kubernetes

Kubernetes Nginx Ingress Controller源码分析

main controllers/nginx/pkg/cmd/controller/main.go:29 func main() { // start a ...

55810
来自专栏Netkiller

使用 Jersey 调用 Restful 服务

第 20 章 Jersey - RESTful Web Services in Java. 目录 20.1. Client 20.1.1. Maven 版本 ...

3704
来自专栏java闲聊

Netty入门(一)

在文章开始之前首先明确一个问题,为什么要使用Netty,Netty解决了什么问题,围绕着这个问题我们开始本篇文章的学习

1542
来自专栏JAVA技术站

Spring整合Rabbitmq

没有找到一篇完整的文章介绍Spring如何整合Rabbitmq应用,琢磨一天搞出的一个入门的demo与伙伴们分享.

692
来自专栏猿天地

spring cloud gateway 全局过滤器

全局过滤器作用于所有的路由,不需要单独配置,我们可以用它来实现很多统一化处理的业务需求,比如权限认证,IP访问限制等等。

7532

扫码关注云+社区

领取腾讯云代金券