使用lock_sga和pre_page_sga参数保证SGA常驻物理内存(二)

2014-11-24 14:59:22 · 作者: · 浏览: 4
tem set pre_page_sga=true scope=spfile;
System altered.
sql > shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
tacsoft> startup;
ORA-27102: out of memory
Linux-x86_64 Error: 12: Cannot allocate memory
失败原因,Linux操作 系统对每一个任务在物理内存中能够锁住的最大值做了限制!需要手工进行调整。
5.“ORA-27102”及“Cannot allocate memory”问题处理
1)使用“ulimit -a”命令获得“max locked memory”的默认大小
oracle@sharkdg:[/u01/app/oracle/product/11.2.0/db_1/sqlplus/admin] 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) 139264
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) 2047
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
可见,一个任务可以锁住的物理内存最大值是32kbytes,这么小的值根本无法满足我们SGA的大小需求。
2)在root用户下尝试修改,成功。
代码:
[root@tacsoft ~]# ulimit -l unlimited
[root@tacsoft ~]# 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) 139264
max locked memory (kbytes, -l) unlimited
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) 2047
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
调整完操作系统的限制后,我们再次尝试启动数据库。成功!
代码:
[root@tacsoft ~]# su - oracle
ora10g@tacsoft /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Sun Dec 20 22:21:40 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to an idle instance.
NotConnected@> startup;
ORACLE instance started.
Total System Global Area 5368709120 bytes
Fixed Size 2080320 bytes
Variable Size 905970112 bytes
Database Buffers 4445962240 bytes
Redo Buffers 14696448 bytes
Database mounted.
Database opened.