IBM Books

Administering Satellites Guide and Reference


Creating and Testing Group Batches

When the test synchronization is successful, meaning that the test satellite can connect to the DB2 control server and validate its configuration, you are ready to set up the test batches that create and maintain both the database definition and the data for the first version of the end-user application. When these batches are set up, the test satellites will be able to execute them when they synchronize. The examples that follow are limited to scripts that execute locally on the satellite, and not against remote targets. For information about enabling script execution against targets that are remote to a satellite, see Chapter 4, Cataloging Instances and Databases. The steps that you perform are as follows:

  1. Create authentication credentials.
  2. Create execution targets.
  3. Create an application version:
    1. Create your first test level, level 0, for the application version.
    2. Edit level 0 to add batches.
  4. Catalog the remote targets on the satellite. For more information, see Cataloging Instances and Databases on Test Satellites.
  5. Synchronize the test satellites.
  6. Promote level 0 to production.

Creating Authentication Credentials

You create authentication credentials for the DB2 instances and DB2 databases that a satellite will either attach or connect to when it synchronizes. You can create a separate authentication credential for every potential target, or you can use one authentication credential for all targets, whichever is appropriate. For each batch step that the satellite executes when it synchronizes, the satellite will authenticate with the execution target using the user ID and password of the associated authentication credential.

For example, assume that you have a DB2 instance that is called DB2, and a DB2 database that is called SALES. Assume that there is a user ID with SYSADM authority that is called SALESADM with a password of SALESPW. This is the user ID that you will associate with scripts that require SYSADM authority to execute. You could create the authentication credential associated with this user ID and password under the name SALESCRED. This is the authentication credential that you would specify when you create a target.

DB2 uses the operating system security manager to authenticate clients. Because of this, the user ID and password must exist in the security manager of the operating system of the target. In the example here, the SALESADM user ID must exist in the security manager with a password of SALESPW. To enable this user ID to be able to execute the DB2 commands and SQL statements contained in the scripts, you must give this user ID SYSADM authority. Add this user to a group, then update the value of the database manager configuration parameter sysadm_group to be the group name. For more information about this configuration parameter, refer to the Administration Guide.

To create authentication credentials, use the Create Authentication window. Enter the following values (the values follow the example above):

  1. Specify SALESCRED for the Name field.
  2. Specify SALESADM for the User ID field.
  3. Specify SALESPW for the Password and Confirm password fields.
  4. Click OK.

Creating Execution Targets

All scripts execute against a target, which can be a DB2 instance, a DB2 database, or the operating system on the satellite. You must create a named target for every DB2 instance or DB2 database against which a script will execute. You do not need to create a named target for scripts that execute against an operating system.

Before you can create a named target for a DB2 instance or DB2 database, you must first catalog them in Control Center. For more information, see Cataloging Systems, Instances, and Databases on the Control Center.
Note:You must catalog the instance and the database using the same name and alias under which the instance and database is cataloged on the satellites.

When you have cataloged all of the instances and databases against which scripts will execute, you use the Create Target window in the Satellite Administration Center to create the named targets for these instances and databases.

For example, you would have to create targets for the DB2 instance and the SALES database. To create the target for the DB2 instance:

  1. In the Alias field, select the target. You must select the same alias under which the instance is cataloged on the satellites. This is the same name under which the instance is displayed in the Control Center.

    The Type field is automatically filled based on the type of the alias. In this situation, the type is Instance.

  2. In the Authentication name field, select SALESCRED. This is the name of the authentication credential that was created in the previous example. This authentication name is associated with a user ID that has SYSADM authority.
  3. Click Test and a test attachment is attempted to verify the user ID and password against the target for validation. Type the password for the user ID when you are prompted for it.
    Note:The user ID and password must already exist at the target; otherwise, the test will fail. For more information, see Creating Authentication Credentials.

Assuming that you want to use the same authentication credentials, follow the same procedure for the SALES database. Again, remember to select SALES in the Alias field for the target. The database alias must match the alias under which the database is cataloged at the satellites.

Creating an Application Version

The next step is to create an application version for the group. An application version is associated with a set of setup, update, and cleanup batches that set up and maintain a specific database definition and data. The database definition and data applies to a specific version of the end-user application that runs on the satellites of a group. For more information about application versions, see Application Versions.

To perform this task, use the Create Application Version window:

  1. In the Version field, specify the application version.

    When the Create Application Version window opens, this field is filled with the default application version (that is, if you have not already created an application version). If the default application version does not match the value that you set on the satellites, change it to match the value on the satellites.

  2. In the Description field, specify a description for the application version.
  3. Click OK.

Creating Level 0 of the Application Version

The next step is to add the first level of batches, level 0, of the application version. You initially use level 0 to contain the set of group batches that set up and maintain the database definition and data for the end-user application. This level is created in the test state.

To perform this task, use the Edit Application Version notebook. The first time that you open this window, it is empty, as the application version does not yet have any levels associated with it:

  1. Click Add to add level 0 to the application version.
  2. When you see the message Are you sure that you want to add a new level, click YES.

When level 0 is first created, it is empty. No batches are associated with it. The next step is to create the batches for the application version.

Editing Level 0 to Create or Modify Group Batches

The next step is to add group batches to level 0. When level 0 is in the test state, all the batches and batch steps you add are fully modifiable. For information about levels of application versions, see Levels of an Application Version.

To perform this task:

  1. Select level 0 in the Edit Application Version window, and click Change.
  2. On each of the Setup, Update, and Cleanup pages of the Change Level notebook:
    1. Specify the name of the batch.
    2. Add or import the scripts that you want to be executed to the Batch steps field:
      • If you already have created scripts in the Satellite Administration Center, click Add to add them to the batch.
      • If you have saved scripts in the Script Center, click Import to import them from the Script Center to the Batch.

You do not have to use all three types of batches. For example, in the initial phase of developing a database definition, you may not consider it necessary to have a cleanup batch. If a particular type of batch is not present when a satellite synchronizes, that batch type will be bypassed.

Changing Batch Steps

The next step is to combine the scripts for the batches with the authentication credentials, execution targets, and success code sets that are required for the scripts to be executed. The combination of a script with the information that it requires for the satellite to be able to execute it is known as a batch step. For more information, see Components of a Batch Step.

To perform this task, use the Change Batch Step notebook.

Repeat the following steps for every script of every batch:

  1. On the Edit Application Version window, select the new level, level 0, and click Change.

    The Change Level notebook opens.

  2. On the Change Level notebook, select the batch page for which you want change batch steps.
  3. Select the batch step with which you want to associate an execution target, a success code set, and an authentication credential, and click Change.

    The Change Batch Step notebook opens.

  4. On the Script page:
    1. Optional. Change the name of the script in the Script field.
    2. Specify a description of the script in the Description field.
    3. Optional. Change the type of target against which the script will execute from the Type radio buttons.
    4. Optional. If you want to import additional scripts from the Script Center, click Import.
    5. Optional. If you want, you can edit the contents of the script in the Script contents box.
    6. Optional. If the script is parameterized, select the Parameterized check box. For more information about parameterization, see Parameterizing Scripts.
    7. Optional. To use a character other than the semicolon (;) as the statement termination character for a script that executes against a DB2 instance or a DB2 database, specify the character in the Statement termination character field.
  5. For a script that executes against a DB2 instance or a DB2 database, on the Execution Target page:
    1. Select the alias of the DB2 instance or DB2 database for the Target alias field. Use the ... button to display the list of targets.
      Note:The alias that you select must be the alias which is cataloged at the satellite.
    2. Select the named set of authentication credentials for Authentication field. The credentials are required by the satellite for its authentication with the target. Use the ... button to display the list of authentications.
  6. On the Success Codes page:
    1. Specify the name of the success code set in the Success codes set name field.
      Note:If you have already created a success code set, you can click ... to list it.
    2. Specify a description for the success code set in the Description field.
    3. Specify the success code set for the script in the Specify codes box.
    4. Click Add to add a success code relation pair to the Specify codes box.
  7. Click OK to exit from the Edit Batch Step notebook.
  8. Click OK to exit from the Change Level notebook.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ Top of Page ]