Installing Db2 on AIX or Linux

You can install Db2® as a root user or non-root user on an AIX® or Linux® operating system by using the Db2 Setup program. To install Db2 as a non-root user, the user must have sudo privileges on the target AIX or Linux server.

Before you begin

The X Window System is required on the AIX or Linux server to install Db2 by using the installation program.

If you want to install Db2 as a non-root user, have your system administrator complete the following tasks on the target server before you begin the installation:
  • If you are installing Db2 on an AIX server, install sudo on the server. The default AIX distribution does not include sudo. To get the sudo installation package, go to https://ibm.biz/BdftKL. Find sudo-version in the Package column, and click RPM to download the package.
  • Ensure that the non-root user has sudo privileges for the following commands on the server:
    • xauth (Enables the non-root user to provide access to their X Window System display for the root user.)
    • db2setup (Enables the non-root user to launch the Db2 installation program.)
    You must enter the full path to the commands when you configure the sudo privileges. For example:
    username	ALL=(root)	SETENV: /usr/bin/xauth,/home/username/Downloads/DB2/server_dec/db2setup
  • Ensure that the following requirements are met to enable the installation of Db2 by using the Setup program:
    • The non-root user is able to use the X Window System on the target server and the X Window System DISPLAY environment variable is set correctly for the not-root user.
    • The DISPLAY environment variable is preserved in the sudo environment.
    • The root user has access to the X Window System display that is owned by the non-root user.
    These display requirements do not apply if you install Db2 in silent mode.
  • If you are installing Db2 on an AIX server, ensure that the ODMDIR environment variable is preserved in the sudo environment.

Procedure

  1. Log on to the target server as the root user or as a non-root user who has sudo privileges.
  2. Use an extraction tool to extract the installation image files on the server.
  3. In a command shell, change the directory to the location of the Db2 installation program db2setup, and then enter one of the following commands:
    Root user
    ./db2setup
    Non-root user
    sudo ./db2setup
  4. On the Db2 Setup Welcome page, click New Install.
  5. On the Choose a Product page, select Db2 11.5.9.0 Server Editions and click Next.
  6. On the Configuration page:
    1. Enter an installation directory or accept the default.
    2. Select Typical as the installation type.
    3. Select Create an instance.
    4. Review and agree to the IBM® terms.
    5. Click Next.
  7. On the Instance Owner page, select New user, and enter the following information:
    1. User name

      Db2 adds this user ID to the db2iadm1 group, and if this user ID does not exist, Db2 creates it.

    2. Group name
    3. Password
    4. Home directory

      The Db2 instance owner user is the user that you enter when you install IBM Spectrum Control.

  8. Select Use default UID and Use default GID, and click Next.
  9. On the Fenced User page, select New user, and enter the following information:
    1. User name

      Db2 adds this user ID to the db2fadm1 group, and if this user ID does not exist, Db2 creates it.

    2. Group name
    3. Password
    4. Home directory

      The fenced user is used to run user-defined functions and stored procedures that are separate from the address space that is used by the Db2 database.

  10. Select Use default UID and Use default GID, and click Next.
  11. On the Response File and Summary page:
    1. Select Install Db2 Server Edition on this computer and save my settings in a response file.
    2. Enter a response file name or accept the default.
    3. Review the Summary and click Finish.
  12. On the Setup has completed successfully page, review the information, and click Finish.

What to do next

To ensure that Db2 starts when the server starts, run the db2iauto command.
Root user
DB2_installation_directory/bin/db2iauto -on DB2_instance_name
Non-root user
sudo DB2_installation_directory/bin/db2iauto -on DB2_instance_name
Where DB2_installation_directory is the location of Db2 and DB2_instance_name is the instance that you created when you installed Db2. The default instance name is db2inst1.