UpdateVersionSchema utility
The UpdateVersionSchema utility identifies which tables to be versioned, and then creates the tables in your version schema. This utility replicates newly added tables marked to be versioned from the base schema into the version schema.Note: Only the primary key, and unique indexes from the original table in the base schema are replicated in the table that is created in the version schema.
To determine which tables to create in the version schema, the updateVersionSchema utility searches all the service module directories for the content version configuration file (wc-content-version.xml). For any tables listed in the wc-content-version.xml file, the updateVersionSchema utility looks up the existing table in the WebSphere Commerce base schema, and then creates a corresponding table in the version schema. If the table listed in the wc-content-version.xml file is not found, an exception is reported.
If workspaces is enabled, we must run this utility to update the workspace schemas.
Note: We must run this utility when you customize any of the tables listed in the wc-content-version.xml file or when we make any schema-related updates to the list of versionable tables in the base schema.
Parameter values
- -DinstanceName
- Required: The name of the instance to be updated (for example, demo).
- -DdbUserPassword
- Required: The password for the WebSphere Commerce user connecting to the database.
- -DdbaPassword
- Required: The password for the database administrator connecting to the database.
- -DWCInstallDir
- The WebSphere Commerce installation directory (for example, WC_installdir).
- -Dwashome
- The WebSphere Application Server home directory (for example, WAS_installdir.
- -DgeneratSQLStatementOnly
- Optional: Default is false. Setting this parameter to true generates an SQL log file, but does not run the SQL statements. The database administrator can use the SQL statements that are generated in the log file to update the version schema manually.
- -DdebugMode
- Optional: Default is false. Setting this parameter to true generates a log file in WC_installdir/logs/Application.version.update.messages_timestamp.log. The timestamp is appended to the file name, for example, Application.version.update.messages_yyyy.mm.dd_hh.mm.ss.zzz.log.
- -DgenerateVersionSQLStatementsOutputFile
- Optional: Specify a path and name for the log file. If you do not specify this parameter, the default name WC_installdir/logs/Update_version_db_instance_name.sql.log is used.
Examples
Runtime environment./config_ant.sh -buildfile WC_installdir/migration/components/content-version/xml/updateVersionSchema.xml -DinstanceName=instance_name -DdbUserPassword=db_password -DWCInstallDir=WC_installdir -Dwashome=WAS_installdir [-DgeneratSQLStatementOnly=generatesqlstatementonly] [-DdebugMode=debug_mode] [-DgenerateVersionSQLStatementsOutputFile=logfile_pathname]
This following example shows how to use the updateVersionSchema utility in the runtime environment:
./config_ant.bat -buildfile C:/WebSphere/Commerce/migration/components/content-version/xml/updateVersionSchema.xml -DinstanceName=demo -DdbUserPassword=wcs1 -DdbaPassword=manager -DWCInstallDir=C:/WebSphere/Commerce -Dwashome=C:/WASHomeDevelopment environmentTo run this utility in the toolkit environment, from the WCDE_installdir\bin directory, issue the following command in the command line:
(Developer)
updateVersionSchema.bat [-debug] [SQLlog_fullpathname]
- -debug
- Optional: Specify this parameter to generate the trace log file: WCDE_installdir\logs\Application.version.update.messages_timestamp.log. The timestamp is appended to the file name, for example, Application.version.update.messages_yyyy.mm.dd_hh.mm.ss.zzz.log.
- SQLlog_fullpathname
- Optional: When you specify the SQL log file name, the SQL statements are generated but not run. The database administrator can use the SQL statements that are generated in the log file to update the version schema manually.
The following example shows how to use the updateVersionSchema utility in the development environment:
updateVersionSchema.bat -debug C:\WCToolkit\UpdateVersionSchema.sql.logThe following log files are generated by default in the toolkit environment:
- WCDE_installdir\logs\Update_version_db_demo.sql.log (SQL file contains SQL statements to update the version schema)
- WCDE_installdir\logs\updateVersionSchema.log.
Limitations
- The updateVersionSchema utility replicates only the primary key, and unique indexes into the newly created table in the version schema, no other table definitions are created. For example, the table constraints are not replicated.
Related tasks
Running utilities from the Utility server Docker container