Setup the DBClean Utility on Your WebSphere Commerce v7 Toolkit

Setup the DBClean Utility on Your WebSphere Commerce v7 Toolkit

For those who have worked with WebSphere Commerce v7.0, developer toolkit installations do not contain or provide a copy of the DBClean utility. If you want to leverage, test, or develop for the DBClean utility you need to enable the utility to run within your toolkit environment.

NOTE: Developer toolkit installations only contain a minimum amount of entries within the CLEANCONF table. To fully execute the necessary DBClean utility statements, an export of data from a server installation is required; otherwise, custom statements need to be developed and inserted for execution.

To enable the DBClean utility in your WebSphere Commerce v7.0 developer toolkit installation follow the steps below:

NOTE: The following variables are referenced throughout the instructions.

  • ${WC_HOME} : The toolkit installation directory (ie. C:\IBM\WCDE_ENT70)
  • ${DB2_HOME} : The IBM DB2 installation directory (ie. C:\IBM\SQLLIB)

Step 1. Copy and ${WC_HOME}\bin\setenv.bat file to ${WC_HOME}\bin\setenv_dbclean.bat.

Step 2. Modify the ${WC_HOME}\bin\setenv_dbclean.bat file to include the following line, and set the DB2_DRIVER variable, substituting the appropriate value for the ${DB2_HOME} variable.

set DB2_DRIVER=${DB2_HOME}\java\db2jcc4.jar;${DB2_HOME}\java\db2jcc_license_cu.jar

Step 3. Copy the file contents below and create a new ${WC_HOME}\bin\dbclean.bat file, or copy the dbclean.bat file from a Windows server installation to the ${WC_HOME}\bin directory in your toolkit and modify it to reference the proper ${WC_HOME}\bin\setenv_dbclean.bat file created in steps 1 and 2.

call setenv_dbclean.bat

set CP1=%WCS_HOME%\lib\Utilities.jar;%WCS_HOME%\workspace\WC\lib\jtopen.jar;%WCS_HOME%\workspace\WC\Enablement-BaseComponentsLogic.jar;%WCS_HOME%\properties;%WAS_HOME%\java\jre\lib\xml.jar;%WAS_HOME%\lib\xerces.jar;%WAS_HOME%\lib\j2ee.jar
set CP2=%WCS_JCE_CLASSPATH%;%DB2_DRIVER%;%ORACLE_DRIVER%
set CP3=%CP1%;%CP2%

%JAVA_HOME%\bin\java -classpath %CP3% -Dos=windows -Dwclogdir=%WCLOGDIR% -Doracle.jdbc.J2EE13Compliant=true -DWCS_HOME=%WCS_HOME% com.ibm.commerce.clean.DBClean %*

Step 4. Insert appropriate CLEANCONF table records as needed.

For further information on executing the DBClean utility, please refer to the WebSphere Commerce Info Center topic, Database Cleanup Utility.

Author: daharveyjr

I’m a solution architect responsible for the design, development, implementation, testing, and maintenance of e-commerce operations and applications using the Hybris and WebSphere Commerce product suites and other web technologies such as Java, J2EE/JEE, Spring, PHP, WordPress and more. Twitter | Facebook | LinkedIn

Leave a Reply

Your email address will not be published.