Use the updatedb utility to update the WebSphere Commerce database to
the latest fix pack level.
Before you begin
Ensure that you updated the installation
directory with the following fixes:
- The latest fix pack that you downloaded
- The latest cumulative interim fix for the Fix Pack level that you installed
- Interim fix JR52690
About this task
You can leverage the enhancements that are provided by JR52690 to update the database with
zero downtime. Interim fix JR52690 adds functionality so that if the updatedb
utility fails, you can rerun the utility without the need to restore the database, hence avoiding
downtime. The utility skips the SQL changes that were committed and continues from the point of
failure. Previously, if the updatedb utility failed during invocation, you had to
restore the database before your reran the utility.Important: To fully support updating
the database with zero downtime, you must enable auto commit to reduce the risk of encountering lock
timeout exceptions. It is also recommended that you set a suitable lock timeout value for your
environment.
Procedure
-
Enable auto commit.
-
Open the
WC_installdir/components/Fixpack/xml/configureDatabaseFixpack.xml
file.
-
Find the
<wccondsql>
task block.
-
Add the
autocommit="true"
attribute to the <wccondsql>
task block.
For example,
<wccondsql
driver="${jdbcDriver}"
url="${jdbcURL}"
userid="${dbUserName}"
password="${dbUserPassword}"
print="true"
classpath="${jdbcDriverLocation}"
delimiter="${delimiter}"
delimitertype="${delimiterType}"
src="${srcFile}"
schema="${schemaName}"
onerror="${fpRunSQLCOE}"
allowConnects="${fpRunSQLAC}"
autocommit="true"
/>
-
Save and close the file.
-
Run the updatedb utility utility on
the machine where WebSphere Commerce is installed.
- Optional:
If the updatedb utility fails, review the updatedb log
file:
-
Review the following log file:
WC_installdir\updatedb\updatedb-instance_name.log
Tip: Refer to the
FixPack_RunSQL targets in the log to see the schema
scripts that are used to update the database. The following information can help you understand
which DDL statements were executed, which statements were skipped, and which statements failed:
- [wccondsql]
- Indicates that the SQL statement is conditionally executed.
- execute-scope?
- Values: true or false.
- A string that indicates whether the particular DDL statement was executed (true) or skipped
(false).
- checked-for:
- Values: absence or presence.
- Indicates whether to execute the particular DDL statements when a particular object is absent or
when a particular object is present.
If a DDL statement fails to execute, a
Failed to execute message
is displayed.
For
example:
FixPack_RunSQL:
[wccondsql] WCConditionalSQL version 7.0 fixpack 9 (20140407)
[wccondsql] File: [C:\WEBSPH~1\COMMER~1\schema\db2\fixpack9\wcs.fixpack9.schema.sql] read successfully
[wccondsql] Executing commands
[wccondsql] Executing in schema: [WCS]
[wccondsql] Scope [01] object: [column] name: [OVRMKTLIMIT] parent-table: [COLLATERAL] checked-for: [absence] execute-scope? [false]
[wccondsql] 0 rows affected
[wccondsql] Scope [02] object: [column] name: [DYNAMIC] parent-table: [CATGROUP] checked-for: [absence] execute-scope? [true]
[wccondsql] Failed to execute: ALTER TABLE CATGROUP ADD COLUMN DYNAMIC INT DEFAULT 0
-
Resolve any issues that are found in the log file.
-
Rerun the updatedb utility. You do not have to restore the database. The
utility skips over any previously executed DDL statements and resumes from the point of
failure.
-
When the update is complete, review the output that is displayed in the console window and
ensure that you successfully updated the database to the correct fix pack level.
For example, you might see output that resembles the following
message:
UpdateSiteTable: [EchoNL] Updating database fixpack level ...
[eCDatabaseVersionInfo] UPDATE SITE SET EDITION='ENT', VERSION=7, RELEASE=0, MOD=0, FIXPACK=X WHERE COMPNAME='BASE'
[eCDatabaseVersionInfo] SELECT COUNT(*) FROM SITE
[eCDatabaseVersionInfo] SELECT * FROM SITE
[eCDatabaseVersionInfo] Columns in SITE table:
[eCDatabaseVersionInfo] COMPNAME=BASE
[eCDatabaseVersionInfo] EDITION=ENT
[eCDatabaseVersionInfo] VERSION=7
[eCDatabaseVersionInfo] RELEASE=0
[eCDatabaseVersionInfo] MOD=0
[eCDatabaseVersionInfo] FIXPACK=X
[eCDatabaseVersionInfo] Updated SITE table successfully.
[EchoNL] Completed database fixpack update. BUILD SUCCESSFUL
Where
X is the number of the fix pack that was installed.