The problem we wanted to solve is with Oracle database, we have a DWH database and at night we have few things:
- Database Exports
- Users access
Before I'll show what we have done you need to know that the Oracle owner is "orauser"
and the Oracle SID is "orcl".
The first step is to create the needed projects, projects are used to distinguish different workloads from one another. We've created two projects:
- a project that is associated with a specific Unix user
GROUPNAME - a project that is associated with a specific Unix group
- project name - a project that is not associated to any group or user by default and can be associated manually or by SMF (Service Management Facility)
The commands to create a the projects are:
# projadd -c "Oracle default project" user.orauser
# projadd -c "Oracle low priority project" oracle_low
All the projects defined in /etc/projects file and can be viewed in this file or by running:
# projects -l
To check orauser default project run:
# id -p orauser
uid=60000(orauser) gid=300(dba) projid=100(user.orauser)
Now that we've created the projects, we need to change the system scheduling to use FSS:
# ps -cafe
# dispadmin -d FSS
# priocntl -s -c FSS -i class TS
# priocntl -s -c FSS -i pid 1
# ps -cafe
- "ps -cafe" - shows all processes and there scheduler class, I will not explain what a class is, but you should know that TS class is what Solaris uses for all processes by default. The TS class can be manipulated by the nice and renice commands.
- "dispadmin -d FSS" - sets the default scheduling class to be used on reboot to FSS
- "priocntl -s -c FSS -i class TS" - changes all current process with TS class to FSS class
- "priocntl -s -c FSS -i pid 1" - changes the /sbin/init process to FSS class
# prctl -n project.cpu-shares -r -v 30 -i project user.orauser
# prctl -n project.cpu-shares -r -v 10 -i project oracle_low
# projmod -sK “project.cpu-shares=(privileged,10,none)” oracle_low
# projmod -sK “project.cpu-shares=(privileged,30,none)” user.orauser
- projmod - changes the project attributes
- prctl - changes the resource control for running process
# project -l user.orauser
# project -l oracle_low
Now, we changed the export processes to run like this:
# newtask -p oracle_low /u01/scripts/oracle_export.sh
And every thing is working perfectly!!! Fun Fun Joy Joy.
One more useful command is "prstat -J" that will show resources utilization by project.