Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
Summary: this page provides instructions for those that would like to transition from using the "out-of-the box" DB2 Db2 Analyzer provided in CAST AIP to the SQL Analyzer extension.

Introduction

If you have been actively analyzing DB2 Db2 (z/OS or UDBLUW) with the DB2 Db2 Analyzer (provided out-of-the-box in CAST AIP) you can transition to using the SQL Analyzer extension to analyze your DB2 Db2 source code. The process of transitioning is described in this page.

Note
Note that it is only possible to analyze DB2 Db2 when using the SQL Analyzer extension 2.x.

Step 1: Take a snapshot

Take a snapshot of the existing Application prior to making any further changes.

Step 2: Backup CAST AIP schemas and Delivery/Deployment folders

  • To backup the CAST AIP schemas use the CSSBackup tool (located in the CSSAdmin folder in the CAST AIP installation folder) use the following scripts adapted to your environment:

...

  • Then  ZIP the Delivery and Deployment folders for easy restoration:

Step 3: Check results and grades

Before proceeding, check your results and grades using the CAST dashboards. Example below show a DB2 UDB Db2 LUW analysis:

Portfolio

Click to enlarge:

...

Violated rules by technology

Click to enlarge:

Step 4: Download and install the latest version of the SQL Analyzer extension

Please see:

Info
Note that you need to install the extension into the CAST AIP schemas that you were using previously to host your Application containing the DB2 Db2 analysis results.

Step 5: Retrieve existing

...

Db2 LUW connection details

Info

This step is only relevant for those analyzing DB2 UDB Db2 LUW online.

Use the following query, run against your CAST AIP Management Service schema, to retrieve the connection details to the live DB2 UDB Db2 LUW databases that are used during the analysis with the DB2 Db2 Analyzer (provided out-of-the-box in CAST AIP). This information can be reused when extracting the DDL for use with the SQL Analyzer extension:

...

The output of the above queries will result in similar output

CAST DMT Package NameDB2 Db2 loginHost nameHost portDatabase NameSchema Name
UDB_Packagedb2adminUDBSERVER50000TESTCASTPUBS

Step 6: Generate SQL source

This step explains how to generate the DDL from the DB2 Db2 database that will be fed into the CAST Delivery Manager Tool for analysis with the SQL Analyzer extension.  

Info
  • See also SQL Analyzer - generate DDL for a Db2 database for more information.
  • Note that the db2look tool is only available with an installation of a DB2 UDB  Db2 LUW instance. If you are using a DB2 Db2 z/OS instance, CAST recommends the use of the RC/Migrator tool which is part of the CA Database Management Solution for DB2 Db2 for Z/OS, Version 19. There are no instructions provided for this.

db2look command line

The tool used to achieve this is the db2look tool provided with the DB2 UDB Db2 LUW server (see the full documentation for the tool here: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002051.html). This example will generate an .SQL file containing the DDL for the CASTPUBS schema on the TEST database accessed with the db2admin/db2admin credentials:

...

You can view example DDL output generated by db2look in the attached files:

Generate db2look commands using a query

Info

This section is only relevant for those analyzing DB2 UDB Db2 LUW online.

If you need to generate DDL for multiple schemas use the following query (run against your CAST AIP Management Service schema) to automatically generate commands that can be used with the db2look tool:

...

The result of the above querieswill be as follows - one db2look command per schema on the target DB2 Db2 server. Each command will output the specified schema as DDL into one .SQL file:

Code Block
languagetext
themeDJango
titleResulting db2look commands
db2look -d TEST -z CASTPUBS -i db2admin -w db2admin -e -o E:\tmp\SQL_DB2\CASTPUBS.sql
db2look -d TEST -z DB2_DIAGS -i db2admin -w db2admin -e -o  E:\tmp\SQL_DB2\DB2_DIAGS.sql

Step 7: Add a new version

  • In the CAST Management Studio, add a new version for the existing Application in which the online DB2 UDB Db2 LUW analysis or the z/OS analysis is configured. Examples below show "DB2 UDB Db2 LUW online" (click to enlarge):

...

  • In the CAST Delivery Manager Tool, remove the existing DB2 UDB Db2 LUW online or z/OS package as shown below (click to enlarge):

...

  • Add a new package to deliver the DB2 Db2 DDL that you have already generated, using the Files on your system option (click to enlarge):

...

  • Modify the dependencies if you necessary. In this example we have a Mainframe Cobol Analysis Unit and therefore we will replace the existing Mainframe / IBM DB2 UDB Db2 LUW auto created dependency with  custom cobol / ddl udb dependency (click to enlarge):

Step 8: Recalibrate your Application

Take two new snapshots (ensure that you run an analysis as well) and then check the results in the CAST dashboards:

...

Info

Note that new Quality Rules will be calculated for the SQL Analyzer extension in comparison to the online DB2 Db2 analyzer:

  • Avoid unreferenced Functions
  • Avoid redundant indexes
  • Avoid Tables without Primary Key

...