Migrating external stored procedures from test to production

Use the CREATE PROCEDURE statement to migrate external stored procedures from a test environment to a production environment.

About this task

For Java™ stored procedures, you also can use IBM Data Studio to do a binary deploy of the stored procedure. The binary deploy capability promotes Java stored procedures without recompiling. The binary deploy capability copies all necessary components from one environment to another and performs the bind in the target environment.

Procedure

Begin general-use programming interface information.To migrate an external stored procedure from a test environment to production:

  1. Determine the change management policy of your site.
    You can choose to recompile to create new object code and a new package on the production server, or you can choose not to recompile.
  2. Depending on your change management policy, complete the appropriate task.
    • To migrate the stored procedure without recompiling:
      1. Copy the CREATE PROCEDURE statement.
      2. Modify the CREATE PROCEDURE statement to reflect the new schema, new collection ID and new WLM application environment.
      3. Define the stored procedure with the new CREATE PROCEDURE statement. You can use the IBM®-supplied programs DSNTIAD or DSNTEP2.
        Note: Make sure that the schema, collection ID and WLM application environment correspond to the new environment or code level.
      4. Copy the DBRM and bind the DBRM to produce a Db2 package.
        Note: Make sure that the collection ID of the BIND statement and collection ID of the CREATE PROCEDURE statement are the same.
      5. Copy the load module and refresh the WLM application environment.
    • To migrate the stored procedure and recompile to create new object code and a new package on the production server:
      1. Copy the CREATE PROCEDURE statement.
      2. Modify the CREATE PROCEDURE statement to reflect the new schema, new collection ID and new WLM application environment.
      3. Define the stored procedure with the new CREATE PROCEDURE statement. You can use the IBM-supplied programs DSNTIAD or DSNTEP2.
        Note: Make sure that the schema, collection ID and WLM application environment correspond to the new environment or code level.
      4. Copy the source code.
      5. Precompile, compile, and link-edit. This step produces a DBRM and a load module.
      6. Bind the DBRM to produce a Db2 package.
        Note: Make sure that the collection ID of the BIND statement and collection ID of the CREATE PROCEDURE statement are the same.
      7. Refresh the WLM application environment.
      End general-use programming interface information.