Deploying routines to a database

Use the Deploy Routines wizard to deploy stored procedures or user-defined functions to a database. In some cases, you can create a routine using one server definition, and then deploy it to the same type of server or to a server with a different server definition.
Prerequisites:
You can deploy stored procedures for DB2 for Linux®, UNIX®, and Windows® or DB2 for z/OS in one of two ways:
  • You can deploy binaries that were previously built on the server.
  • You can deploy by doing a full build.

On the Deploy Options page of the Deploy Routines wizard, you specify which of these two deploy options that you want to use.

Restriction: Java™ stored procedures that were built using the legacy driver cannot be deployed using binaries.

The instructions in this topic apply to routines in a Data Development Project and in the Database 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 the export script into the file folder that you specified in the Export a Routine wizard.

To deploy a routine to a database:

  1. Switch to the Data perspective.
  2. Right-click one or more supported data objects or the routines folder in the Data Project Explorer or Database Explorer, and click Deploy from the pop-up menu. A wizard opens.
  3. 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.
  4. Click Finish.
The deploy process begins, and you can view the progress and messages in the Data Output view. After the routine is deployed, you can refresh the Stored Procedures or User-Defined Functions folder under the database connection in the Database 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.
Related tasks
Changing default settings for deploying stored procedures to a DB2 for z/OS database server
Deploying JAR files to a database from a data development project
Related reference
Deploy a Routine wizard
Related information
Importing routines to a project
Exporting routines from a Database Development project to a script

Feedback