Oracle 11g 在solaris 10 上核心引數的設定

xchui702發表於2011-06-22

Solaris 8,9 核心引數的設定是透過/etc/system來完成的,修改後需要重新啟動OS.

Solaris 10 採用資源控制的方法,此時有部分引數在/etc/system中的設定將不再起作用。 Oracle 官方文件的原話如下:

On Solaris 10, verify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown. The table also contains the resource controls that replace the /etc/system file for a specific kernel parameter. As Oracle Database does not set project information when starting proceses, some /etc/system processes that are deprecated but not removed must still be set for Oracle Database.

Note:

On Solaris 10, you are not required to make changes to the /etc/system file to implement the System V IPC. Solaris 10 uses the resource control facility for its implementation. However, Oracle recommends that you set both resource control and /etc/system/ parameters. Operating system parameters not replaced by resource controls continue to affect performance and security on Solaris 10 systems. For further information, contact your Sun vendor.
 
需要設定的引數如下:
Parameter Replaced by Resource Control Minimum Value
noexec_user_stack NA 1
semsys:seminfo_semmni project.max-sem-ids 100
semsys:seminfo_semmns NA 1024
semsys:seminfo_semmsl process.max-sem-nsems 256
semsys:seminfo_semvmx NA 32767
shmsys:shminfo_shmmax project.max-shm-memory 4294967295
shmsys:shminfo_shmmni project.max-shm-ids 100

 

具體在實施過程中,最好把這些引數都在/etc/systems做設定,也可只設NA相關的條目;然後對於非NA專案更改project,進行資源控制。

對於/etc/system設定如下:

set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=25600
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10

對於project 設定如下:

id -p oracle

uid=1001(oracle) gid=101(oradba) projid=3(default)
看出它使用的default的project.

建立一個project, 用來控制oracle 的使用者資源

#:/export/home/oracle\> projadd -U oracle user.oracle

 

永久性的設定一下資源控制:

projmod -sK "project.max-shm-memory=(privileged,4G,deny)" user.oracle projmod -sK "project.max-shm-ids=(privileged,100,deny)" user.oracle
projmod -sK "process.max-sem-nsems=(privileged,256,deny)" user.oracle
projmod -sK "project.max-sem-ids=(privileged,100,deny)" user.oracle

檢視設定的結果:

# cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
user.oracle:100::oracle::process.max-sem-nsems=(privileged,256,deny);project.max-sem-ids=(privileged,100,deny);project.max-shm-ids=(privileged,100,deny);project.max-shm-memory=(privileged,4294967296,deny)

驗證修改結果:

#:/export/home/oracle\> prctl -n project.max-shm-memory -i process $$
process: 24431: -bash
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged      4.00GB      -   deny                                 -

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

相關文章