Rational Asset Analyzer Migration Utility

I. Overview

I.1 Description

The Migration Utility is a Java-based tool for automatically migrating the Rational Asset Analyzer database to a newer schema level. For example, you can use the Utility to upgrade your Rational Asset Analyzer database schema from 550 to 552.

While the Migration Utility is intended to be release independent, you should always use the newest version available from the product's Web site in the event fixes have been made to older database migrations. Updated versions of the migration utility will always be able to perform older migrations.

The Migration Utility has two distinct phases:

Creating a Migration Plan:
A Migration Plan consists of one or more generated XML files that contain the SQL statements that are run to migrate the database to a specific schema level. Once these XML files are created, you can review and edit them.
Running the Migration Plan:
Runs the SQL statements that are contained in the Migration Plan XML files against a Rational Asset Analyzer database. A variety of options for executing a Migration Plan provide control for you to specify if all tasks, a single task, or a range of tasks are to be performed during a particular migration run.

The purpose for splitting this up into two steps is to allow database administrators the opportunity to review the schema changes before they are made, and to modify the plan if they deem necessary.

I.2 Features

The Migration Utility has the following features:

II. Getting Started

II.1 Verify Environment Conditions

Before you perform migration, verify that all of the following conditions are met:

  1. You are using the prerequisite Java runtime (that is, JRE 1.4.2+). Your runtime can be verified by using the following command:
    java -fullversion
    
  2. You have system authority to create and edit files. The Migration Utility can be FTPed into and unzipped in any directory where the user has read/write authority.
  3. JDBC access has been configured such that the JDBC drivers are accessible in the current environment (this should be done automatically if you run the migration utility inside a db2cmd.exe window). Typically, this can be verified by executing "echo %CLASSPATH%" and verifying that db2java.zip is present.
  4. You have proper DB2 authority (e.g. DBADM, SYSADM, etc.), or access to a user id and password that has authority, to perform CREATE, UPDATE, DELETE, and other similar tasks against a Rational Asset Analyzer database.
  5. You have proper DB2 authority for reading DB2 SYSIBM catalog tables: SYSCOLUMNS, SYSINDEXES, SYSTABLES and SYSTRIGGERS.
  6. The access path statistics for the database are up-to-date. If in doubt, exectue the DB2 RUNSTATS Utility. See /bin/dmhRunstats.rexx.
  7. All user activity has completed, and the WebSphere Application Server and HTTP Server have been stopped.

II.2 Deploying the Migration Utility

To deploy the Migration Utility, do the following steps:

  1. Create a local directory for the Migration Utility.
  2. Copy the Migration Utility file (for example, wsaadbutil_windows.zip) into the new directory.
  3. Unzip the Migration Utility file.
  4. Verify that the unzip was successful by validating that the following files and directories are found in the Migration Utility directory:
    /config/*.cfg
    /lib/*.jar
    /META-INF/*.mf
    dbutil.bat
    
    /migrate/*.xsd
    /migrate/v550/*.xml
    /migrate/v552/*.properties and *.xml
    
    SetupJdbc.bat
    
    /verify/
    /verify/v550/*.xml
    /verify/v552/*.xml
    
  5. Review the release notes for the Migration Utility. They are presented below in Section IV. Migration Notes.
  6. If JDBC access has not been configured for the environment (as described in Section II.1.3), then the SetupJdbc.bat file can be used to add the db2java.zip file to your environment classpath.
  7. Update the contents of the Migration Utility's /config/User.cfg to specify your environment and database settings. Comments are provided in the file to describe the parameter fields. You will be required to provide values for several parameters, including the following:

  8. From the Migration Utility directory, enter the following command to verify your settings:
    dbutil.bat -getInfo
    
    You should see output similar to the following:
    JVM version detected: [#.#.#]
    Database os detected as [UDB]
    Url: jdbc:db2:<database-alias>
    Version: ###
    OS: UDB
    Dist-enabled: true_or_false
    

II.3 Create a Migration Plan

From the Migration Utility directory, run the following command to create a Migration Plan:

dbutil.bat -createMigratePlan targetVersion
where targetVersion is one of the following: v552

Below is a sample of the contents of a migration plan file:

....
    <Task step='v312.40' class='Sql' desc='Recreate trigger on DMH_DPL_WEB_MODULE' autocommit='true'>
		DROP TRIGGER DMH.DMHTRDW1;

		CREATE TRIGGER DMH.DMHTRDW1
			AFTER DELETE ON DMH.DMH_DPL_WEB_MODULE
			REFERENCING OLD AS O
			FOR EACH ROW MODE DB2SQL
				DELETE FROM DMH.DMH_D_WEB_MDL_IIL
					WHERE ASSET_ID = O.ASSET_ID;
    </Task>
    <Task step='v312.41' class='Sql' desc='Update version attribute' autocommit='true'>
		DELETE FROM DMH.DMH_ATTR_NAME
			WHERE ATTR_TYPE_ID = 500;

		INSERT INTO DMH.DMH_ATTR_NAME (ATTR_TYPE_ID, DESCRIPTION)
			VALUES (500, 'Version');
    </Task>
    ....

II.4 Execute a Migration Plan

From the Migration Utility directory, run the following command to run a Migration Plan:

dbutil.bat -runMigratePlan

II.4.1 Additional Run Options

As an alternative to automatically executing all Task steps in the Migration Plan, you can further control which Task steps are run by providing additional parameters to the -runMigratePlan command. The following examples illustrate this technique:

When you run -runMigratePlan in a step-by-step fashion, you can monitor DB2 resources in the environment as each Task step is run, and restart in the event of a failure. You should never run a Task step out of sequence. For example, do not run Task step v###.3 until Task steps v###.1 and v###.2 have been completed.

II.4.2 Migration Task Step Warning

An SQL Warning can be produced if there is no data from a table for a given task (such as an empty table, zero rows, etc.). You can generally ignore warnings of this nature and continue. For example:

  1. INSERT from/to empty tables.
    INSERT INTO DMH.DMH_FLD_BTCD_NEW
        (ASSET_ID, PHYSICAL_ID, ACCESS, FREE_TEXT, NAME, FULL_NAME, TYPE)
        SELECT
            ASSET_ID, PHYSICAL_ID, ACCESS, CAST(FREE_TEXT as VARCHAR(500)), NAME, FULL_NAME, TYPE
        FROM
            DMH.DMH_FIELD_BYTECODE
    STATUS:  WARNING
    
  2. DELETE of row that does not exist.
    DELETE FROM DMH.DMH_SYSTEM_ATTR
      WHERE SYS_ATTR_ID = 500
    STATUS: WARNING  (SQL-100)
    

II.4.3 Migration Task Step Failure

If any Task step in the migration fails, you are prompted to either ignore the problem and continue, or to stop the Migration Utility.

Typically, if any Task step fails, do the following steps:

  1. Stop the Migration Utility.
  2. Open the dbutil.log file.
  3. Find the Task step number of the Task step that failed in the log file (such as v312.10). A COMMIT would have been performed at the end of the last successful Task step completion.
  4. Identify the failing SQL statement and resolve the condition causing the failure.
  5. Pay close attention to which SQL statements, if any, in the current Task step succeeded. Any SQL statements that are executed after the last successful COMMIT call will have been automatically rolled-back.
  6. Identify any remaining SQL statements that should have been run in the failed Task step by locating the Task step in the appropriate /migrate_plan/Migrate_v*.xml file.
  7. Do one of the following sets of steps:

II.4.3.1 Example of Resolving a Migration Task Step Failure

While you were running the Migration Utility, an SQL error was reported, and you stopped the Utility. Within the dbutil.log, the error is reported as follows:

----------------------------------------------------------------------
[v410.31] - timestamp
Delete some tables
----------------------------------------------------------------------
DROP TABLE DMH.DMH_MYTABLE1
STATUS: OK

COMMIT
STATUS: OK

DROP TABLE DMH.DMH_MYTABLE2
[IBM][CLI Driver][DB2/NT] SQL0204N "DMH.DMH_MY_TABLE2"
is an undefined name. SQLSTATE=42704
STATUS: ERROR

Exception occurred while running the last command.
Continue (Rollback occurs if 'N')? [Y(es)/N(o)] N

To determine the steps needed to get around the issue and restart the migration utility do the following steps:

  1. Note the Task step number in which the failure occurred is v410.31 (Task step #31 in Migrate_v410.xml.)
  2. Note the first SQL statement was run successfully and the change was committed.
  3. Make a determination as to why the SQL failed (such as: table has already been removed, table name is incorrect), and resolve the condition.
  4. Locate Task step v410.31 in /migrate_plan/Migrate_v410.xml.
  5. Manually run the corrected SQL statement and the remaining SQL statements, if any, that comprise Task step v410.31.
  6. Restart the Utility to begin running at the Task step immediately following the (previous) failed Task step, for example:
    dbutil.bat -runMigratePlan v410.32-
    

II.5 Completing Migration

Do the following steps to complete the migration:

  1. Bind the Rational Asset Analyzer programs. See /bin/DMH*Bind.bat
  2. Run the DB2 RUNSTATS utility. See /bin/dmhRunstats.rexx.
  3. Optionally, after you successfully complete all the Rational Asset Analyzer migration tasks, you can delete the Migration Utility files and directory. If you specified a staging directory in the User.cfg file that is other than the Migration Utility directory, you should delete that directory as well.

III. dbutil.bat Command Reference

You can also get command-line usage information by running the dbutil.bat command with no parameters.

You can run the following commands from the Migration Utility directory. You should ensure that the environment settings in /config/User.cfg are updated and accurate.

-createMigratePlan

To build the files that are used for input to the Migration Utility, execute the following command:

dbutil.bat -createMigratePlan targetVersion
where targetVersion is any of the following: v552.

For example, if the database is currently at v550 and the targetVersion is v552, use the following command:

dbutil.bat -createMigratePlan v552
and expect output similar to this:
JVM version detected: [#.#.#]
Database os detected as [UDB]

Database information detected...
Version: 550
OS: UDB
Dist-engable: true_or_false

Database version appears to be at level v550

----------------------------------------------------------------------
Verifying current schema of database as 'v550'
----------------------------------------------------------------------
Current database version verified.

----------------------------------------------------------------------
Creating migration plan from current version 'v550' to target version 'v552'.
----------------------------------------------------------------------
Creating migration plan for version 'v552'
Finished without errors.

The Migration Utility creates a migrate_plan directory, which contains XML files for each schema level that will be accommodated to get to the targetVersion. For the above example, the following files are generated:

Migrate_v552.xml

If the database is at a particular schema level and you attempt to create a Migration Plan for the same schema level, no Migrate_v*.xml file is created. For example, a database currently at v552 where targetVersion is the same:

dbutil.bat -createMigratePlan v552

JVM version detected: [#.#.#]
Database os detected as [UDB]

Database information detected...
Version: 550
OS: UDB
Dist-engable: true_or_false

Database version appears to be at level v552.
Target version 'v552' is less than or equal to the current database version 'v552'.
No plan created.
Finished without errors.

The Migration Utility deletes the migrate_plan directory and all Migrate_v*.xml files on subsequent executions of the -createMigratePlan command.

-getInfo

To report values that the Migration Utility is using from the User.cfg file, run the following command:

dbutil.bat -getInfo [ -args ]
where -args are optional and can be one of the following values:
-dbUrl ?
? = database URL
-user ?
? = user id
-pw ?
? = password
-tschema ? table
? = schema name
-dbDriver ? database
? = driver class name

The optional -args simply override what is defined in User.cfg. If you want to quickly get information about a different Rational Asset Analyzer database without having to edit User.cfg, you can specify the dbUrl/user/pw of that database as override parameters.

Run the command with no -args to see output similar to the following:

JVM version detected: [#.#.#]
Database os detected as [UDB]
Url: jdbc:db2os390:database_alias
Version: version
OS: UDB
Dist-enabled: true_or_false
-runMigratePlan

To perform database migration by using a Migration Plan, run the following command:

dbutil.bat -runMigratePlan [ optional-run-steps ]
where optional-run-steps can take one of the following forms:

v552.1-v552.9 run Task steps v552.1 through v552.9
-v552.8 run all Task steps up to and including v552.8
v552.3- run all Task steps including and after v552.3
v552.10 run Task step v552.10 only

If you use -runMigratePlan without optional-run-steps, all Task steps in the /migrate_plan/Migrate_v*.xml files are run (that is, the entire Migration Plan that is available at the time of execution).

At the completion of a -runMigratePlan run (in this case, migrating to v552), you should see the following output immediately after the last echoed SQL statement:

----------------------------------------------------------------------
Verifying current schema of database as 'v552'
----------------------------------------------------------------------
Current database version verified.
Finished without errors.
-verifySchema

To verify that a particular Rational Asset Analyzer database contains the expected tables, columns, indexes, and triggers for a given schema level, run the following command:

dbutil.bat -verifySchema version
where version is any of the following: v552.

For example, the following command:

dbutil.bat -verifySchema v552 
produces the following output:
JVM version detected: [#.#.#]
Verifying database with the following properties:
    targetVersion = 'v552'
    dbUrl = 'jdbc:db2:<database-alias>'
    user = 'userid'
    pw = 'password'
    os = 'WINDOWS'
    isDistEnabled = 'true_or_false'
    tSchema = 'your_schema_name'
    dbDriver = 'COM.ibm.db2.jdbc.app.DB2Driver'
Baseline comparison showed 0 differences.
Finished without errors.

A list of differences, if any, is displayed and identifies the missing or extra database objects (tables, columns, indexes, and triggers). For example, the following command:

dbutil.bat -verifySchema v552
produces the following output for a database with discrepancies:
JVM version detected: [#.#.#]
Verifying database with the following properties:
    targetVersion = 'v552'
    dbUrl = 'jdbc:db2:<database-alias>'
    user = 'userid'
    pw = 'password'
    os = 'WINDOWS'
    isDistEnabled = 'true_or_false'
    tSchema = 'your_schema_name'
    dbDriver = 'COM.ibm.db2.jdbc.app.DB2Driver'
Baseline comparison showed 2 differences.
1: Database is missing index 'ASSI001' in table 'DMH_ASSETS'
2: Database is missing trigger 'DMHTRSB7' in table 'DMH_DB2_PROC'

It is recommended that you investigate and resolve the highlighted differences.

The verification is automatically performed at the start of a -createMigratePlan command and at the end of each completed migration level of a -runMigratePlan command.

IV. Migration Notes

Depending on the schema level the database is being migrated to, there may exist some special circumstances that require manual effort and/or post-migration activity that needs to occur for a database to be considered fully migrated and ready for user activity. The below notes highlight the particular requirements for specific migration levels. These should be reviewed and understood prior to the start of any migration effort.

IV.1.1 Release notes for migrating to V552

IV.1.1.a z/OS Scan and Load Resource Managers

The z/OS Scan & Load Technology Preview for Rational Asset Analyzer V5.5 Fix Pack 1 required a new PDS Resource Manager be manually inserted into the database if IMS Subsystem and/or Assembler source data was to be imported. When migrating to database schema 552, this row will be removed if found, and the Utility will proceed to insert new rows for PDS, ASM, CICS DB2 and IMS resource managers as required for Rational Asset Analyzer V5.5 Fix Pack 2.

V. Summary of Changes

V.1 Data model changes for V552

New tables and indexes

Table Primary Key Index Alternate Index
DMH_BP_MODEL MODEL_ID
DMH_BP_PROCESS MODEL_ID + PROCESS_ID
DMH_BR_POLICY POLICY_ID
DMH_BR_POLICY_RS PLOICY_ID + RULE_SET_ID
DMH_BR_RULE RULE_ID
DMH_BR_RULE_SET RULE_SET_ID
DMH_BR_RS_RULE RS_RULE_ID
DMH_BT_CATEGORY CATEGORY_ID
DMH_BT_RELATD_TERM TERM_ID_1 + TERM_ID_2
DMH_BT_SYNONYM TERM_ID_1 + TERM_ID_2
DMH_BT_TERM TERM_ID
DMH_FILE_LITERAL LITERAL_ID + FILE_ID RDILTF2
DMH_FILE_SYMBOL SYMBOL_ID + FILE_ID RDISTF2

New component types

  1. 70, Import file
  2. 400, Category
  3. 401, Term
  4. 430, Model
  5. 431, Process
  6. 460, Policy
  7. 470, Rule set
  8. 480, Rule

New constant strings

DMH_QUEUE_TYPE table:
  1. 18, Load import file
DMH_RESOURCE_MNGR
  1. 2, MVS Default Catalog
  2. 3, Assembler Source
  3. 4, CICS Online Region
  4. 5, DB2 System
  5. 6, IMS Subsystem
DMH_TOOL
  1. 0001000800, SAP ABAP Analyzer
  2. 0001000801, Visual Basic Analyzer
  3. 0001000802, EGL Analyzer

Changed constant strings

DMH_QUEUE_TYPE
  1. 1, Build run unit content
  2. 2, Resolve dynamic references
  3. 4, Analyze file
  4. 5, Rebuild run unit content
  5. 8, Identify file language
  6. 10, Analyze container
  7. 11, Identify file type
  8. 15, Establish PSB for run unit
  9. 16, Connect PSB to run unit
  10. 17, Delete file
  11. 20, Scan distributed scan root
  12. 21, Postprocess distributed scan root
DMH_SYSTEM_ATTR table:
  1. 500, 552

Deleted constant strings

DMH_LIBRARY_TYPE table:
  1. ACB, IMS ACB Library
  2. DBD, IMS DBD Library
  3. PSB, IMS PSB Library

Changed triggers

Inventory delete triggers:
  1. DMHTRLL1
  2. DMHTRME1

VI. Migration XML Files

During the creation of a Migration Plan, the Migration Utility reads a version-specific /migrate/v*/Migrate.xml file and outputs a /migrate_plan/Migrate_v*.xml file. Details for the /migrate/v*/Migrate.xml file are presented here for informational purposes only. Do not modify these files unless instructed to do so by IBM support. However, you should review and update the /migrate_plan/Migrate_v*.xml files as appropriate for your environment.

VI.1 Migrate.xml and Migrate_v*.xml Files

The general format of the /migrate/Migrate.xml files are as follows:

<TaskSequence version='version-number'...>

      <!-- Define vars used in this file -->
      <Vars>
         ...zero or more variable definitions...
      </Vars>

      ...zero or more task definitions...

</TaskSequence>

This is a sample Migrate.xml file:

<TaskSequence version='v311'...>

	<!-- Define vars used in this file -->
	<Vars>
		<Var name='dbName' value='$C{User.Database.name}'/>
		<Var name='tschema' value='$C{$User.Database.tschema}'/>
		<Var name='tsprefix' value='$C{$User.ZOS.tsprefix}'/>
		<Var name='isDistEnabled' value='$C{User.Database.isDistEnabled}'/>
            ...
	</Vars>

	<Task class='Sql' if='${isDistEnabled}' desc='Create a new table.'>
		CREATE TABLE ${tschema}.DMH_NEW_TABLE1 (
			COLUMN_1            INTEGER NOT NULL,
			COLUMN_2            INTEGER NOT NULL,
			PRIMARY KEY (COLUMN_1))
			%IF[${isZOS}]
				IN ${tschema}.${tsprefix}%COND[${singleTS}==true?TBS:NEW]
			%ENDIF
		;
	</Task>

	<Task class='Sql' if='! ${isDistEnabled}' desc='Create a new table.'>
		CREATE TABLE ${tschema}.DMH_NEW_TABLE2 (
			COLUMN_1            INTEGER NOT NULL,
			COLUMN_2            INTEGER NOT NULL,
			PRIMARY KEY (COLUMN_1))
		;
	</Task>

	<Task class='v311.ContainerUpdate' if='${isDistEnabled}' desc='...'/>

</TaskSequence>

Given the above file, the corresponding generated /migrate_plan/Migrate_v311.xml file for a z/OS database with distributed tables enabled might look like the following file:

<TaskSequence version='v311'...>

	<!-- Define vars used in this file -->
	<Vars>
		<Var name='dbName' value='DMHDB'/>
		<Var name='tschema' value='DMH'/>
		<Var name='tsprefix' value='DMHTS'/>
            ...
	</Vars>

	<Task step='v311.1' class='Sql' desc='Create a new table' autocommit='true'>
		CREATE TABLE DMH.DMH_NEW_TABLE1 (
			COLUMN_1            INTEGER NOT NULL,
			COLUMN_2            INTEGER NOT NULL,
			PRIMARY KEY (COLUMN_1))
				IN DMH.DMHTSNEW
		;
	</Task>

	<Task step='v311.2' class='v311.ContainerUpdate' desc='...' autocommit='true'>
	</Task>

</TaskSequence>

The following transformations are done from the /migrate/Migrate.xml file to the /migrate_plan/Migrate_v*.xml file:

©Copyright IBM Corporation 2005, 2009. All rights reserved.