Linux上安裝oracle的注意點

rongshiyuan發表於2012-06-18

Linux安裝oracle的注意點

今天看了tuning and optimizing rhel for oracle 9i and10gdatabases》這篇文的,感覺講得不錯,對linux下的管理有了一定的認識,這裡記錄下一些內容(主要是一些安裝時需要調整的核心引數,其它還有一些技術細節可檢視這份文件,是個不錯的參考)

1、 swap的設定

RAM Swap Space

--------------------------------------------

1 GB - 2 GB 1.5 times the size of RAM

2 GB - 8 GB Equal to the size of RAM

more than 8GB 0.75 times the size of RAM

一些實時的記憶體變化,可檢視/proc/meminfo,這裡包括記憶體的所有內容(swapramhugepage ……

2、 Setting SHMMAX Parameter

Shmmax表示一個共享記憶體段的最大值,由於sga都是在共享記憶體段中,所以,這個值的建議是等於sga的大小。另外,檢視oracle使用的共享記憶體段的大小,可通過

Ipcs –m

如果共享記憶體段不足,有可能會報:

ORA-27123: unable to attach to shared memory segment

修改共享記憶體段可通過如下途徑:

To determine the maximum size of a shared memory segment, run:

# cat /proc/sys/kernel/shmmax

2147483648

The default shared memory limit for SHMMAX can be changed in the proc file system without reboot:

# echo 2147483648 > /proc/sys/kernel/shmmax

Alternatively, you can use sysctl(8) to change it:

# sysctl -w kernel.shmmax=2147483648

To make a change permanent, add the following line to the file /etc/sysctl.conf (your setting may vary). This file is used during the boot process.

# echo "kernel.shmmax=2147483648" >> /etc/sysctl.conf

3、 Setting SHMMNI Parameter

Shmmni表示最大的共享記憶體段的數量,這個值對於oracle 9i10g基本都是4096(預設值)。

檢視和設定shmmni的值:

To determine the system wide maximum number of shared memory segments, run:

# cat /proc/sys/kernel/shmmni

4096

The default shared memory limit for SHMMNI can be changed in the proc file system without reboot:

# echo 4096 > /proc/sys/kernel/shmmni

Alternatively, you can use sysctl(8) to change it:

# sysctl -w kernel.shmmni=4096

To make a change permanent, add the following line to the file /etc/sysctl.conf. This file is used during the boot process.

# echo "kernel.shmmni=4096" >> /etc/sysctl.conf

4、 Setting SHMALL Parameter

Shmall表示所有的共享頁(shared segment pages)的數量,這個值通常為shmmax/PAGE_SIZE

一般情況下page_size=40964K),如何獲得ospage_size

$ getconf PAGE_SIZE

4096

檢視和設定該值:

To determine the system wide maximum number of shared memory pages, run:

# cat /proc/sys/kernel/shmall

2097152

The default shared memory limit for SHMALL can be changed in the proc file system without reboot:

# echo 2097152 > /proc/sys/kernel/shmall

Alternatively, you can use sysctl(8) to change it:

# sysctl -w kernel.shmall=2097152

To make a change permanent, add the following line to the file /etc/sysctl.conf. This file is used during the boot process.

# echo "kernel.shmall=2097152" >> /etc/sysctl.conf

5、 Removing Shared Memory

有的時候,我們通過ipcs –m觀察共享記憶體段時,會發現如下情況:

$ ipcs -m

------ Shared Memory Segments --------

key shmid owner perms bytes nattch status

0x8f6e2129 98305 oracle 600 77694523 0

0x2f629238 65536 oracle 640 2736783360 35

0x00000000 32768 oracle 640 2736783360 0 dest

Statusdest表示共享記憶體段是沒用的,但是又不能釋放掉,所以,我們需要手工把它給刪除掉。

我們可以通過如下命令檢視statusdest的更為細緻的資訊:

$ ipcs -m -i 32768

Shared memory Segment shmid=32768

uid=500 gid=501 cuid=500 cgid=501

mode=0640 access_perms=0640

bytes=2736783360 lpid=3688 cpid=3652 nattch=0

att_time=Sat Oct 29 13:36:52 2005

det_time=Sat Oct 29 13:36:52 2005

change_time=Sat Oct 29 11:21:06 2005

刪除該共享記憶體段,需要執行以下命令:

$ ipcrm shm 32768

還有一種辦法是使用oraclesysresv命令,具體參考該文件內容

6、 hugepage

如果os的系統記憶體超過了64g,那麼就可以使用hugepage了,這樣,就能更高效得使用共享記憶體,因為 hugepage不會被swap out,而且,在定址方面,有更高的效能。

下面可檢視hugepage的一些基本設定

$ grep Huge /proc/meminfo

HugePages_Total:

HugePages_Free:

Hugepagesize: 2048 kB

預設情況下,Hugepagesize都是2M,那麼如果我們有充足的RAM,我們需要怎麼配置Hugepage呢,一般情況下,讓它等於oraclesga大小就可以了。

設定vm.nr_hugepages =4096就可以了,具體,可參考metalink ID 744769.1

^_^,就到這裡了,其它的也不作詳細記錄了。

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

相關文章