Table of contents

Installing Db2 servers 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 additional functionality.

Before you begin

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 non-root authority. For more information about non-root installation, see Non-root installation overview (Linux and UNIX). When Ubuntu Linux 18.04 LTS is installed, root login is disabled by default. Follow these steps to enable root user access:
    1. From the terminal window, enter this 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 new password for the root user when the prompt
      Enter new Unix Password is displayed. Re-enter the same password in the next prompt.
    You should see this message:
    passwd: password updated successfully
    If this message is not displayed, go through the steps again, making any corrections 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
    For 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 machine:

  • Ubuntu Linux 18.04 LTS (Desktop)* – The latest long-term support (LTS) version of the Ubuntu Linux operating system.
  • Db2 Community Edition Version 11.5.0.0 – Free, fully functional version of Db2 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, written in Perl. (Takes care of everything regarding Syslog communication; provides one function for each of the following Syslog message levels: debug, info, warning, error, notice, critical, and alert.)
  • zlib1g-dev – A shared Linux library that implements the deflate compression method 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. Open a terminal window if you do not already have one open.
  2. Run the command su - root.
  3. When the Password prompt is displayed, provide the password you created for the root user earlier. The command line prompt should change 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 have more than one instance of the Db2 Setup wizard running 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.

To install Db2 Community Edition on a Linux machine:

  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 pop-up box.
    You can now extract the downloaded software and install Db2 Community Edition on your machine.
  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 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 and untar 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 sub-directory (server_dec) accessible to everyone, then run the following commands to rename the sub-directory to ibm-db2:
    rm -f v*.tar
    chmod 777 server_dec
    mv server_dec ibm-db2
  13. Move to the /home/software/ibm-db2 directory and run the following commands to verify that the server has everything needed 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 identified.
  14. Run the command ./db2setup to load and start the Db2 Setup/Installation 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 check box and then click Next.
  17. Enter a password for the Db2 instance owner (db2inst1). The instance owner username and password provided is the user ID and password you will use to work 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 using 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 non-root installations, Db2 database products are always installed in the $HOME/sqllib directory, where $HOME represents the non-root 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 you have 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 installation log files are:
  • 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 non-root installations, the Db2 setup log file name is db2setup_username.log, where username is the non-root user ID under which the installation was performed.
  • 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 non-root installations, the Db2 error log file name is db2setup_username.err, where username is the non-root user ID under which the installation was performed.

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

There is no longer a db2setup.his file. 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 machine.

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 aborted before completion, the history file will not be created.

What to do next

  • Verify your installation.
  • Perform the necessary post-installation tasks.

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

On Linux x86, if you want your Db2 database product to have access to Db2 documentation either on your local computer or on another computer on your network, then you must install the Db2 Information Center. The Db2 Information Center contains documentation for the Db2 database system and Db2 related products.