Creating non-root thin server instances (Linux and AIX)

You can create non-root thin server instances locally on a code server and on a remote server in a thin server instance environment.

Before you begin

Procedure

To create non-root thin server instances:

  1. Set up a thin server instance environment on the code server as a non-root user. For example, db2inst1. For more information, see Setting up a thin server instance environment (Linux and AIX).
  2. Create non-root thin server instances by performing one of the following set of substeps:
    • To create another non-root thin server instance locally on the code server, perform the following substeps:
      1. Log in to the code server as another non-root thin server instance user. For example, db2inst2.
      2. Access the read-only copy of the Db2 installation path that is exported from the code server. For example, /home/db2inst1/sqllib, where db2inst1 is the non-root user who owns the Db2 installation on the code server, and /home/db2inst1 is the home directory of the non-root instance owner.
      3. Set the library path in one of the following ways:
        • On Linux® operating systems, issue the following command:
          export LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib/:/home/db2inst1/sqllib/instance/native/install:$LD_LIBRARY_PATH
        • On AIX® operating systems, issue the following command:
          LIBPATH=/home/db2inst1/sqllib/lib/:/home/db2inst1/sqllib/instance/native/install:$LIBPATH
          export LIBPATH
          where, /home/db2inst1/sqllib is the read-only copy of the Db2 installation path that is exported from the code server.
      4. Change directory to the instance directory:
        cd /home/db2inst1/sqllib/instance
      5. Run the db2icrt command:
        ./db2icrt 
      6. To enable root-based features for the non-root thin server instance on code server, perform the following substeps:
        1. Log in to the code server as a root user.
        2. Copy the following configuration file to /tmp or another local directory.
          /home/db2inst1/sqllib/instance/db2rfe.cfg
        3. Edit the copied db2rfe.cfg configuration file to update the SVCENAME and SET_ULIMIT parameters. This configuration file is input to the db2rfe command. The following parameters are available in thedb2rfe.cfg file:
          INSTANCENAME
           SET_ULIMIT (* AIX only)
          ENABLE_OS_AUTHENTICATION
            RESERVE_REMOTE_CONNECTION
              SVCENAME
              SVCEPORT
            RESERVE_TEXT_SEARCH_CONNECTION
              SVCENAME_TEXT_SEARCH
              SVCEPORT_TEXT_SEARCH
        4. Export the local directory by issuing the following command:
          DB2LOCAL=/home/db2inst2/sqllib
          export DB2LOCAL
          where /home/db2inst2 is the home directory of the user db2inst2 who owns the local instance on the code server.
        5. Issue the db2rfe command as shown, specifying the copied db2rfe.cfg file:
          ./db2rfe -f /tmp/db2rfe.cfg
    • To create a non-root thin server instance on the remote server, perform the following substeps:
      1. As a root user, mount the thin server instance on the remote server as a read-only file system. For more information, see Mounting a thin server instance (Linux and AIX).
      2. Log in to the remote server as a non-root instance owner. For example, db2inst3
      3. Set the library path in one of the following ways:
        • On Linux operating systems, issue the following command:
          export LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib/:/home/db2inst1/sqllib/instance/native/install:$LD_LIBRARY_PATH
        • On AIX operating systems, issue the following command:
          LIBPATH=/home/db2inst1/sqllib/lib/:/home/db2inst1/sqllib/instance/native/install:$LIBPATH
          export LIBPATH
          where, /home/db2inst1/sqllib is the read-only copy of the Db2 installation path that is exported from the code server.
      4. Change directory to the instance directory:
        cd /home/db2inst1/sqllib/instance
      5. Run the db2icrt command:
        ./db2icrt 
      6. To enable root-based features for the non-root thin server instances on remote server, perform the following substeps:
        1. Log in to the remote server as a root user.
        2. Copy the following configuration files to /tmp or another local directory:
          • /home/db2inst1/sqllib/instance/db2rfe
          • /home/db2inst1/sqllib/instance/db2rfe.cfg
        3. Edit the copied db2rfe.cfg configuration file to update the SVCENAME and SET_ULIMIT parameters. This configuration file is input to the db2rfe command. The following parameters are available in thedb2rfe.cfg file:
          INSTANCENAME
          SET_ULIMIT (* AIX only)
          ENABLE_OS_AUTHENTICATION
            RESERVE_REMOTE_CONNECTION
              SVCENAME
              SVCEPORT
            RESERVE_TEXT_SEARCH_CONNECTION
              SVCENAME_TEXT_SEARCH
              SVCEPORT_TEXT_SEARCH
        4. Export the local directory by issuing the following commands:
          DB2LOCAL=/home/db2inst3/sqllib
          export DB2LOCAL
          where,/home/db2inst3 is the home directory of the user db2inst3 who owns the local instance on the remote server.
        5. Issue the db2rfe command as shown, specifying the copied db2rfe.cfg file:
          ./db2rfe -f /tmp/db2rfe.cfg