你好,游客 登录 注册 搜索
背景:
阅读新闻

ORA-27102:out of memory Linux-x86_64 Error: 12: Cannot allocate memory的处理

[日期:2014-06-14] 来源:Linux社区  作者:eric0435 [字体: ]

客户的Oracle数据库启动报错,操作linux,oracle 11g由于将lock_sga参数设置为true当重启数据库时报错ORA-27102: out of memory
 
SQL> startup nomount
 ORA-27102: out of memory
 Linux-x86_64 Error: 12: Cannot allocate memory

原因是因为操作参数没有设置为允许sga所指定大小的内存可以被锁定
[root@jyrac1 ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size          (kbytes, -d) unlimited
scheduling priority            (-e) 0
file size              (blocks, -f) unlimited
pending signals                (-i) 16384
max locked memory      (kbytes, -l) 32
max memory size        (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues    (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time              (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
 
解决方法有两种
 一:ulimit -l unlimited 在启动实例之前执行只对当前会话有效
[root@jyrac1 ~]# ulimit -l unlimited

[root@jyrac1 ~]# su - oracle
[oracle@jyrac1 ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size          (kbytes, -d) unlimited
scheduling priority            (-e) 0
file size              (blocks, -f) unlimited
pending signals                (-i) 16384
max locked memory      (kbytes, -l) unlimited
max memory size        (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues    (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time              (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
 [oracle@jyrac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 6 12:20:26 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  313159680 bytes
Fixed Size                  2212936 bytes
Variable Size            109054904 bytes
Database Buffers          197132288 bytes
Redo Buffers                4759552 bytes

SQL> show parameter lock_sga

NAME                                TYPE                    VALUE
------------------------------------ ----------------------  ------------------------------
lock_sga                            boolean                TRUE

--------------------------------------分割线 --------------------------------------

CentOS 6.4下安装Oracle 11gR2(x64) http://www.linuxidc.com/Linux/2014-02/97374.htm

Oracle 11gR2 在VMWare虚拟机中安装步骤 http://www.linuxidc.com/Linux/2013-09/89579p2.htm

Debian 下 安装 Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htm

--------------------------------------分割线 --------------------------------------

二:修改/etc/security/limits.conf加入以下信息
 oracle soft memlock 10485760
 orcale hard memlock 10485760
 允许锁定10G的内存
SQL> startup nomount
ORACLE instance started.

Total System Global Area  730714112 bytes
Fixed Size                  2216944 bytes
Variable Size            524291088 bytes
Database Buffers          197132288 bytes
Redo Buffers                7073792 bytes
 
还有lock_sga参数设置为true是不能启用自动内存管理的
SQL> show parameter memory

NAME                                TYPE                      VALUE
------------------------------------ ----------------------    ------------------------------
hi_shared_memory_address            integer                  0
memory_max_target                    big integer              0
memory_target                        big integer              0
shared_memory_address                integer                  0

SQL> alter system set memory_max_target=700M scope=spfile;

System altered.

SQL> alter system set memory_target=600M scope=spfile;

System altered.


SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount
ORA-00847: MEMORY_TARGET/MEMORY_MAX_TARGET and LOCK_SGA cannot be set together
 
说明lock_sga参数设置为true时是不能启用自动内存管理的

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址http://www.linuxidc.com/Linux/2014-06/103152.htm

linux
相关资讯       ORA-27102 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款