天天看點

與oracle緊密相關的unix/linux核心參數

        下面是幾個與oracle緊密相關的unix/linux核心參數,在安裝資料庫的時候,一般都需要根據實際情況進行調整。

<b>Init.ora Parameter</b>

<b>Kernel Parameter</b>

db_block_buffers

shmmax, shmall

db_files(maxdatafiles)

nfile, maxfiles

large_pool_size

log_buffer

processes

nproc, semmsl, semmns

shared_pool_size

      具體參數的說明如下(為避免歧義,這裡不做翻譯):

      maxfiles - Soft file limit per process. 

      maxuprc - Maximum number of simultaneous user processes per userid. 

      nfile - Maximum number of simultaneously open files systemwide at any given time. 

      nproc - Maximum number of processes that can exist simultaneously in the system. 

      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). 

      shmmax - The maximum size(in bytes) of a single shared memory segment. 

      shmmin - The minimum size(in bytes) of a single shared memory segment. 

      shmmni - The number of shared memory identifiers. 

      shmseg - The maximum number of shared memory segments that can be attached by a process. 

      semmns - The number of semaphores in the system. 

      semmni - The number of semaphore set identifiers in the system; determines the number of semaphore sets that can be created at any one time. 

      semmsl - The maximum number of sempahores that can be in one semaphore set. It should be same size as maximum number of Oracle processes. 

     這裡的大部分參數根據oracle官方的安裝手冊都可以進行正确的設定,但在實際工作中,發現很多DBA對shmmax和shmall這兩個參數的設定經常出問題,進而影響資料的整體性能,甚至導緻安裝失敗。

     shmmax參數是單個共享記憶體段的最大值,機關是bytes。這裡與oracle的SGA緊密相關,因為SGA使用的就是共享記憶體段,是以,shmmax&gt;=sga_target,這個參數比較容易設定錯誤,因為在安裝的時候,如果shmmaxsga_target,安裝并不會報錯,但是,當資料庫啟動後,SGA會由多個共享記憶體段組成,而SGA是一個整體,多個共享記憶體段之間會存在通信,這些通信對于oracle來說是不必要的開銷,會導緻資料庫性能下降。

    shmall參數是共享記憶體頁面數的最大值,需要與shmmax參數進行協調設定,shmall&gt;= ceil(shmmax/page_size),其中page_size一般為4k,以具體的作業系統為準。這裡要特别注意,shmall的作用域是整個系統範圍,而shmmax的作用域是單個共享記憶體段。是以,如果在一個系統上有多個oracle執行個體,shmmax設定大于等于最大的sga_target,而shmall需要大于等于所有執行個體的sga_target之和除以sga_target。這種情況下,如果多個執行個體已經啟動,在添加新執行個體時,如果shmall參數設定過小,會出現ora-27102 out of memory,導緻dbca建庫失敗。