客户原有服务器为64G的内存,迁移后服务器为128G内存,数据库原SGA为8G,迁移至新服务器后修改数据库sga为16G,启动时报如下错误:
数据库版本为10205,系统版本为RHEL6.5。
SQL> startup
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
查看mos发现引起此问题原因有如下几种情况,在此一一罗列出来:
CAUSES:
~~~~~~~~~~~~~~~~~~~
A] Ensure that the physical RAM is greater than the sga_max_size / sga_target
B] Ensure SHMMAX kernel setting is equal or larger than the sga max size
Usually occurs with Error: 22: Invalid argument
C] Ensure Ulimit settings are unlimited for the memory related parameters
D] Ensure that the swap size follows the guideline in Note:169706.1
Usually occurs with Error: 12: Cannot allocate memory
From the 11.2 Database installation guide:
Between 1GB and 2GB then 1.5 times RAM
Between 2GB and 16 GB then match RAM
More than 16 GB then 16GB RAM
Alternatively, from the 11.2 Grid Infrastructure (GI) installation guide:
Between 2GB and 8GB then 2 times RAM
Between 8GB and 32 GB then 1.5 times RAM
More than 32 GB then 32GB RAM
E] If oracle version is 32bit, the maximum SGA_TARGET / SGA_MAX_SIZE is 1.75gb
Check if oracle software version is 32bit:
unix> file $ORACLE_HOME/bin/oracle
If the software version is 32bit, you will see a literal string like 'ELF 32-bit' returned in the response
If the software version is 64bit, you will see a literal string like 'ELF 64-bit' returned in the response
Possible workaround:
- Linux only - review Note:260152.1 "Linux Big SGA, Large Memory, VLM - White Paper"
- Windows - review Note:225349.1 "Implementing Address Windowing Extensions (AWE) or VLM on Windows Platforms"
- Solaris: review Note:1028623.6 "SOLARIS: How to Relocate the SGA"
OTHER CAUSES
~~~~~~~~~~~~~~~
1] With additional error:
Error: 12: Cannot allocate memory
-Version 11g, LOCK_SGA is set to true and MEMORY_MAX_TARGET / MEMORY_TARGET > 0
See Note:577898.1
- LOCK_SGA set to true [Linux]
See Note:401077.1
备注:见附件内容
2] With additional error:
Linux-X86_64 Error: 28: No space left on device
- Possible SHMALL issue
See Note:301830.1
3] With additional error
SVR4 Error: 22: Invalid argument
- Solaris 10, using projecrts
Review
Note:779861.1 - incorrect shmmax setting
Note:390547.1 - svrctl issue
Note:790205.1 - Sun issue
4] With additional error
ORA-00604: error occurred at recursive SQL level 1
Intel SVR4 UNIX Error: 134495412: Unknown system error
See Note:786448.1
根据官方提示信息,最后发现shmall参数值设置过小导致数据库启动失败,如下:
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 2097152 ####该值设置过小,导致启动失败。
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 101365
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
根据http://dreamsanqin.blog.51cto.com/845412/1541528文中指出shmall参数设置规则,设置shmall=16777216,数据库启动正常。
备注:根据mos文档(文档ID 301830.1)中指出修改shmall=4194304,进行修改测试,启动数据库仍然报错。