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.1 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:
- Use IBM Db2 as your database. For version information, see Installing an IBM Db2 database.
- Use Oracle as your database. For version information, see Installing and configuring Oracle Database.
- 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
- Stop the HCL Commerce Test Server.
- Stop the HCL Commerce development database.
- Go to the WCDE_installdir\bin directory.
-
If you are using Oracle Database, complete the following steps:
- Copy the Oracle Java Database Connectivity (JDBC) driver from the Oracle database server
- Create a directory \lib\oracle\jdbc\lib\ within the HCL Commerce Developer installation directory.
- Copy ojdbc8.jar to the \lib\oracle\jdbc\lib\ directory.
- 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
- Copy the Oracle Java Database Connectivity (JDBC) driver from the Oracle database server
-
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 is1521
..To check the port number for the IBM Db2 database:- 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.
- Issue
db2 get dbm cfg
and look for the value of SVCENAME on a line similar to the following sample:
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.TCP/IP Service name (SVCENAME) = db2c_DB2
Search fordb2c_DB2
and find a line similar to the following.
In this example, the value for dbServerPort isdb2c_DB2 50000/tcp
50000
.
To 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.
- If you are using a remote database, connect to the remote host. If you are using a
local database, continue on your local machine.
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. -
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.