Why need to create a project for a DB2 instance owner and how ?

To run a DB2 database on a Solaris server, we need to set the System V tunables. Before Solaris 10, this is done by setting the kernel parameters in /etc/system. With Solaris 10, though the /etc/system settings are still valid, there are some drawbacks of using /etc/system file to set the System V tunables.

1. It is not available in Solaris Containers.
2. The system needs a reboot every time you change the file.
3. The settings affect the overall system.

We should use resource controls which have more advantages over /etc/system:
1. It is supported in Solaris Containers.
2. Any changes are dynamic, no reboot required
3. We can have different resource control settings for different DB2 instances or other applications running on the same system.

It is recommended to create a project for each DB2 instance owner. The simplest approach is to edit /etc/project file directly as user root. e.g.,

user.db2inst1:1234:::root:project.max-shm-memory=(privileged,123379030425,deny);project.max-shm-ids=(privileged,24576,deny);project.max-msg-ids=(privileged,20480,deny);project.max-sem-ids=(privileged,24576,deny);

db2inst1 is the instance name. Become user db2inst1, run id(1M) command to verify the project user.db2inst1 has been associated with the user. e.g.,

$id -p

uid=7001(db2inst1) gid=5001(db2iadm) projid=1234(user.db2inst1)

And run prctl(1M) command to verify the IPC resource control settings:

$prctl $$

Alternatively, the project entry can also be set as the following,

db2inst1proj:1234:::root:project.max-shm-memory=(privileged,123379030425,deny);project.max-shm-ids=(privileged,24576,deny);project.max-msg-ids=(privileged,20480,deny);project.max-sem-ids=(privileged,24576,deny);

in addition, add the following to /etc/user_attr,
db2inst1::::project=db2inst1proj

DB2 provides a utility called db2osconf to generate the recommended values for IPC tunables on the Solaris platform. 

# ./db2osconf 

set msgsys:msginfo_msgmni = 20480
set semsys:seminfo_semmni = 24576 
set shmsys:shminfo_shmmax = 123379030425 
set shmsys:shminfo_shmmni = 24576

But the utility (in DB2 v8.x and v9.1) only prints out the kernel parameters, you can refer to System V IPC Configuration to map the kernel parameters to the resource controls.

In the latest DB2 V9.5 FP 3, the db2osconf utility has been enhanced to add the support for resource controls.

Comments:

Setting up a project for each instance makes sense from what you state in the blog. However, IBM usually recommends 90% of memory on a server for max-shm-memory. What should be the approach for these values with multiple instances on a server?

Posted by Ben Eisenstein on November 20, 2008 at 05:35 AM EST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is a blog to talk about technical information regarding running IBM DB2 database on Solaris.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today