Installing and configuring an IBM Db2 database

Install DB2 Enterprise Edition 12.1.x Multiplatform Multilingual package to serve as your database.

Before you begin

Obtain the necessary software and images for IBM Db2 and Docker from the IBM website. HCL does not distribute or provide IBM Db2 software, licenses, or Docker images.

Follow these steps to download the required software:

  1. Log in to the My HCLSoftware portal(MHS) website.
  2. Download the DB2 Enterprise Edition 12.1.x Multiplatform Multilingual package package.
  3. Ensure that you have the necessary license entitlement certificates for activation.

Procedure

Use the following steps to install Db2.

  1. Run the installer for your operating system (Linux, UNIX, or Windows). Follow the installation wizard or command-line instructions provided by IBM.
  2. Apply the license entitlement certificate included in the downloaded package. For more information, see Applying Db2 licenses.

Preparing an IBM Db2 Database for HCL Commerce

Before using Db2 with Commerce+, you need to prepare the database. This step is essential for preparing the IBM Db2 database database to work with Commerce+. The create_database.sh script automates the creation and configuration of the database, including setting up the necessary schemas, tables, and user permissions. Without executing this step, the database will not be properly initialized, and Commerce+ will be unable to store or retrieve critical data, rendering the platform non-functional.

  1. Create a dedicated system user account named (by default, wcs) to manage the database. You will use this account will to load the database schema and bootstrap data for Commerce+.
  2. Run the create_database.sh Script.
    1. Copy the script from the Utility server Docker container to the machine running the Db2 server.
      • Copy the database setup script from the Utility server container to a temporary location on the host system:
        docker cp utility_container_name:/opt/CommerceUtilities/dbsetup/create_database.sh /path/to/destination/
        
      • Copy the script from the host system to the Db2 container:
        docker cp /path/to/destination/create_database.sh db2_container_name:/.
    2. Enter the Db2 container and make the script executable:
      docker exec -it db2_container_name bash 
      chown db2inst1:db2inst1 create_database.sh        
      chmod +x create_database.sh
      mv create_database.sh /home/db2inst1/.
      
    3. Switch to the Db2 administrator user and run the script to create the database:
      su - db2inst1 
      ./create_database.sh dbName dbaUser dbaPassword dbUser
      
      Where:
      dbName
      The name of the database you want to create. By default Commerce+, loads data into a database table named mall. If you use a different name, you must specify the dbName in later steps.
      dbaUser
      The database administrator username.
      dbaPassword
      The password for the database administrator.
      dbUser
      The name of the database user. By default, Commerce+ uses the username wcs to connect to the database. If your database user account is different, you must specify the username in later steps.
      bash 
      ./create_database.sh mall db2inst1 myunguessablepassword wcs 
      Note: If you use a different database name or username than the defaults (mall and wcs, respectively), you will need to configure these settings in later steps, particularly when building custom Docker images for Commerce+.
    4. Ensure that you back up the database after creating it.

Results

The DB2 Enterprise Edition 12.1.x Multiplatform Multilingual package is now configured and ready for use by Commerce+.