Setting up a partitioned database environment

This topic describes how to set up a partitioned database environment. You will use the Db2 Setup wizard to install your instance-owning database server and to create the response files that will in turn be used to create your participating database servers.

Before you begin

Note: A partitioned database environment is not supported in non-root installations.
  • Ensure that you have the Db2® Warehouse Activation CD license key that will need to be copied over to all participating computers.
  • The same number of consecutive ports must be free on each computer that is to participate in the partitioned database environment. For example, if the partitioned database environment will be comprised of four computers, then each of the four computers must have the same four consecutive ports free. During instance creation, a number of ports equal to the number of logical partitions on the current server will be reserved in the /etc/services on Linux® and UNIX and in the %SystemRoot%\system32\drivers\etc\services on Windows. These ports will be used by the Fast Communication Manager. The reserved ports will be in the following format:
       DB2_InstanceName
       DB2_InstanceName_1
       DB2_InstanceName_2
       DB2_InstanceName_END

    The only mandatory entries are the beginning (DB2_InstanceName) and ending (DB2_InstanceName_END) ports. The other entries are reserved in the services file so that other applications do not use these ports

  • To support multiple participating Db2 database servers, the computer on which you want to install Db2 must belong to an accessible domain. However, you can add local partitions to this computer even though the computer doesn't belong to a domain.

  • On Linux and UNIX systems, a remote shell utility is required for partitioned database systems. Db2 database systems support the following remote shell utilities:
    • SSH
    • rsh

    Starting from Db2 version 11.5.6, database systems use SSH when executing commands on remote Db2 nodes, such as starting a remote Db2 database partition. For versions prior to version 11.5.6, rsh is the default protocol.

    To use the Db2 default, the ssh-server package must be installed. For more information about security issues when installing Db2 database products, see the Related Links.

    If you choose to use the less secure rsh remote shell utility, inetd (or xinetd) must be installed and running as well. If you choose to use the rsh remote shell utility, you need to set the DB2RSHCMD registry variable immediately after the Db2 installation is complete. If this registry variable is not set, SSH is used.

  • On Linux and UNIX operating systems, ensure the hosts file under the etc directory does not contain an entry for 127.0.0.2 if that IP address maps to the fully qualified hostname of the machine.

About this task

A database partition is part of a database that consists of its own data, indexes, configuration files, and transaction logs. A partitioned database is a database with two or more partitions.

Procedure

  1. Set up your partitioned database environment using one of the two options:
    1. Option 1: using the db2setup - response file
      1. Install your instance-owning database server using the Db2 Setup wizard. For detailed instructions, see the appropriate Installing Db2 servers topic for your platform.
        • On the Select installation, response files creation, or both window, ensure that you select the Save my installation settings in a response files option. After the installation has completed, two files will be copied to the directory specified in the Db2 Setup wizard: db2server.rsp and db2server_addpart.rsp. The db2server.rsp file is the response file for instance-owning database servers. The db2server_addpart.rsp file is the response file for participating database servers.
        • On the Set up partitioning options for the Db2 instance window, ensure that you select Multiple partition instance, and enter the maximum number of logical partitions.
      2. Make the Db2 install image available to all participating computers in the partitioned database environment.
      3. Use db2server.rsp file to install the database product on one machine by running db2setup -r <path_to_db2server.rsp>. After the installation has completed, it will have installed the database product on the machine and created an instance.
      4. The following step will depend on your platform:
        Linux and UNIX
        Go to the directory where the Db2 database product code is available and run:
        ./db2setup -r /<responsefile_directory>/<response_file_name>
        For example, the command can look like this using db2server.rsp as the response file:
        ./db2setup -r /home/db2server.rsp
        where /home is the directory where you have copied the response file.
        Windows
        Run the following:
        setup -u x:\<responsefile_directory>\<response_file_name>
        For example, the command can look like this using db2server.rsp as the response file:
        setup -u c:\resp_files\db2server.rsp
        where c:\resp_files\ is the directory where you have copied the response file.
      5. Distribute the participating database servers response file (db2server_addpart.rsp).
      6. Install a Db2 database server on each of the participating computers using the db2setup command on Linux and UNIX, or the setup command on Windows:
        Linux and UNIX
        Go to the directory where the Db2 database product code is available and run:
        ./db2setup -r /<responsefile_directory>/<response_file_name>
        For example, the command can look like this using db2server_addpart.rsp as the response file:
        /db2setup -r /home/db2server_addpart.rsp
        where /home is the directory where you have copied the response file.
        Windows
        Run the following command:
        setup -u x:\<responsefile_directory>\<response_file_name>
        For example, the command can look like this using db2server_addpart.rsp as the response file:
        setup -u c:\resp_files\db2server_addpart.rsp
        where c:\resp_files\ is the directory where you have copied the response file.
    2. Option 2: using db2_install (UNIX only)
      1. Issue the db2_install command on all the participating machines in the partitioned database environment.
      2. On one machine, issue the db2icrt command to create the instance.
  2. (Linux and UNIX only) Configure the db2nodes.cfg file. The Db2 installation only reserves the maximum number of logical partitions you want to use for the current computer, but does not configure the db2nodes.cfg file. If you do not configure the db2nodes.cfg file, the instance is still a single partitioned instance.
  3. Update the services file on the participating servers to define the corresponding FCM port for the Db2 instance.
    The services file is in the following location:
    • /etc/services on Linux and UNIX
    • %SystemRoot%\system32\drivers\etc\services on Windows
  4. For partitioned database environments on Windows 2000 or later, start the Db2 Remote Command Service security feature to protect your data and resources.

    To be fully secure, start either the computer (if the service is running under the context of the LocalSystem account) or a user for delegation (if the service is being run under the logon context of a user).

    To start the Db2 Remote Command Service security feature:

    1. Open the Active Directory Users and Computers window on the domain controller, click Start and select Programs > Administrative tools > Active Directory Users and Computers
    2. In the right window panel, right-click the computer or user to start, select Properties
    3. Click the General tab and select the Trust computer for delegation check box. For user setting, click the Account tab and select the Account is trusted for delegation check box in the Account option group. Ensure that the Account is sensitive and cannot be delegated box has not been checked.
    4. Click OK to start the computer or user for delegation.

    Repeat these steps for each computer or user that needs to be started. You must restart your computer for the security change to take effect.