1. 程式人生 > >[oracle]Ubuntu下ORA-27102及ORA-00845錯誤處理

[oracle]Ubuntu下ORA-27102及ORA-00845錯誤處理

錯誤資訊:

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

00845, 00000, "MEMORY_TARGET not supported on this system"
// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was not sized correctly on Linux.
// *Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running on the system

資料庫版本: 11.2.0.1.0

作業系統版本:  Ubuntu 12.04.5

原由:

想擴大oracle記憶體使用,在/etc/fstab中已經新增

tmpfs   /dev/shm        tmpfs defaults,size=40G 0 0

然而oracle還是無法使用到超過20G的記憶體,開始是報:

ORA-00845 MEMORY_TARGET not supported on this system

解決:

1. 先解決ORA-00845, 由於是ubuntu 12的系統,沒有了/dev/shm

處理:
在/etc/init/mounted-dev.conf檔案中刪除下面一行 (看語句應該是ubuntu 12增加了個軟連結將/dev/shm改名為/run/shm了,而oracle又只認識/dev/shm)

[ -e /dev/shm ] || ln -s /run/shm /dev/shm

2. 處理ORA-27102,這個錯誤一般是由於核心引數檔案/etc/sysctl.conf設定導致的(大部分情況下,我們都按預設設定來的)

主要是兩個引數值kernel.shmall和kernel.shmmax

關於kernel.shmmax 

 官方解釋為:Available physical memory Defines the maximum allowable size of one shared memory segment. The SHMMAX setting should be large enough to hold the entire SGA in one shared memory segment. A low setting can cause creation of multiple shared memory segments which may lead to performance degradation.

意思就是最大共享記憶體段,應該設的比SGA要大,我這裡就直接設定為kernel.shmmax = 42212254720, 大約40多G的樣子

kernel.shmall:

This parameter sets the total amount of shared memory pages that can be used system wide. Hence, SHMALL should always be at least ceil(shmmax/PAGE_SIZE) 它是設定系統共享記憶體頁的最大數量, shmall*4096應該大於或等於shmmax,那麼我這裡就要至少設為kernel.shmall = 10305728