Changing the development database type by using the setdbtype command

After you install HCL Commerce Developer, you must run the setdbtype command to point your HCL Commerce Developer Version 9.0 environment to your development database.

Note: When you specify a database password, make sure that it meets the naming restrictions for HCL Commerce databases. If restricted characters are used in database passwords, you might encounter connection errors when you use utilities that take these passwords as input on the command line, including setdbtype.

Before you begin

  • Verify your database version:
  • Ensure that the database that you are switching to exists on your network.
  • If you are using a remote database, install the appropriate IBM Db2 client to access the remote IBM Db2 database.
  • When you specify an IBM Db2 password, make sure that it meets the naming restrictions for HCL Commerce databases. If restricted characters are used in database passwords, you might encounter connection errors when you use utilities that take these passwords as input on the command line, including setdbtype.

Procedure

  1. Stop the HCL Commerce Test Server.
  2. Stop the HCL Commerce development database.
  3. Go to the WCDE_installdir\bin directory.
  4. Oracle If you are using Oracle Database, complete the following steps:
    1. Copy the Oracle Java Database Connectivity (JDBC) driver from the Oracle database server
      1. Create a directory \lib\oracle\jdbc\lib\ within the HCL Commerce Developer installation directory.
      2. Copy ojdbc8.jar to the \lib\oracle\jdbc\lib\ directory.
    2. If you are using Oracle Database 19C with a version of HCL Commerce prior to 9.0.1.9, add the following line to your WCDE_installdir\lib\ToolkitConfiguration.jar\ToolkitConfigure.properties file.
      ORACLE_19_DATASOURCE_HELPER=com.ibm.websphere.rsadapter.Oracle11gDataStoreHelper
  5. Run the following command to switch to your restored database.

    setdbtype.bat dbType DRIVER_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword dbHost dbServerPort

    Where:
    dbType
    The type of the database. The value can be db2 or oracle.
    DRIVER_HOME
    The root directory of the database driver that is included with HCL Commerce Developer. The root directory for the Db2 database is WCDE_installdir\lib\db2. The root directory for the Oracle database is WCDE_installdir\lib\oracle. If the path contains whitespace characters, surround the path in quotation marks (").
    dbName
    The name of the database you want to use with HCL Commerce Developer. If this is the first time you are switching databases, enter the name you want to give the database that will be created.
    dbAdminID
    The database administrator ID.
    dbAdminPassword
    The database administrator password.
    dbUserID
    The database user ID (schema owner).
    dbUserPassword
    The database user password.
    dbHost
    The fully qualified host name of the database server. If you are using a local database, you can use localhost.
    dbServerPort
    The port number on the database server that is used for connections. The default port for IBM Db2 is 50000. The default port for Oracle is 1521..
    DB2To check the port number for the IBM Db2 database:
    1. If you are using a remote database, connect to the remote host. If you are using a local database, continue on your local machine.
      • Open an IBM Db2 command line by running the db2cmd program.
    2. Issue db2 get dbm cfg and look for the value of SVCENAME on a line similar to the following sample:
      TCP/IP Service name (SVCENAME) = db2c_DB2
      If the value is numeric, then use the numeric value. If the value is not numeric, as in the example that is provided, find the port value within the %SystemRoot%\system32\drivers\etc\services directory, where %SystemRoot% is the folder where Windows is installed.
      Search for db2c_DB2 and find a line similar to the following.
      db2c_DB2 50000/tcp
      In this example, the value for dbServerPort is 50000.

    OracleTo check the port for the Oracle database, go to the oracle_home/network/admin/ directory. You can find the port number in the listener.ora file.

    For example,
    • For an IBM Db2 database:
      setdbtype.bat db2 W:\WCDE_V9\lib\db2 mall db2AdminID dbAdminPassword dbUserID dbUserPassword localhost 50000
      
    • For an Oracle database:
      setdbtype.bat oracle W:\WCDE_V9\lib\oracle orcl oracleAdminID oracleAdminPassword dbUserID dbUserPassword localhost 1521
      
    Note: The setdbtype command takes approximately 15 minutes to complete.
  6. Verify that the script ran successfully by checking that the string BUILD SUCCESSFUL is printed at the end of the WCDE_installdir/logs/setdbtype.log log file.

Results

HCL Commerce Developer on your HCL Commerce development environment is configured to connect to your development database.