資料庫啟動出現ORA-27102錯誤

yangtingkun發表於2009-11-28

一臺測試資料庫啟動時出現了這個錯誤。

 

 

資料庫啟動時報錯:

[oracle@bjtest ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on 星期一 11 16 08:04:00 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

已連線到空閒例程。

SQL> startup
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device

alert檔案中包含了下面的資訊:

WARNING: EINVAL creating segment of size 0x0000000233400000
fix shm parameters in /etc/system or equivalent

這種錯誤顯然是作業系統引數設定不當造成的,因為作業系統中的記憶體和SWAP空間是足夠的。

不過系統中的核心引數設定也沒有更改,一直以來資料庫啟動也沒有報錯。

檢查系統引數設定:

[oracle@bjtest dbs]$ more /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296
#fs.file-max = 6553600

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 8589934592
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

由於資料庫初始化引數設定的記憶體小於核心的設定,不應該導致的產生。

SQL> select 2097152 * 4096 from dual;

2097152*4096
------------
  8589934592

不過無論是SHMMAX還是SHMALL的設定,都是和記憶體設定相差無幾,下面嘗試調整SHMALL引數,設定值為4194304

[root@bjtest ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 4194304
kernel.shmmax = 8589934592
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

修改後再次啟動資料庫,錯誤變成了:

[oracle@bjtest ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on 星期二 11 17 01:46:54 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

已連線到空閒例程。

SQL> startup
ORA-27123: unable to attach to shared memory segment
Linux-x86_64 Error: 22: Invalid argument
Additional information: 1
Additional information: 884740

這個錯誤資訊顯然是指出了SHMMAX引數的設定存在問題:

[root@bjtest ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 4194304
kernel.shmmax = 12000000000
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

再次修改SHMMAX引數後,資料庫成功啟動:

SQL> startup
ORACLE
例程已經啟動。

Total System Global Area 9432971568 bytes
Fixed Size                   756016 bytes
Variable Size             838860800 bytes
Database Buffers         8589934592 bytes
Redo Buffers                3420160 bytes
資料庫裝載完畢。
資料庫已經開啟。

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-620908/,如需轉載,請註明出處,否則將追究法律責任。

相關文章