Installing Db2 servers by using the Db2 Setup wizard (Linux and UNIX)

This task describes how to download and install the Db2 Community Edition for Linux® and UNIX operating systems. Db2 Community Edition is a full-featured server installation. After a three-month trial period, you can apply either a Standard or Advanced license to receive product support and extra functions.

Before you begin

Check the following items before you start the Db2 Setup wizard:
  • If you are planning on setting up a partitioned database environment, refer to the task in the related links at the bottom of the page.
  • Ensure that your system meets installation, memory, and disk requirements.
  • Ensure that you installed a supported browser.
  • You can install a Db2 database server by using either root or nonroot authority. For more information about nonroot installation, see Non-root installation overview (Linux and UNIX). When Ubuntu Linux 18.04 LTS is installed, root login is not available by default. Follow these steps to enable root user access:
    1. From a command window, enter the following command:
      sudo passwd root
    2. Enter the password for the administrative user account when the prompt
      [sudo] password for [AdminUser]: is displayed.
    3. Press ENTER.
    4. Create a password for the root user when the prompt
      Enter new Unix Password is displayed. Enter the same password in the next prompt.
    If successful, the following message displays:
    passwd: password updated successfully
    If this message is not displayed, go through the steps again, making any corrections that are suggested by the error message or messages that are returned.
  • The Db2 database product image must be available. You can obtain a Db2 installation image by downloading an installation image from Passport Advantage®.
  • If you are installing a non-English version of a Db2 database product, you must have the appropriate National Language Packages.
  • The Db2 Setup wizard is a graphical installer. To display the graphical user interface (GUI) on your local workstation, the X Window System (X11) software must be installed and running. You must also set the DISPLAY variable to the IP address of the workstation you use to install the Db2 product:
    export DISPLAY=<ip-address>:0.0
    Example
    export DISPLAY=192.168.1.2:0.0

    For more information, see this developerWorks article.

  • If you are using the security software in your environment, you must manually create required Db2 users before you start the Db2 Setup wizard.

Prerequisites

Before you begin, ensure that you have access to the following software on your server:

  • Ubuntu Linux 18.04 LTS (Desktop)* – The most recent long-term support (LTS) version of the Ubuntu Linux operating system.
  • Db2 Community Edition Version 11.5.0.0 – Available at no cost, this fully functional version of Db2 is intended for development, test, and small production environments.
  • libaio1 – Linux kernel asynchronous input/output (I/O) shared library. (Enables a single application thread to overlap I/O operations with other processing, by providing an interface for submitting one or more I/O requests in a single system call without waiting for completion.)
  • binutils – GNU Binary Utilities shared library. (A set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.)
  • liblogger-syslog-perl – An interface to the UNIX program that sends messages to the system logger and is written in Perl. This interface takes care of all Syslog communication. It provides one function for each of the following Syslog message levels: debug, informational, warning, error, notice, critical, and alert.
  • zlib1g-dev – A shared Linux library that implements the deflate compression method that is found in gzip and PKZIP.
  • libpam0g:i386 – Linux Pluggable Authentication Modules for Intel x86. (Enables the local system administrator to choose how applications authenticate users.)
  • libstdc++6:i386 – GNU Standard C++ Library, Version 3 for Intel x86. (A runtime library for C++ programs built with the GNU compiler.)

To install the newest versions of all Linux packages that are currently on the system, follow these steps:

  1. If a command window is not open already, open one.
  2. Run the command su - root.
  3. When the Password prompt is displayed, provide the password that you created for the root user earlier. The prompt for the command line changes from $ to #.
  4. Run the command apt-get upgrade to fetch and install the newest versions of all Linux packages that are currently on the system.
  5. Run the following commands to install the prerequisite Linux packages:
    apt-get -y install libaio1 
    apt-get -y install binutilsapt-get -y install zlib1g-dev
    apt-get -y install liblogger-syslog-perl
    apt-get -y install libpam0g:i386
    apt-get -y install libstdc++6:i386
  6. Run the command apt-get update to update the list of all Linux packages that are installed on the system.

Restrictions

  • You cannot concurrently run more than one instance of the Db2 Setup wizard in any user account.
  • The use of XML features is restricted to a database that is defined with the code set UTF-8 and has only one database partition.
  • The Db2 Setup wizard fields do not accept non-English characters.

Procedure

Use the Db2 Setup wizard to define your installation and install the Db2 database product on your system.

Follow these steps to install Db2 Community Edition on a Linux computer:

  1. Go to the Db2 Download page and sign in with your IBM account credentials.
  2. Choose your contact option (for example, email), review the Terms and Conditions, and click Continue.
  3. Locate the IBM® Db2 for Linux on AMD64 and Intel EM64T systems (x64) option from the Downloads page and click the associated Download now link.
  4. Choose Save File from the dialog box.
    You can now extract the downloaded software and install Db2 Community Edition on your computer.
  5. Open a terminal window.
  6. Run the command su - root.
  7. Provide the correct password for the root user when the password prompt is displayed.
  8. Create a directory that is named software in the /home directory and run the following commands to make the software directory accessible to everyone:
    mkdir /home/software
    chmod 777 /home/software
  9. Run the following command to move the downloaded file to the directory:
    mv /home/AdminUser/Download/*.gz /home/software
  10. Go to the /home/software directory and run the following commands to extract the file.
    On Linux operating systems
    cd /home/software
    gunzip *.gz
    tar -xvf v11.5_linuxx64_dec.tar
    On AIX operating systems
    cd /home/software
    gunzip *.gz
    gnutar -xvf v11.5_aix64_server.tar.gz
  11. Delete the .tar file that was created in the previous step.
  12. Make the subdirectory (server_dec) accessible to everyone, then run the following commands to rename the subdirectory to ibm-db2:
    rm -f v*.tar
    chmod 777 server_dec
    mv server_dec ibm-db2
  13. Change to the /home/software/ibm-db2 directory and run the following commands to verify that the server is ready to install and run Db2:
    cd ibm-db2
    ./db2prereqcheck -v 11.5.0.0s
    When all checks are complete, the following message is displayed:
    DBT3533I The db2prereqcheck utility has confirmed that all installation prerequisites were met.

    If this message is not displayed, review the output of the db2prereqcheck utility and resolve any problems that were identified.

  14. Run the command ./db2setup to load and start the Db2 Setup program. From the Welcome window, click New Install.
  15. Select Db2 Version 11.5.0.0 Server Editions and then click Next.
  16. Click Click to view to view the IBM terms . Click the I agree to the IBM terms checkbox and then click Next.
  17. Enter a password for the Db2 instance owner (db2inst1). The instance owner username and password that you provide is the user ID and password to use working with Db2. Click Next.
  18. Enter a password for the Db2 fenced user (db2fenc1). The fenced user is used to run user-defined functions and stored procedures outside of the address space that is used by a Db2 database. Click Next.
  19. Verify that the Install DB2 Server Edition on this computer and save my settings in a response file option is selected.
  20. Click Finish to start the Db2 installation process.
  21. When the installation process is complete, click Post-install steps.
    Carefully read the information:
    • Verify that the Db2 software was installed correctly.
    • View your Db2 license entitlements.
    • Start to use Db2.
    • Access the online Db2 documentation.
  22. Click Close.
  23. Click Log file to review the contents of the log file after control returns to the Setup Complete window.
  24. Click Close to return to the Setup Complete window. Click Finish to close the Db2 Setup installation program.

Results

For nonroot installations, Db2 database products are always installed in the $HOME/sqllib directory, where $HOME represents the nonroot user's home directory.

For root installations, Db2 database products are installed, by default, in one of the following directories:
AIX®
/opt/IBM/db2/V11.5
Linux
/opt/ibm/db2/V11.5

If you are installing on a system where this directory is already being used, the Db2 database product installation path has _xx added to it. The _xx are digits, starting at 01 and increasing, depending on how many Db2 copies that were installed.

You can also specify a custom Db2 database product installation path.

Db2 installation paths have the following rules:
  • Can include lowercase letters (a-z), uppercase letters (A-Z), and the underscore character ( _ ).
  • Cannot exceed 128 characters.
  • Cannot contain spaces.
  • Cannot contain characters that are other than English characters.
  • The path name cannot be a subdirectory of an existing Db2 installation.
  • The installation paths cannot be symbolic links.
The following files are installation log files:
  • The Db2 setup log file. This file captures all Db2 installation information, including errors.
    • For root installations, the Db2 setup log file name is db2setup.log.
    • For nonroot installations, the Db2 setup log file name is db2setup_username.log, where username is the nonroot user ID under which Db2 was installed.
  • The Db2 error log file. This file captures any error output that is returned by Java™ (for example, exceptions and trap information).
    • For root installations, the Db2 error log file name is db2setup.err.
    • For nonroot installations, the Db2 error log file name is db2setup_username.err, where username is the nonroot user ID under which Db2 was installed.

By default, these log files are located in the /tmp directory. You can specify the location of the log files.

A db2setup.his file no longer exists. Instead, the Db2 installer saves a copy of the Db2 setup log file in the DB2_DIR/install/logs/ directory, and renames it db2install.history. If the name exists, then the Db2 installer renames it db2install.history.xxxx, where xxxx is 0000-9999, depending on the number of installations you have on that computer.

Each installation copy has a separate list of history files. If an installation copy is removed, the history files under this install path are removed as well. This copying action is done near the end of the installation and if the program is stopped or fails before completion, the history file is not created.

What to do next

  • Verify your installation.
  • Follow the necessary postinstallation tasks.

National Language Packs can also be installed by running the ./db2setup command from the directory where the National Language Pack exists after you install the Db2 database product.