Use the Deploy Routines wizard
to deploy stored
procedures or user-defined functions to a database.
Prerequisites: - To deploy an SQL stored procedure by using binaries from a DB2® for z/OS® V8
server
to a DB2 for z/OS V8
server, PTF JDB881D must be applied to both the source and the target
servers.
- To deploy a Java™ stored
procedure to a DB2 UDB for Linux®, UNIX®,
and Windows® Version 8.1 or 8.2 server, you
must install FixPak 13 or higher
- See the support information for
binary deployment and deployment to unlike servers.
The instructions in this topic apply to routines in a
Data Development
Project and in the Data Source Explorer. If you exported a routine
to the
file system, you can deploy the routine by following the instructions
in the
file called DeployInstructions.txt that was generated
along with export scripts into the file folder that you specified
in the Export
a Routine wizard.
Two types of export scripts are generated:
- An SQL script, which can be used to deploy DB2 for Linux, UNIX,
and Windows SQL stored procedures and DB2 for z/OS native
SQL stored procedures. This script requires the DB2 command
line processor.
- An ANT script which can be used to deploy Java stored procedures and DB2 for z/OS external
SQL stored procedures.
To deploy a routine to a database:
- Switch to the Data perspective.
- Right-click one or more supported data objects or the routines
folder in the Data Project Explorer or Data Source Explorer, and click Deploy from
the pop-up menu. A wizard opens.
- Complete the steps of the wizard. Some of the
fields
in the wizard are populated based on the default settings that are
specified
in the Deploy options preferences pages and some of the fields are
populated
with the values from the routines you want to deploy. If you select
to deploy
to a different server, you can select an existing database connection
or create
a new connection. Connections to supported database servers are the
only connections
that are available in the list of existing connections.
- Click Finish.
The deploy process begins, and you can view the progress and
messages
in the SQL Results view. After the routine is deployed, you can refresh
the Stored
Procedures or User-Defined Functions folder
under the database connection in the Data Source Explorer view to
verify that
the routine was added to the server. If the routine was deployed from
the
Data Project Explorer and the target database is the same database
that is
assigned to the Data Development Project, the Data Project Explorer
view displays
an icon of a wrench next to the routine name to indicate that the
routine
was deployed.