DB2

Preparing an IBM Db2 database for use with HCL Commerce

You need to use a script to prepare an IBM Db2 database for use with HCL Commerce.

Before you begin

  1. Ensure that you have an IBM Db2 Database server ready for use. For information, see Using an IBM Db2 database.
  2. Create a database user (dbuser). For example, wcs. By default, the HCL Commerce Docker containers use the specific username wcs to connect to the database. If your dbuser account is different, you need to set the username in later steps. In particular, this topic, Building custom Docker images for use with an Oracle database.
  3. WindowsInitialize variable to support running Db2 commands in the Windows command line.
  4. Ensure that you have access to a running Utility server Docker container.

Procedure

  1. Copy the create_database_db2.sh script from the Utility server Docker container to the machine that is running the IBM Db2 server.
    1. Use the docker cp command to copy from the container to your local filesystem.
      For example,
      docker cp <project_name>_utils_1:/opt/WebSphere/CommerceServer90/bin/create_database_db2.sh /var/tmp/create_database_db2.sh
    2. If you are using a remote IBM Db2 server, transfer the create_database_db2 script from your remote IBM Db2 server into a directory that a database administrator can access.
  2. Linux Add execute permissions to be able to run the script.
    chmod +x create_database_db2.sh
  3. Log on as a system administrator or database administrator.
  4. Open a command line interface.
    WindowsNote: Open the IBM Db2 command line processor (db2cmd.exe). If the command line processor automatically displays the db2> prompt, enter quit to exit.
  5. Go to the create_database_db2 script.
  6. Run the script to create a database.
    • Linux
      ./create_database_db2.sh <dbName> <dbaUser> <dbaPassword> <dbUser> 
    dbName
    The name of the database that you want to create.
    By default, the HCL Commerce Docker containers load to a database table that is named mall. If you use a different name for the database, you need to set the dbName in later steps. In particular, in this topic, Building custom Docker images for use with an Oracle database.
    dbaUser
    The database administrator.
    dbaPassword
    The database administrator password.
    dbUser
    The name of a database user.
    By default, the HCL Commerce Docker containers use the specific username wcs to connect to the database. If your dbuser account is different, you need to set the username in later steps. In particular, in this topic, Building custom Docker images for use with an Oracle database.
    For example,
    ./create_database_db2.sh mall db2inst1 diet4coke wcs
  7. Back up the database.
    For more information about how to back up, see BACKUP DATABASE COMMAND.

Results

Your IBM Db2 is prepared for use with HCL Commerce.