ORACLE 記憶體規劃及LINUX核心設定

gaopengtttt發表於2010-07-08

原創 轉載請註明出處 

公司的新伺服器到了記憶體24GB預裝 LINUX AS 5.1 64BIT,我正在對其進行安裝,同時需要部署DATA GUARD 最大效能模式。我準備未SGA分配

15GB空間,PGA無所謂了分給4GB好了,反正PGA也是
按需分配的,不像SGA例項一啟動就分配了,當然設定包括幾個重要的核心引數,主要涉及到LINUX共享記憶體,重要的2個核心引數是SHMMAX和

SHMALL,
SHMMAX:表示任意時刻系統可以分配一個共享記憶體段的最大值,當然我們希望SGA包含在一個共享段裡面,所以這個值要設定外>15G,設定為

16G好了。
SHMALL:  表示任意時刻系統可以分配給共享記憶體段頁數的最大值,同樣這個值至少不能小於我們最大的共享記憶體段的大小SHMMAX吧,這個值

是以記憶體頁為單位的,檢視記憶體頁大小使用getconf PAGE_SIZE
一般都4096,所以是16GB/4KB=16777216KB/4KB=4194304
所以核心引數修改為

# 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
kernel.shmall = 4194304
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

 


下面的文件取自METALINK
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.4 to 11.1.0.6
SUSE \ UnitedLinux x86-64
Red Hat Enterprise Linux Advanced Server x86-64 (AMD Opteron Architecture)
x86 64 bit (for Enterprise Linux only)

Symptoms
When trying to increase the SGA to approach half available RAM with an Oracle 64bit version on a Linux 64bit operating

system, even though shmmax is set to match half the amount of  RAM, you get the following error when trying to start the

instance:

SQL> startup nomount
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device  
Changes
shmall is too small, most likely is set to the default setting of 2097152

$ cat /proc/sys/kernel/shmall
2097152

Cause
shmall is the total amount of shared memory, in pages, that the system can use at one time.
Solution
Set shmall equal to the sum of all the SGAs on the system, divided by the page size.

The page size can be determined using the following command:

$ getconf PAGE_SIZE
4096
For example, if the sum of all the SGAs on the system is 16Gb and the result of  '$ getconf PAGE_SIZE' is 4096 (4Kb) then set

shmall to 4194304 pages

As the root user set the shmall to 4194304 in the /etc/sysctl.conf file:

kernel.shmall = 4194304

then run the following command:

# sysctl -p
# cat /proc/sys/kernel/shmall
4194304
 

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

相關文章