Migrating your database from DB2 V9.x to DB2 V10.x
Before you begin
- Install WebSphere Commerce Version 7 Fix Pack 7.
- Install WebSphere Commerce Version 7 Fix Pack 8.
- 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
- Upgrade your DB2 database from Version 9.x to Version 10.x, following the steps in your DB2 documentation.
- 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:
- Connect to the migrated database with the DB2 SYSADMIN
user. Depending on your platform, the DB2 SYSADMIN can be one of the
following users:
- db2inst1
- db2admin
- 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 userdb2inst1
does not have the DBADM authority. - 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 usewasuser
to grant DBADM todb2inst1
.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
- Connect to the migrated database with the DB2 SYSADMIN
user. Depending on your platform, the DB2 SYSADMIN can be one of the
following users:
- Configure your WebSphere Commerce environment settings.
WebSphere Commerce references the DB2 installation directory in its library path setting and JDBC driver
classpath
setting.- Open the following file in a text editor:
- WC_installdir/bin/setenv.sh
- WC_installdir/bin/setenv.bat
- 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:
orAIX_DB2_HOME="/usr/ibm/db2/V9.5"
and change it to:AIX_DB2_HOME="/usr/ibm/db2/V9.7"
orAIX_DB2_HOME="/usr/ibm/db2/V10.1"
AIX_DB2_HOME="/usr/ibm/db2/V10.5"
- Open the following file in a text editor:
- 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:
or"DBDIR=/opt/ibm/db2/V9.5"
and change that line to:"DBDIR=/opt/ibm/db2/V9.7"
or"DBDIR=/opt/ibm/db2/V10.1"
"DBDIR=/opt/ibm/db2/V10.5"
- Modify the environment variable DB2_JDBC_DRIVER_PATH
in the WebSphere Commerce administrative console.
- Log on to the WebSphere Application Server administrative console.
- Select Environment > WebSphere Variables > DB2_JDBC_DRIVER_PATH.
- Set the DB2_JDBC_DRIVER_PATH to the DB2 V10.1 or V10.5
path.For example, change the existing value from:
or/opt/ibm/db2/V9.5/java
to:/opt/ibm/db2/V9.7/java
or/opt/ibm/db2/V10.1/java
/opt/ibm/db2/V10.5/java
- Update the DB2 JDBC native library path.
- The 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:
orLD_LIBRARY_PATH=/opt/ibm/db2/V9.5/lib32
to:LD_LIBRARY_PATH=/opt/ibm/db2/V9.7/lib32
orLD_LIBRARY_PATH=/opt/ibm/db2/V10.1/lib32
LD_LIBRARY_PATH=/opt/ibm/db2/V10.5/lib32
- Set 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:
orPATH=DB2_version_9.5_installdir/BIN
to:PATH=DB2_version_9.7_installdir/BIN
orPATH=DB2_version_10.1_installdir/BIN
PATH=DB2_version_10.5_installdir/BIN
- The 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.
- Update the DB2 version information in the WebSphere Commerce product.xml file.
- Open the following file in a text editor:
- WC_installdir/xml/product.xml
- 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>
- Replace the section with the following XML block:
For a local database:
Where x is the release of DB2 10.x you are migrating to.<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>
For a remote database:
Where x is the release of DB2 10.x you are migrating to.<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>
- Open the following file in a text editor:
- Restart the WebSphere Commerce Server.
- 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 toDISABLED
to maintain consistent behavior with previous releases. If you want to use currently committed on cursor stability scans, you must set thecur_commit
configuration parameter to ON after the upgrade.To enable the currently committed feature:
- 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:
- db2inst1
- db2admin
- Run the following SQL command:
db2 update database configuration using cur_commit on
- Stop the WebSphere Commerce Server.
- Force all database connections by running the following
command:
db2 force applications all
- Start the WebSphere Commerce Server.
- 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: