Deployment Considerations for DB2 for zSeries

Many of the deployment considerations and techniques for DB2 on LUW also apply to DB2 on zSeries. The skills and tools you have learned for DB2 LUW can be leveraged for zSeries.

Deploying SQL Procedures

In order to build an SQL stored procedure on zSeries, you can use JCL or the DB2 Development Center. Issuing the CREATE PROCEDURE statement only registers the procedure to the DB2 catalog; however, it does perform the compilation and bind steps required for the procedure to be ready to be executed. If you store your CREATE PROCEDURE statements in a script file and execute this script from the CLP at the DB2 client machine while connected to a DB2 for zSeries subsystem, you will receive an error and the procedures will not build. Therefore, in order to deploy SQL procedures on zSeries, we recommend you use the DB2 Development Center. The methodology for using the Development Center to deploy a stored procedure is similar to LUW:

  • Use the Export function to generate a file containing the CREATE PROCEDURE statements. Though the resulting script cannot be used to build the stored procedure from the command line, you can use it as a base for a JCL job that can include bind and compilation steps.

  • Use the Import function from a file that was exported from another zSeries system. By using this function, all the bind and compilation steps will be handled by the Development Center. As explained earlier, Import can only be used one stored procedure at a time.

  • Use the Deploy function to deploy directly one or more stored procedures from a source DB2 subsystem to a target DB2 subsystem. This is the recommended method for zSeries, and is explained in more detail later in this chapter.

Deploying Functions and Triggers

In order to build functions on zSeries, you can use CREATE FUNCTION. Unlike stored procedures, this statement is enough to register and build the function. Therefore, in order to deploy functions on zSeries, you can include in a script file all the CREATE FUNCTION statements and execute them from the command line, either using SPUFI or from a DB2 LUW client connected to the DB2 for series zSeries subsystem. Moreover, there is no support in the Development Center to work with functions on zSeries.

Similar to functions, a CREATE TRIGGER statement is enough to register and build a trigger on zSeries. Triggers can only be deployed from the command line; the Development Center cannot be used because there is no support to develop triggers from this tool.


As with LUW, we recommend you create separate scripts for functions and triggers. SQL stored procedures cannot be deployed with scripts.

Deployment Considerations Based on Your C Compiler Requirements

A DB2 for zSeries SQL stored procedure is converted into a C language program as part of the build process. To deploy a procedure from a source DB2 for zSeries subsystem to a target DB2 for zSeries subsystem, you need to consider if the target system has a C/C++ compiler enabled or not. If the target system does not have a C/C++ compiler enabled, a methodology similar to deploying other programs on the mainframe can be followed:

  1. Copy the load module (executable) from the source to the target.

  2. Copy the DBRMs from the source to the target.

  3. Bind the DBRMs to create a package in the target database.

  4. Issue the CREATE PROCEDURE statements from the mainframe to register the procedure in the DB2 catalog of the target database. You may need to change the WLM environment, schema, and collection ID for the target subsystem.

  5. Grant execute authorization on the stored procedure.

If you were developing your procedures using the Development Center, the Export option can be used to extract the CREATE PROCEDURE statements. If the Development Center was not used, these statements are stored in the source DB2 subsystem catalog table SYSIBM.SYSROUTINES_SRC.

This method will not work for zSeries UDFs and triggers where CREATE FUNCTION and CREATE TRIGGER not only register these objects but also create the corresponding packages using a C compiler; therefore, they cannot be deployed if the target system does not have this compiler.

If the target system does have a C/C++ compiler enabled, in addition to the method already mentioned, the methods described in earlier sections of this chapter can be followed.

    DB2 SQL PL. Deployment and Advanced Configuration Essential Guide for DB2 UDB on Linux., UNIX, Windows, i5. OS, z. OS
    Intelligent Enterprises of the 21st Century
    ISBN: N/A
    EAN: 2147483647
    Year: 2003
    Pages: 205 © 2008-2017.
    If you may any questions please contact us: