UDX deployment and delivery

You deploy a UDX to a Db2® instance by building the library it uses and then registering the UDX to use that library. You can package deployed UDXs so that they can easily be transferred to and deployed on other database instances.

Deploy a UDX

To deploy a UDX to a Db2 instance:
 1 
Upload the source files and other files needed by the UDX to a Db2 instance. These uploaded files are stored in your personal Db2 project directory.
 2 
A Db2 instance uses the uploaded source files to create the library file (that is, the file that contains the executable UDX code):
  • It compiles the source files to create object files. In C++, source files have the extension .cpp and include header (.h) files, and object files have the extension .o.
  • It links the object files to create the library file. In C++, static library (.a) files can also be linked. The resulting library file has the extension .so.
The Db2 instance then promotes the library file and any other files that are needed by the UDX to a subdirectory of the project directory called the release directory.
 3 
Register the UDX. Specify its signature, class, and library. You can repeat this step to register additional UDXs that use the same library file.
Deploy a UDX

Transfer a UDX to another instance

To transfer the UDXs in a project directory from one Db2 instance to another:
 4 
Create a package that contains the files in the project's release subdirectory.
 5 
Information about each of the registered UDXs in the project is automatically extracted from the database catalog, stored in a DDL file, and included in the package.
 6 
Transfer the package from the source client system to a target client system.
 7 
Deploy the package to the target Db2 instance.
 8 
The contents of the DDL file in the package is used to automatically register the UDXs in the database catalog on the target instance.
Create a package on the source client system and deploy the package to a target client system