вторник, 12 января 2010 г.

Solaris 10 : Project for oracle


project.max-shm-ids:        shmmni    Maximum shared memory IDs for a project.
project.max-sem-ids:        semmni    Maximum semaphore IDs for a project.
project.max-msg-ids:        msgmni    Maximum message queue IDs for a project.
project.max-shm-memory:     shmmax    Total amount of shared memory allowed for a project.
process.max-sem-nsems:      semmsl    Maximum number of semaphores allowed per semaphore set.
process.max-sem-ops:        semopm    Maximum number of semaphore operations allowed per semop.
process.max-msg-qbytes:     msgmnb    Maximum number of bytes of messages on a message queue.
process.max-msg-messages:   msgtql    Maximum number of messages on a message queue.


project.max-shm-memory         shmmax  ***
process.max-stack-size
process.max-file-descriptor
process.max-sem-nsems          semmsl  1024   256
project.max-sem-ids            semmni  512    100
project.max-shm-ids            shmmni  512    100

==========================================================================
#projects -l
#projdel group.dba
#projadd group.dba

#usermod -K project=group.dba oradb
#usermod -K project=group.dba oragrid
#projmod -sK "project.max-shm-memory=(priv,70gb,deny)"  group.dba
#projmod -sK "process.max-stack-size=(privileged,33554432,deny)" group.dba
#projmod -sK "process.max-file-descriptor=(privileged,65536,deny)" group.dba
#projmod -sK "process.max-sem-nsems=(priv,256,deny)" group.dba
#projmod -sK "project.max-sem-ids=(priv,100,deny)" group.dba
#projmod -sK "project.max-shm-ids=(priv,100,deny)" group.dba


*  Added to fix switchover problem

set shmsys:shminfo_shmmax=171798691840
set semsys:seminfo_semmsl=256
set semsys:seminfo_semmni=100
set shmsys:shminfo_shmmni=100

==========================================================================
#projects -l
#projdel group.dba
#projadd group.dba

#usermod -K project=group.dba oradb
#usermod -K project=group.dba oragrid
#projmod -sK "project.max-shm-memory=(priv,150gb,deny)"  group.dba
#projmod -sK "process.max-stack-size=(privileged,33554432,deny)" group.dba
#projmod -sK "process.max-file-descriptor=(privileged,65536,deny)" group.dba
#projmod -sK "process.max-sem-nsems=(priv,1024,deny)" group.dba
#projmod -sK "project.max-sem-ids=(priv,512,deny)" group.dba
#projmod -sK "project.max-shm-ids=(priv,512,deny)" group.dba


# Oracle:
set shmsys:shminfo_shmmax=75161927680
set semsys:seminfo_semmsl=1024
set semsys:seminfo_semmni=512
set shmsys:shminfo_shmmni=512

set noexec_user_stack=1

==========================================================================

$ulimit -n

256

$prctl -n process.max-file-descriptor -v 20480 -r -i process $$

$

$ulimit -n

20480

$

$ulimit -s

8192

$prctl -n process.max-stack-size -v 9223372036854775807 -r -i process $$

$

$ulimit -s

unlimited

$

==========================================================================

Установить значения параметров:

prctl -n project.max-shm-memory      -v 150gb                 -r -i process $$
prctl -n process.max-stack-size      -v 9223372036854775807   -r -i process $$
prctl -n process.max-file-descriptor -v 20480                 -r -i process $$
prctl -n process.max-sem-nsems       -v 1024                  -r -i process $$
prctl -n project.max-sem-ids         -v 512                   -r -i process $$
prctl -n project.max-shm-ids         -v 512                   -r -i process $$

Просмотр текущих значений параметров:

prctl -n project.max-shm-memory       -i process $$
prctl -n process.max-stack-size       -i process $$
prctl -n process.max-file-descriptor  -i process $$
prctl -n process.max-sem-nsems        -i process $$
prctl -n project.max-sem-ids          -i process $$
prctl -n project.max-shm-ids          -i process $$

Чтобы после перезагрузки их не потерять создадим проект:

projdel user.oradb

projadd -U oradb -K "project.max-shm-memory=(priv,150gb,deny)"  user.oradb
projmod -sK "process.max-stack-size=(privileged,9223372036854775807,deny)" user.oradb
projmod -sK "process.max-file-descriptor=(privileged,20480,deny)" user.oradb
projmod -sK "process.max-sem-nsems=(priv,1024,deny)" user.oradb
projmod -sK "project.max-sem-ids=(priv,512,deny)" user.oradb
projmod -sK "project.max-shm-ids=(priv,512,deny)" user.oradb


Или так:

# projadd group.dba
# usermod -K project=group.dba oradb
# usermod -K project=group.dba oragrid

# more /etc/project

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
group.dba:100::::

# projmod -sK "project.max-shm-memory=(priv,150gb,deny)"  group.dba
# projmod -sK "process.max-stack-size=(privileged,9223372036854775807,deny)" group.dba
# projmod -sK "process.max-file-descriptor=(privileged,20480,deny)" group.dba
# projmod -sK "process.max-sem-nsems=(priv,1024,deny)" group.dba
# projmod -sK "project.max-sem-ids=(priv,512,deny)" group.dba
# projmod -sK "project.max-shm-ids=(priv,512,deny)" group.dba


Проверяем так:
# prctl -i project group.dba

# vi /etc/system
# Oracle:
set noexec_user_stack=1