Home > Articles > Data > DB2

DB2 UDB Installation

This chapter is from the book

This chapter is from the book

Before You Begin

Before you begin installing DB2 on Solaris, you should:

  • Review the Quick Beginnings manual sections pertinent to installing DB2 on Solaris.

  • Apply patches for your Solaris operating environment:

    • Recommended patches

    • Security patches

    • SUNwlibc patch

  • Update the kernel configuration parameters (and reboot).

  • Verify that adequate SWAP space is available.

Applying Patches for Solaris Operating Environment

Appropriate patches should be applied to your system before you begin to install DB2. See the installation notes for information about the patches that should be installed to your Solaris operating environment. You can find the installation notes on your installation media (the CD) at:




where /CDROM is the mount point of the CD-ROM and LN represents the language environment (such as en_US, de_DE, etc.).

The manual DB2 UDB for UNIX Quick Beginnings, as well as the online documentation, which is viewable in pdf or HTML format, is downloadable from the IBM Library Web site. It contains the minimum prerequisites for DB2 and is an excellent starting point. You should also at least scan the Readme file and installation notes before you begin installation for the latest information available.

Updating the Kernel Configuration Parameters

Properly set kernel configuration parameters are critical for correct operation of DB2 UDB on Solaris. In fact, creating a DB2 instance checks for certain minimum values in the kernel configuration and will fail if the values are not set appropriately. To maximize the benefits from the power of a Sun server running DB2 UDB on the Solaris operating environment, you must set values for some kernel configuration parameters related to IPC. These parameters are related to the IPC messages, IPC semaphores, and IPC shared memory. The following is a list of these kernel configuration parameters:

For IPC messages

msgsys:msginfo_msgmax is the maximum size of a single message. Must be at least 65,535 (64k).

msgsys:msginfo_msgmnb is the maximum number of bytes that can be put on a single message queue. It must be at least 65,535 (64k).

msgsys:msginfo_msgssz is the size of each message segment in bytes. The product of this value and msgsys:msginfo_msgseg is the total number of bytes available on the system for messages. Increasing this value can increase performance, especially for the load utility (try 64).

msgsys:msginfo_msgseg is the number of message segments configured on the system. Each message is normally broken into multiple segments by the OS. The current maximum value is 32,767.

msgsys:msginfo_msgmap is the number of entries in the message map. It should be set to msgsys:msginfo_msgtql+2.

msgsys:msginfo_msgmni is the maximum number of message queues on the system. Up to five message queues are required for each active database. The DB2 load utility also uses a variable number of message queues (at least one per index on a table being loaded).

msgsys:msginfo_msgtql is the maximum number of individual messages outstanding on the system. The DB2 load utility, in particular, sends a large number of small messages. If a load hangs unexpectedly, try doubling this parameter.

For IPC semaphores

semsys:seminfo_semmap is the number of entries in the semaphore map. It should be set to semsys:seminfo_semmns + 2.

semsys:seminfo_semmni is the number of System V semaphore sets available on the system. Each DB2 engine process and local application requires a semaphore set.

semsys:seminfo_semmns is the number of System V semaphores available on the system. Each semaphore set used by DB2 consists of two semaphores on average. Set this to twice the value of semsys:seminfo_semmni.

semsys:seminfo_semmnu is the number of undo structures available on the system. Each DB2 semaphore potentially requires an undo structure. Set this to the value of semsys:seminfo_semmns.

semsys:seminfo_semume is the number of undo structures per process. It must be at least five.

For IPC shared memory

shmsys:shminfo_shmmax is the maximum size of a single shared memory segment. The recommended value is 90 percent of the size of the physical RAM in bytes. Note that this has no bearing on the actual amount of RAM consumed by DB2; it only limits the maximum buffer pool size you can configure. Buffer pools will be reviewed in Chapter 4, “Creating Database Objects.”

shmsys:shminfo_shmmni is the maximum number of shared segments available on the system. DB2 requires up to three segments per active database, plus one per local application, plus up to three per database instance.

shmsys:shminfo_shmseg is the maximum number of shared segments that a single process may attach to. Currently, a DB2 engine-side process may require up to seven segments.

Because systems and requirements vary, and the resources necessary for proper system utilization can be different based on local policies and applications, a tool is provided to recommend a starting point for kernel settings. Shipped with DB2 is db2osconf, a utility that will analyze your system and suggest a starting point for /etc/system kernel values. The utility can accept various input options to calculate the values based on something other than the full system.

Command Syntax for db2osconf

To get the list of currently supported options, simply enter db2osconf –h, as illustrated in Figure 2.3.

02fig03.jpgFigure 2.3. db2osconf –h Output

For a complete description of these parameters, review the DB2 manuals.

The following section provides an example of how to use db2osconf.

Example Usage of db2osconf

Here is a sample output produced by running the tool with the -t switch set for 500 threads.

The results received are machine-specific, so the results you receive will vary depending on your Solaris environment.

db2osconf -t 500
   set msgsys:msginfo_msgmax = 65535
   set msgsys:msginfo_msgmnb = 65535
   set msgsys:msginfo_msgssz = 32
   set msgsys:msginfo_msgseg = 32767
   set msgsys:msginfo_msgmap = 2562
   set msgsys:msginfo_msgmni = 2560
   set msgsys:msginfo_msgtql = 2560
   set semsys:seminfo_semmap = 3074
   set semsys:seminfo_semmni = 3072
   set semsys:seminfo_semmns = 6452
   set semsys:seminfo_semmnu = 3072
   set semsys:seminfo_semume = 600
   set shmsys:shminfo_shmmax = 2134020096
   set shmsys:shminfo_shmmni = 3072
   set shmsys:shminfo_shmseg = 600
   Total kernel space for IPC:
   0.35MB (shm) + 1.77MB (sem) + 1.34MB (msg) == 3.46MB

The recommended values for set semsys:seminfo_semume and set shmsys:shminfo_shmseg were the additional values provided by running db2osconf -t 500.

Setting Kernel Parameters

To set a kernel parameter, add a line at the end of the /etc/system file as follows:

set parameter_name=value

For example, to set the value of the msgsys:msginfo_msgmax parameter, add the following line to the end of the /etc/system file:

set msgsys:msginfo_msgmax=65535

The simplest way to set kernel parameters is either to cut and paste the output of db2osconf to the end of your /etc/system file or to pipe the output of the tool to a file, then cat that file to the end your /etc/system file. As the tool calculates and displays some memory totals for IPC shared memory, you will need to remove that information or comment it out if you cat the file to the end of your system file. You need to reboot your machine after the values of the kernel configuration parameter are changed. Remember that if there are multiple occurrences of the same parameter in the /etc/system, the last one will override the others, so insure that the DB2 values are at the end of the file.

Considerations for Kernel Configuration Parameters

db2osconf provides suggestions for the kernel configuration parameters that are a good start. However, you may need to increase the value for some of the kernel parameters depending on your environment, especially if you are running multiple applications on your system.

First, determine how many IPC messages, IPC shared memory, and IPC semaphores will be needed, and what the values for semsys:seminfo_semmni, msgsys:msginfo_msgmni, and shmsys:shminfo_shmmni should be.

IPC message queues

Seven message queues used when issuing a db2start command, plus one more if intra-partition parallelism is enabled by setting the DBM configuration parameter INTRA_PARALLEL to yes. The db2start command starts the DB2 instance. The DB2 instance and DBM configuration parameter will be explained later.

Two message queues used per active database.

One message queue used per I/O server process. The number of I/O server processes is determined by the DB configuration parameter NUM_IOSERVERS. The number is three per database by default.

One message queue used per connected application only if intra-partition parallelism is enabled by setting the DBM configuration parameter INTRA_PARALLEL to yes.

Three message queues used for each active DB2 command line processor session. The DB2 command line processor will be explained later.

IPC shared memory

Two shared memory segments used when issuing a db2start command, plus one more if intra-partition parallelism is enabled by setting the DBM configuration parameter INTRA_PARALLEL to yes.

One shared memory segment used per active database.

One shared memory segment used per connected application only if intra-partition parallelism is enabled by setting the DBM configuration parameter INTRA_PARALLEL to yes.

One shared memory segment used per connected local application.


Five semaphores used when issuing a db2start command.

Two semaphores used per active database.

One semaphore used per I/O server and I/O cleaner process. The number of I/O server processes and I/O cleaner processes is determined by the DB configuration parameters NUM_IOSERVERS and NUM_IOCLEANERS. The total number of them is four per database by default.

One semaphore used per connected local application.

One semaphore used per DB2 agent or subagent process. One DB2 agent process is forked per connection by default if the DBM configuration parameter INTRA_PARALLEL is set to no. If INTRA_PARALLEL is set to yes, then estimate the degree of parallelism plus one per connection. You can choose the degree of parallelism or let the system do it for you. For detailed information about the degree of intra-partition parallelism, see the online documentation. When you count the DB2 agent processes, you must also count DB2 agents in the idle pool. This number can be the same as the value of the DBM configuration parameter NUM_POOLAGENTS in maximum use.

The following are the other guidelines used to determine the values of the kernel configuration parameters:

msgsys:msginfo_msgmap = msgsys:msginfo_msgmni + 2:
   semsys:seminfo_semmap = semsys:seminfo_semmni + 2
   semsys:seminfo_semmns = semsys:seminfo_semmni * 2
   semsys:seminfo_semmnu = semsys:seminfo_semmns

In all cases, you should consider the output of the db2osconf utility first, and only use other values with careful consideration. Consult your Solaris System Administrator, and make sure to allow for multiple applications running on the same system.

Threaded application support

Multi-threaded applications that open multiple database connections may encounter problems if more than 10 connections are opened from the same process. Two Solaris kernel configuration parameters may need to be updated to work around this situation: shmsys:shminfo_shmseg and semsys:seminfo_semume.

As already explained, shmsys:shminfo_shmseg is the number of shared memory segments that a single process may attach to. Each local database connection requires one shared segment; so, this setting must be at least as high as the total number of connections you wish to establish from a single process. The recommended kernel parameter settings provided by the sample file already suggest a value for this parameter that should be adequate for most circumstances.

semsys:seminfo_semume is the number of semaphore undo structures that a single process may have. Each local database connection requires one of these; so, this setting must also be at least as high as the total number of connections you wish to establish from one process. The default Solaris value for this parameter is 10. Since no internal part of DB2 UDB requires a larger setting, there is no recommended setting for this parameter in the DB2 UDB documentation. If more than 10 local connections are required from a single process, this value should be updated. This would be a setting to review if your Web server or application is on the same machine as the database.

Setting up SWAP Space

You need to allocate adequate paging (SWAP) spaces on your Solaris machine. On Solaris systems, the following command displays the amount of real memory in MB on your system:

prtconf | grep Memory

The following command displays the amount of paging spaces:

swap -s

Figure 2.4 demonstrates the use of these two commands:

02fig04.jpgFigure 2.4. Determining System Memory and SWAP Space

Each field of the swap –s output means:

allocated— The total amount of SWAP space currently allocated for use as backing store.

reserved— The total amount of SWAP space not currently allocated, but claimed by memory mappings for possible future use.

used— The total amount of SWAP space that is either allocated or reserved.

available— The total SWAP space that is currently available for future reservation and allocation.

For performance reasons, the amount of paging space must be adequate on your machine, and you need to increase it in some cases. Here is a rule of thumb:

Start with the same amount of SWAP space as physical memory.

Monitor your usage closely, and review your requirements with your Solaris System Administrator.

You should have a minimum of 1 GB of SWAP no matter how small your machine is.

If the amount of SWAP space is less than the size of the system memory, add more by using the swap -a command, as shown in the following example:

swap -a /dev/dsk/c0t1d0s1

Replace /dev/dsk/c0t1d0s1 with the name of an available disk partition that you wish to use for SWAP space.

Then, add the following entry in /etc/vfstab so that the SWAP space will be activated automatically each time the system is rebooted:

/dev/dsk/c0t1d0s1 - - swap - no –

Your Solaris System Administrator will probably want to do this, and you need to insure that he or she is aware of your need for SWAP.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020