Monday, February 22, 2016

project add


Change the soft limit
become a user, add the following value on user profile
vi .profile
ulimit -Sn 1024
or
vi .bash_profile
ulimit -Sn 1024

# projadd -U oinstall -p 101 -c "Oracle Oinstall" user.oinstall
# projmod -sK "process.max-file-descriptor=(privileged,65536,deny)" user.oinstall
# projects -l
# projmod -sK "project.max-shm-memory=(privileged,17179869184,deny)" user.oinstall
# projmod -sK "project.max-sem-nsems=(privileged,810,deny)" user.oinstall
# projects -l
# vi /etc/project
  515  projmod -sK "process.max-sem-nsems=(privileged,810,deny)" user.oinstall
  516  projects -l
  517  vi /etc/project
  518  history
[root@sinf-db-p03]#

user.grid
        projid : 100
        comment: "Oracle Grid Infra"
        users  : grid
        groups : (none)
        attribs: process.max-file-descriptor=(privileged,65536,deny)
                 process.max-sem-nsems=(privileged,810,deny)
                 project.max-sem-ids=(privileged,1024,deny)
                 project.max-shm-ids=(privileged,1024,deny)
                 project.max-shm-memory=(privileged,68719476736,deny)
user.oinstall
        projid : 101
        comment: "Oracle Oinstall"
        users  : oinstall
        groups : (none)
        attribs: process.max-sem-nsems=(privileged,810,deny)
                 project.max-sem-ids=(privileged,1024,deny)
                 project.max-shm-ids=(privileged,1024,deny)
                 project.max-shm-memory=(privileged,17179869184,deny)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

From man page.
Example 1: Adding a Project
     The following command creates  the  project  salesaudit  and
     sets  the resource controls specified as arguments to the -K
     option.
     projadd -p 111 -G sales,finance -c "Auditing Project" \
        -K "rcap.max-rss=10GB" \
        -K "process.max-file-size=(priv,50MB,deny)" \
        -K "task.max-lwps=(priv,100,deny)" salesaudit
     This  command  would  produce   the   following   entry   in
     /etc/project:
     salesaudit:111:Auditing Project::sales,finance: \
     process.max-file-size=(priv,52428800,deny); \
     rcap.max-rss=10737418240;task.max-lwps=(priv,100,deny)
     Note  that  the  preceding  would  appear  as  one  line  in
     /etc/project.
     Comparing  the  projadd  command  and  resulting  output  in
     /etc/project,  note  the effect of the scaling factor in the
     resource cap (rcap.max-rss=10GB) and  the  resource  control
     (process.max-file-size=(priv,50MB,deny)). Modifiers, such as
     B,  KB,  and  MB,  and  scaling  factors  are  specified  in
     resource_controls(5).
EXIT STATUS
     The following exit values are returned:
     0        Successful completion.
     2        The command syntax was invalid. A usage message for
              projadd is displayed.
     3        An invalid argument was provided to an option.
     4        The projid given with the -p option is  already  in
              use.
     5        The project files contain an error. See project(4).
     6        The project to be added, group, user,  or  resource
              does not exist.
     9        The project is already in use.
     10       Cannot update the /etc/project file.
FILES
     /etc/project            System project file

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc35889.1570/doc/html/jon1265068889138.html
Adaptive Server Enterprise 15.7 > Installation Guide Adaptive Server Enterprise 15.7 for Sun Solaris > Preparing to Install Adaptive Server

Adjusting the Operating System Shared Memory Parameters

Adjust shared memory segments if Adaptive Server cannot obtain large memory as a single segment or if Backup Server stripes fail due to insufficient segments.

Depending on the number and types of devices used for backup (dump) and recovery (load), you may need to adjust the shared memory segment parameter in the operating system configuration file to accommodate concurrent Backup Server processes. There are six default shared memory segments available for process attachments.
If any reconfiguration through sp_configure requires additional memory, Adaptive Server allocates shared memory segments after start-up. To account for these additional segments, allocate the maximum memory available to Adaptive Server by using the allocate max shared memory configuration parameter. See the System Administration Guide.
1.Adjust the operating system shared memory parameter.

Solaris 10 has shifted to a new method of controlling system resources. For this reason shminfo_shmmax is technically obsolete. If you still have an entry for it in /etc/system it will work. However, the new method requires an additional entry to the file /etc/project. For example:project-sybase:200:For use by Sybase:sybase:sybase:
project.max-shm-memory=\(privileged,17179869184,deny)
The new parameter is project.max-shm-memory=(privileged,17179869184,deny) — replaces the old parameter shminfo-shmmax. “Privilege” is a threshold value on a resource control that constitutes a point at which local actions are triggered or global actions such as logging into a machine can occur.
Privilege levels: ?
Basic – can be modified by the owner of the calling process.
 ?
Privilege – can be modified by privileged callers.
 ?
System – is fixed for the duration of the operating system instance.

In specifying the threshold value of “privilege”, you can use the abbreviation “priv” For example:project.max-shm-memory=(priv, 17179869184,deny)
?
"17179869184" – is the threshold value (16GB) on the resource control.
?
deny – denies attempts to use more than 16GB.

The default value for project.max-shm-memory is 25% of the physical memory on the system. The maximum value is UINT64_MAX, which works out to 18446744073709551615 bytes, so is limited only by the size of the physical memory.
To set the project.max-shm-memory while the system is running use the prctl command. The rctladm command sets the configuration permanently.
2.If the installer cannot update for Solaris 10 patch ID 120012-14, edit your /etc/user_attr file with:
 sybase::::type=normal;project=project-sybase
--------------------
To confirm that the update to this patch, use either of these commands:# projects -d sybase
project-sybase
# id -p sybase
uid=204409(sybase) gid=1(other) projid=200(project-sybase)
This update allows changes to shared-memory parameters within Solaris 10.
3.Adjust shared memory segments.

Depending on the number and types of devices used for backup (dump) and recovery (load), you may need to adjust the shared memory segment parameter in the operating system configuration file to accommodate concurrent Backup Server processes. The default number of shared memory segments available for process attachments is 6.
Adaptive Server may allocate shared memory segments after start-up if any reconfiguration through sp_configure requires additional memory. You may need to account for these additional segments. Allocate the maximum memory available to Adaptive Server, by using the allocate max shared memory configuration parameter. See the System Administration Guide for more information.
To adjust shared memory segments of the operating system, add the following line to the configuration file where x is the number of shared memory segments./etc/system:set shmsys:shminfo_shmseg=x


Parent topic: Preparing to Install Adaptive Server

--------------------------------------------------------------------------------
Created June 28, 2012. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

https://durgaprasad.wordpress.com/2007/03/20/projects-in-solaris/
https://docs.oracle.com/cd/E23824_01/html/821-1460/rmctrls.task-33.html
https://blogs.oracle.com/gjl/entry/a_simple_way_to_increase
https://docs.oracle.com/database/121/SSDBI/app_manual.htm#SSDBI7871


Projects in Solaris
March 20, 2007 at 12:47 pm (solaris)

When I was reading an interesting blog about prstat behavior, I read about projects in Solaris. After reading about projects, I came to know that they are mainly used for controlling resources used by process[es]. Suppose, if we want to control the CPU/disc/memory usages, then we create a project [using projadd, projmod] and in /etc/project, we have to modify resource control field. Then we can create/attach processes into this project [using newtask]. Once the process is created/attached in this project, all resource constraints will apply to that process. Suppose if the resource constraint name is process.max-file-descriptor and the value is 10, a process in that project can not have more that 10 file descriptors. Moreover, using prstat -J command, we can clearly see the resources used for projects. I felt this is a very good way to control resources used by specific processes, but I don’t know if the similar thing exists on other platforms like Linux. Some good links that I have referred are here & here.




# create project for mysql user
 projadd user.mysql
 # current max open file descriptors
 prctl -n process.max-file-descriptor $$
 # change it
 projmod -sK “process.max-file-descriptor=(basic,8192,deny)” user.mysql
 # current max shared memory
 prctl -n project.max-shm-memory $$
 # change it
 projmod -sK “project.max-shm-memory=(privileged,3221225472,deny)” user.mysql
 # view current project attribs
 projects -l user.mysql
 # or
 grep user.mysql /etc/project
 # view user’s current projects
 /usr/bin/projects
 It gives:
 default user.mysql



 3.
Luis Flores said,
August 20, 2009 at 8:35 pm
I know this posting is old, but just in case someone else has the same question: the problem here is that you never assigned the newly created project to any user. a project has been created, and that is it. a project by itself is meaningless unless a process/userID/username is assigned to it. at this point all you have it this:
 # projects -l user.mysql
user.mysql
 projid : 100
 comment: “”
users : (none)
 groups : (none)
 attribs: process.max-file-descriptor=(basic,8192,deny)
project.max-shm-memory=(privileged,3221225472,deny)
you see, there is not users or groups assigned to the projects. you need to add something to it like:
 projmod -U mysql user.mysql
then you will see the following:
# projects -l user.mysql
user.mysql
 projid : 100
 comment: “”
users : mysql
 groups : (none)
 attribs: process.max-file-descriptor=(basic,8192,deny)
project.max-shm-memory=(privileged,3221225472,deny)
and if you “su – myql” then you will see
$ projects
 default user.mysql
now mysql is has a project applied to it.
 hope this helps
 -Luis

https://docs.oracle.com/cd/E19044-01/sol.containers/817-1592/rmtaskproj.task-10/index.html
http://rc.quest.com/topics/howto/rbac/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
user.oradev:221::oradev:dba:
process.max-file-descriptor=(priv,65536,deny)
process.max-sem-nsems=(priv,810,deny);
project.max-sem-ids=(priv,512,deny);
project.max-shm-ids=(priv,512,deny);
project.max-shm-memory=(priv,5368709120,deny);


[root@ora-serv-25]# projadd -p 101 -U oratest -G dba -c "Oracle Test user" \
> -K "process.max-sem-nsems=(priv,810,deny)" \
> -K "project.max-sem-ids=(priv,512,deny)" \
> -K "project.max-shm-ids=(priv,512,deny)" \
> -K "project.max-shm-memory=(priv,5368709120,deny)" \
> -K "process.max-file-descriptor=(priv,65535,deny)" user.oratest
[root@ora-serv-25]# projects -l
system
        projid : 0
        comment: ""
        users  : (none)
        groups : (none)
        attribs:
user.root
        projid : 1
        comment: ""
        users  : (none)
        groups : (none)
        attribs:
noproject
        projid : 2
        comment: ""
        users  : (none)
        groups : (none)
        attribs:
default
        projid : 3
        comment: ""
        users  : (none)
        groups : (none)
        attribs:
group.staff
        projid : 10
        comment: ""
        users  : (none)
        groups : (none)
        attribs:
user.oratest
        projid : 101
        comment: "Oracle Test user"
        users  : oratest
        groups : dba
        attribs: process.max-file-descriptor=(priv,65535,deny)
                 process.max-sem-nsems=(priv,810,deny)
                 project.max-sem-ids=(priv,512,deny)
                 project.max-shm-ids=(priv,512,deny)
                 project.max-shm-memory=(priv,5368709120,deny)
[root@ora-serv-25]#

 

No comments:

Post a Comment