WebSphere Commerce Version 7.0.0.1 or later

Migrating your database from DB2 V9.5 to DB2 V9.7

After you install WebSphere Commerce Version 7 or higher, you can upgrade your database from DB2 Version 9.5 to DB2 9.7.

WebSphere Commerce Version 7.0.0.2 or laterThere are issues that are related to database schema creation when you use DB2 V9.7 Fix Pack 5 or later. See: Database schema creation might fail on DB2 V9.7 Fix Pack 5 (or later) when you install or upgrade from a WebSphere Commerce version older than V7.0.0.6

Before you begin

  • You cannot uninstall WebSphere Commerce Version 7 Fix Pack 1 after you migrate your database to DB2 V9.7. WebSphere Commerce Version 7 does not support DB2 V9.7.
  • You cannot migrate your database from DB2 V9.5 to DB2 V9.7 unless WebSphere Commerce Version 7 Fix Pack 1 or higher is installed.
  • Install WebSphere Commerce Version 7 Fix Pack 1 or higher.

Procedure

This procedure describes migration steps that are related to WebSphere Commerce and the WebSphere Commerce database. See the IBM DB2 9.7 for Linux, UNIX, and Windows documentation for instructions on obtaining the DB2 software upgrade and related documentation.
  1. Upgrade your DB2 database from Version 9.5 to Version 9.7, following the steps in your DB2 documentation.
  2. Configure the remote server when the DB2 server is installed on a separate machine from the WebSphere Commerce product:
    1. Manually copy the DB2 bind file db2_adminotm.bnd from the DB2 server to the DB2 client before you create the WebSphere Commerce instance. The details can be found in DB2 V9.7 APAR IC62106.
      The db2_adminotm.bnd file is in the DB2_installdir/bnd subdirectory.
      Note: When you copy files, ensure that the server and the client are at the same fix pack level.
  3. 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
  4. 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 to /IBM/db2/V9.7
      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"
      and change it to:
      AIX_DB2_HOME="/usr/ibm/db2/V9.7"
  5. 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" 
    and change that line to:
    "DBDIR=/opt/ibm/db2/V9.7"
  6. 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 V9.7 path.
      For example, change the existing value from:
      /opt/ibm/db2/V9.5/java
      to:
      /opt/ibm/db2/V9.7/java
  7. 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 V9.7 path.
      For example, change the existing value from:
      LD_LIBRARY_PATH=/opt/ibm/db2/V9.5/lib32
      to:
      LD_LIBRARY_PATH=/opt/ibm/db2/V9.7/lib32
    2. WindowsSet the DB2 JDBC library path in the Windows system environment variable PATH. Change the PATH setting to point to the DB2 V9.7 path.
      For example, change the existing value from:
      PATH=DB2_version_9.5_installdir/BIN
      to:
      PATH=DB2_version_9.7_installdir/BIN
  8. 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>5</release>
      	<modification>0</modification>
      	<fixpak></fixpak>
      	<default>1</default>
      	<install>
      		<date></date>
      		<time></time>
      		<path>/opt/ibm/db2/V9.5</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>9</version>
      	<release>7</release>
      	<modification>0</modification>
      	<fixpak></fixpak>
      	<default>1</default>
      	<install>
      		<date></date>
      		<time></time>
      		<path>/opt/ibm/db2/V9.7</path>
      	</install>
      	<upgraded></upgraded>
      </database>
      For a remote database:
      <database>
      <name>DB2</name>
      <edition>
      <name>Administration client</name>
      </edition>
      <version>9</version>
      <release>7</release>
      <modification>0</modification>
      <fixpak></fixpak>
      <default>1</default>
      <install>
      <date></date>
      <time></time>
      <path>/usr/IBM/db2/V9.7</path>
      </install>
      <upgraded></upgraded>
      </database> 
  9. Restart the WebSphere Commerce Server.
  10. Enable the currently committed (cur_commit) feature.

    To improve database concurrency, WebSphere Commerce enables the DB2 V9.7 current committed feature by default in new instance creation. However, during a database upgrade from Version 9.5 to Version 9.7, 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 platform, 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.