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.
Procedure
To migrate an external stored procedure from a test environment to production:
- 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.
- Depending on your change management policy, complete the appropriate task.
- To migrate the stored procedure without recompiling:
- Copy the CREATE PROCEDURE statement.
- Modify the CREATE PROCEDURE statement to reflect the new schema, new collection ID and new WLM application environment.
- 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.
- 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.
- 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:
- Copy the CREATE PROCEDURE statement.
- Modify the CREATE PROCEDURE statement to reflect the new schema, new collection ID and new WLM application environment.
- 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.
- Copy the source code.
- Precompile, compile, and link-edit. This step produces a DBRM and a load module.
- 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.
- Refresh the WLM application environment.
- To migrate the stored procedure without recompiling: