©2015 -
SOLARIS PROJECT AND USER ACCOUNT MANAGEMENT
For Solaris 9 and below, kernel parameter adjustments required for applications such as databases are configured in /etc/system. And once adjustments are made, a reboot is required for it to take effect. Starting with Solaris 10, these kernel adjustments are now done through Project Resource Management. Adjustments done through the projects does not require a reboot anymore. All is needed for the user associated to the project is to re-
Below is a table of kernel parameter definition and their equivalent in projects.
shmmax -
(default=1048576 (1mb) max=4294967295 (4gb))
shmmin -
(default=1 max=4294967295)
shmmni -
(default=100 max=2147483647)
shmseg -
Usually set equal to shmmni (default=6 max=32767 (32k))
semmns -
(SID_A+SID_B)+(SID_C * 2)+(no. of instances * 10)
where: SID_A,SID_B,SID_C = processes value per instance
SID_C = has the largest value
semmni -
created at any one time
semmsl -
Should be equal to or greater than the value of oracle processes.
SOLARIS 9 PARAMETER |
SOLARIS 10 PARAMETER |
SOLARIS 10 DEFAULT |
Set shmsys:shminfo_shmmax=4294967295 |
project.max- |
1/4 Physical Mem |
Set shmsys:shminfo_shmmin=1 |
obsolete/removed |
|
Set shmsys:shminfo_shmmni=200 |
project.max- |
128 |
set shmsys:shminfo_shmseg=10 |
obsolete/removed |
|
set semsys:seminfo_semmns=4096 |
obsolete/removed |
|
Set semsys:seminfo_semmni=100 |
project.max- |
128 |
Set semsys:seminfo_semmsl=1024 |
process.max- |
512 |
Set semsys:seminfo_semopm=100 |
project.max- |
512 |
set semsys:seminfo_semvmx=32767 |
obsolete/removed |
|
set noexec_user_stack=1 |
|
|
set abort_enable=2 |
|
|
How To Check The Current User ID And The Assigned Project ID
How To Check The Default Resource Control Value Of A Project
How To Temporarily Assign A Resource Control Value To A Project
How To Permanently Assign A Resource Control Value To A Project Using System Console Tool
How To Permanently Assign A Resource Control Value To A Project Using Command Line
Creating A User With Assigned Project
How To Check All Resource Values Of A Current Session To Verify Changes Made
How To Check All Default Values Of A Project
How To Check A List Of Running Processes And Their Assigned Projects
How To Switch The User Primary Project To Another Project
CHECKING SOLARIS PROJECT KERNEL PARAMETERS
TO CHECK THE CURRENT USER ID AND THE ASSIGNED PROJECT ID
# id -
uid=0(root) gid=0(root) projid=1(user.root)
TO CHECK THE RESOURCE CONTROL VALUE OF A PROJECT
Example for Project user.root:
# prctl -
project: 1: user.root
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-
privileged 249MB -
system 16.0EB max deny -
# prctl -
project: 1: user.root
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-
privileged 128 -
system 16.8M max deny -
Example for current user:
# prctl -
process: 633: -
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-
privileged 512 -
system 32.8K max deny -
SETTING SOLARIS PROJECT KERNEL PARAMETERS
TO TEMPORARILY ASSIGN A RESOURCE CONTROL VALUE TO A PROJECT
An example to temporarily set 2 GB max shared memory:
# prctl -
# prctl -
project: 1: user.root
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-
privileged 2.00GB -
system 16.0EB max deny -
An Example to temporarily set a process parameter of current session:
1. get the process id
UNIX> who -
NAME LINE TIME IDLE PID COMMENTS
orasu + pts/1 Apr 29 10:27 . 9334 (57.23.211.129)
2. list existing value of process param of current session
UNIX> prctl -
process: 9334: -
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-
privileged 6.14K -
system 32.8K max deny -
3. Temporary set a new value of process param
As root,
# prctl -
4. Verify new settings
UNIX> prctl -
process: 9334: /usr/local/sbin/sshd -
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-
privileged 8.19K -
system 32.8K max deny -
TO PERMANENTLY ASSIGN A RESOURCE CONTROL VALUE TO A PROJECT
NOTE: The following is an example of a step-
Using SYSTEM MANAGEMENT CONSOLE tool, To permanently set any resource control:
UNIX> /usr/sadm/bin/smc &
From the system management console,
1) create group:
orainst, oradba, oraoper, sunweb
default primary project: group.staff
2) create user:
oradb (primary grp: orainst)
sunweb (primary grp: webadmin)
3) create project:
user.oracle
* at resource control tab, add shared memory settings for oracle:
project.max-
process.max-
user.sunweb
4) Assign users to project:
oradb -
sunweb -
OR, Using COMMAND LINE To Permanently Set Resource Control:
NOTE: The following is an example of a step-
Kernel parameters now have to be modified via the project file. To set the kernel parameters for Oracle 10g Database:
first as root edit /etc/system and add the following:
set noexec_user_stack=1
(the settings above requires reboot)
NOTE: Metalink Note 395334.1 explains Why do we need to set
NOEXEC_USER_STACK to 1 before Oracle installation as a mandatory step:
Sometimes programs allocate buffers but do not always check the size of
the data coming into these buffers. An unwanted program can overflow such
a buffer by placing a pointer to its own code and take control of the
application with the privileges assigned to that application. Solaris 9
introduced the option to disable execution of user programs on the stack
and assist in preventing this type of issue. This feature is only
available on SPARC and AMD64 systems because it requires hardware support
that is not available in current Intel 32bit CPUs. The protection is
setup by employing the system wide parameter 'set noexec_user_stack=1'
in the /etc/system file.
then, also as root, execute the following:
1) Create the required groups.
groupadd -
groupadd -
groupadd -
2) Create a project with kernel parameter settings.
At minimum, the database requires to have the following resources set:
max-
max-
max-
The settings of the file descriptors must not exceed the hard limit. You can check the the hard and soft limits through the following commands:
UNIX> ulimit -
UNIX> ulimit -
In projects, use the priv parameter to set the hard limit and basic to set the soft limit for your max-
projadd -
-
-
-
where:
-
-
-
-
-
verify changes added in /etc/project
To modify existing project use projmod.
projmod -
-
-
3) Create user -
useradd -
-
passwd oradb
verify user attributes related to project assignment in /etc/user_attr
4) Check All Kernel Resource Settings Of A Current Session
4.1) Verify the user's shell settings
switch to oracle user:
su -
check if oracle user project is not the default:
should be,
UNIX> id -
uid=102(oradb) gid=101(orainst) projid=100(oracle)
and not,
UNIX> id -
uid=102(oradb) gid=101(orainst) projid=3(default)
get taskid of current shell of oracle user:
UNIX> ps -
TASKID
57
display resource settings of a task
UNIX> prctl -
4.2) Verify the project default settings
Note: There has to be at least one process running that uses
the project otherwise you get error:
"prctl: oracle: No controllable process found in task, project, or zone."
Basic remedy is to open a shell by oracle user.
UNIX> prctl -
TO CHECK A LIST OF RUNNING PROCESSES AND THEIR ASSIGNED PROJECTS
UNIX> prstat -
TO SWITCH THE USER PRIMARY PROJECT TO ANOTHER PROJECT
1. login as the user
2. set a new project for the current log
newtask -