问题描述
oracle数据库在修改SGA后,启动时报错ORA-27102: out of memory,表示超出了内存范围,如果机器的内存是够的那么可能就是操作系统参数shmall设置过小影响了,shmall 参数是全部允许使用的共享内存大小。
1.检查环境
free -m
uname -a
cat /etc/sysctl.conf |grep shmall
2.将该值调小至419430
sed -i 's/kernel.shmall = 1073741824/kernel.shmall = 107374/g' /etc/sysctl.conf
3.使用sys登录,检查SGA参数,关闭数据库
SYS@orcl >show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 800M
sga_target big integer 0
关闭数据库
SYS@orcl >shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
4.使修改后的参数生效
sysctl -p
5.启动数据库
SYS@orcl >startup
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
Additional information: 1061158912
Additional information: 1
6.退出数据库登录,在终端将系统参数shmall修改回源值并生效
sed -i 's/kernel.shmall = 107374/kernel.shmall = 1073741824/g' /etc/sysctl.conf
查看shmall值
cat /etc/sysctl.conf |grep shmall
# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmall is 1073741824 on x86_64
# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmall is 2097152 on i386
kernel.shmall = 1073741824
使修改的参数生效
sysctl -p
7.使用sys登录并启动数据库
SYS@orcl >startup
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 1010828168 bytes
Database Buffers 50331648 bytes
Redo Buffers 5517312 bytes
Database mounted.
Database opened.
8.检查SGA参数
SYS@orcl >show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 1G
sga_target
ok,成功
备注:shmall参数
shmall 该参数表示系统任意时刻可以分配的所有共享内存段的总和的最大值(以页为单位),其值应不小于shmmax/page_size。例如上面的16G,可以为15461882265/4096 (getconf PAGESIZE可得到页大小) = 3774873,或17179869184/4096=4194304,根据内存100%来推算内存8G为 2097152, 内存16G为4194304, 内存32G为8388608,内存64G为16777216。
以上就是Oracle 【ERROR】ORA-27102: out of memory 解决方法,欢迎参考!