Change the development database type using setdbtype
After you install WebSphere Commerce Developer, we must run the setdbtype command to point the WebSphere Commerce Developer Version 9.0 environment to your restored database.Note: when specifying a database password, make sure that it meets the naming restrictions for WebSphere Commerce databases. If restricted characters are used in database passwords, we might encounter connection errors when using utilities that take these passwords as input on the command line, including setdbtype.
Before beginning
- Verify the database version:
- (DB2) Use IBM Db2 Version 11.1.2.2 or a later 11.1.x version as the database. See Installing the IBM Db2 database.
- (Oracle) Use Oracle 12c Release 2 as the database. For more information, see Install and configure Oracle 12c Release 2 database.
- Ensure that the database that we are switching to exists in your network.
- If we are using a remote database, install the appropriate DB2 client to access the remote DB2 database. See your DB2 documentation.
- when specifying a DB2 password, make sure that it meets the naming restrictions for WebSphere Commerce databases. If restricted characters are used in database passwords, we might encounter connection errors when using utilities that take these passwords as input on the command line, including setdbtype.
Procedure
- Stop the WebSphere Commerce Test Server.
- Stop the WebSphere Commerce development database.
- Go to the WCDE_installdir/bin directory.
- (Oracle) Copy Oracle JDBC driver from the Oracle database server with the following steps:
- Create a directory lib/oracle/jdbc/lib/ in the WebSphere Commerce development environment installation directory.
- Copy ojdbc8.jar to the lib/oracle/jdbc/lib/ directory.
- 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 included with WebSphere 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 we want to use with WebSphere Commerce development environment. If this is the first time we are switching databases, enter the name we 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 we are using a local database, we can use localhost.
- dbServerPort
- The port number on the database server used for connections. The default port for Db2 is 50000. The default port for Oracle is 1521. Be sure of using the right port number. (DB2) To check the port number for the Db2 database, follow these steps:
- If we are using a remote database, connect to the remote host. If we are using a local database, continue on your local machine.
- Open a 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:
TCP/IP Service name (SVCENAME) = db2c_DB2If 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 in
- (Windows) %SystemRoot%\system32\drivers\etc\services, where %SystemRoot% is the folder where Windows is installed
Search for db2c_DB2 and find a line similar to the following sample:
- db2c_DB2 50000/tcp
In this case, the value for dbServerPort is 50000.
(Oracle) To check the port for the Oracle database, go to the oracle_home/network/admin directory. We can find the port number in the listener.ora file.
For example,
- For a Db2 database:
setdbtype.bat db2 W:\WCDE_V9\lib\db2 mall db2AdminID dbAdminPassword dbUserID dbUserPassword localhost 50000
For 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.