WebSphere Commerce Version 7.0.0.7 or later

Migrating your database from DB2 V9.x to DB2 V10.x

After you upgrade your installation to WebSphere Commerce 7.0.0.7 or 7.0.0.8, you can migrate your database from DB2 Version 9.x to DB2 Version 10.1 or 10.5.

Before you begin

For DB2 V10.1
  • Install WebSphere Commerce Version 7 Fix Pack 7.
For DB2 V10.5
  • Install WebSphere Commerce Version 7 Fix Pack 8.
Note:
  • You cannot uninstall the fix pack that you install after you upgrade to DB2 10.x. Earlier versions of WebSphere Commerce do not support DB2 10.x.
  • If you plan to create a WebSphere Commerce instance with a remote client that is DB2 V9.7 FP1 or lower, you must manually copy the db2_adminotm.bnd file from the server to the client. The file can be found in the DB2_installdir/bnd/ directory.

Procedure

This procedure describes migration steps that are related to WebSphere Commerce and the WebSphere Commerce database. For instructions on obtaining the DB2 software upgrade and related documentation, see: DB2 10.1 or DB2 10.5
  1. Upgrade your DB2 database from Version 9.x to Version 10.x, following the steps in your DB2 documentation.
  2. Configure user authority and privilege in the migrated database.

    The security model for users changed in DB2 V9.7. As a result, your migrated database users might not have the proper authority and privileges in the migrated database. This issue can be resolved by manually granting the authority and privilege to the proper users:

    1. Connect to the migrated database with the DB2 SYSADMIN user. Depending on your platform, the DB2 SYSADMIN can be one of the following users:
      • SolarisLinuxAIXdb2inst1
      • Windowsdb2admin
      If necessary, write down the name of your DB2 SYSADMIN user.
    2. Check the user authority in the migrated database by running the following SQL command:
      db2 "select cast(grantee as char(32)) as user, dbadmauth, securityadmauth from syscat.dbauth where granteetype='U'"

      This statement checks whether the WebSphere Commerce non-root user (wasuser) and the DB2 SYSADMIN have DBA authority (DBADMIN) and security administrator authority (SECADM).

      Your results might be similar to the following sample results:
      USER                             DBADMAUTH SECURITYADMAUTH
      -------------------------------- --------- ---------------
      WASUSER                          Y         N
      DB2INST1                         N         Y
      
        2 record(s) selected.

      These results indicate that user wasuser does not have the SECADM authority and the user db2inst1 does not have the DBADM authority.

    3. Grant the DBADM authority to the DB2 SYSADMIN user.

      DB2 does not allow users to grant authority to themselves, so in our example, the user db2inst1 cannot grant the DBADM authority to itself even though it has the SECADM authority. You must grant the SECADM authority to another user (wasuser, in this example) and then use wasuser to grant DBADM to db2inst1.

      Run the following SQL statements:
      db2 grant secadm on database to user WC_non_root_user
      db2 disconnect database_name
      db2 connect to database_name user WC_non_root_user using db_password
      db2 grant dbadm on database to user  db_schema
  3. Configure your WebSphere Commerce environment settings.

    WebSphere Commerce references the DB2 installation directory in its library path setting and JDBC driver classpath setting.

    1. Open the following file in a text editor:
      • SolarisLinuxAIXWC_installdir/bin/setenv.sh
      • WindowsWC_installdir/bin/setenv.bat
    2. Change all occurrences of the string /IBM/db2/V9.5 or /IBM/db2/V9.7 to /IBM/db2/V10.1 or /IBM/db2/V10.5
      For example, if you change the setenv.sh file on AIX and you use the default installation path, you find the following line:
      AIX_DB2_HOME="/usr/ibm/db2/V9.5"
      or
      AIX_DB2_HOME="/usr/ibm/db2/V9.7"
      and change it to:
      AIX_DB2_HOME="/usr/ibm/db2/V10.1"
      or
      AIX_DB2_HOME="/usr/ibm/db2/V10.5"
  4. Update the DBDIR variable in the WC_installdir/bin/wcnonroot.sh.

    For example, if you change the setenv.sh file on AIX and you use the default installation path, you find the following line:

    "DBDIR=/opt/ibm/db2/V9.5" 
    or
    "DBDIR=/opt/ibm/db2/V9.7"
    and change that line to:
    "DBDIR=/opt/ibm/db2/V10.1"
    or
    "DBDIR=/opt/ibm/db2/V10.5"
  5. Modify the environment variable DB2_JDBC_DRIVER_PATH in the WebSphere Commerce administrative console.
    1. Log on to the WebSphere Application Server administrative console.
    2. Select Environment > WebSphere Variables > DB2_JDBC_DRIVER_PATH.
    3. Set the DB2_JDBC_DRIVER_PATH to the DB2 V10.1 or V10.5 path.
      For example, change the existing value from:
      /opt/ibm/db2/V9.5/java
      or
      /opt/ibm/db2/V9.7/java
      to:
      /opt/ibm/db2/V10.1/java
      or
      /opt/ibm/db2/V10.5/java
  6. Update the DB2 JDBC native library path.
    1. SolarisLinuxAIXThe DB2 JDBC library path is set in the WebSphere Commerce non-root user's .profile and .bash_profile files. The library paths must be changed to point to the DB2 V10.1 or V10.5 path.
      For example, change the existing value from:
      LD_LIBRARY_PATH=/opt/ibm/db2/V9.5/lib32
      or
      LD_LIBRARY_PATH=/opt/ibm/db2/V9.7/lib32
      to:
      LD_LIBRARY_PATH=/opt/ibm/db2/V10.1/lib32
      or
      LD_LIBRARY_PATH=/opt/ibm/db2/V10.5/lib32
    2. WindowsSet the DB2 JDBC library path in the Windows system environment variable PATH. Change the PATH setting to point to the DB2 V10.1 or V10.5 path.
      For example, change the existing value from:
      PATH=DB2_version_9.5_installdir/BIN
      or
      PATH=DB2_version_9.7_installdir/BIN
      to:
      PATH=DB2_version_10.1_installdir/BIN
      or
      PATH=DB2_version_10.5_installdir/BIN
  7. Update the DB2 version information in the WebSphere Commerce product.xml file.
    1. Open the following file in a text editor:
      • WC_installdir/xml/product.xml
    2. Find the following DB2 section in the file:
      <database>
      	<name>DB2</name>
      	<edition>
      		<name>UDB Enterprise Edition</name>
      	</edition>
      	<version>9</version>
      	<release>x</release>
      	<modification>0</modification>
      	<fixpak></fixpak>
      	<default>1</default>
      	<install>
      		<date></date>
      		<time></time>
      		<path>/opt/ibm/db2/V9.x</path>
      	</install>
      	<upgraded></upgraded>
      </database>
    3. Replace the section with the following XML block:
      For a local database:
      <database>
      	<name>DB2</name>
      	<edition>
      		<name>UDB Enterprise Edition</name>
      	</edition>
      	<version>10</version>
      	<release>x</release>
      	<modification>0</modification>
      	<fixpak></fixpak>
      	<default>1</default>
      	<install>
      		<date></date>
      		<time></time>
      		<path>/opt/ibm/db2/V10.x</path>
      	</install>
      	<upgraded></upgraded>
      </database>
      Where x is the release of DB2 10.x you are migrating to.
      For a remote database:
      <database>
      <name>DB2</name>
      <edition>
      <name>Administration client</name>
      </edition>
      <version>10</version>
      <release>x</release>
      <modification>0</modification>
      <fixpak></fixpak>
      <default>1</default>
      <install>
      <date></date>
      <time></time>
      <path>/usr/IBM/db2/V10.x</path>
      </install>
      <upgraded></upgraded>
      </database> 
      Where x is the release of DB2 10.x you are migrating to.
  8. Restart the WebSphere Commerce Server.
  9. Enable the currently committed (cur_commit) feature.

    To improve database concurrency, WebSphere Commerce enables the DB2 V10.x current committed feature by default in new instance creation. However, during a database upgrade from Version 9.x to Version 10.x, the cur_commit configuration parameter is set to DISABLED to maintain consistent behavior with previous releases. If you want to use currently committed on cursor stability scans, you must set the cur_commit configuration parameter to ON after the upgrade.

    To enable the currently committed feature:

    1. Connect to the migrated database with the DB2 SYSADMIN user. Depending on your operating system, the DB2 SYSADMIN might refer to one of the following users:
      • SolarisLinuxAIXdb2inst1
      • Windowsdb2admin
    2. Run the following SQL command:
      db2 update database configuration using cur_commit on
    3. Stop the WebSphere Commerce Server.
    4. Force all database connections by running the following command:
      db2 force applications all
    5. Start the WebSphere Commerce Server.