Figure 99 indicates the data flow for the UNLOAD PACKAGE and RELOAD PACKAGE commands.
Note: | PROGRAM is a synonym for PACKAGE. Therefore, UNLOAD and RELOAD PROGRAM are equivalent to UNLOAD and RELOAD PACKAGE. |
Figure 99. Database Services Utility Processing Diagram for UNLOAD and RELOAD PACKAGE
![]() |
VM Format: >>-RELOAD PACKAGE----(package_name)---+-NEW-----------------+---> | .-KEEP---. | '-REPLACE--+--------+-' '-REVOKE-' >-----+--------------------------------+--INFILE----(ddname)--->< | .-,--------------. | | V | | '-TO--(-----server_name---+---)--' VSE Format: >>-RELOAD PACKAGE----(package_name)---+-NEW-----------------+---> | .-KEEP---. | '-REPLACE--+--------+-' '-REVOKE-' >-----+--------------------------------+------------------------> | .-,--------------. | | V | | '-TO--(-----server_name---+---)--' >----INFILE--(--ddname--+---------------------------+-----------> | .-2000--. | '-BLKSZ--(--+-size--+---)---' >-----+----------------------------------+--)------------------>< | .-REWIND---. | | .-(TAPE)--+-NOREWIND-+--. | '-PDEV--+-(DASD)----------------+--' VM Example: RELOAD PACKAGE(JONES.PROG4) REPLACE KEEP TO(RDB2,RDB3) INFILE(IN1) VSE Example: RELOAD PACKAGE(JONES.PROG4) REPLACE KEEP INFILE(IN1) Authorization: You must be the owner of the package |
You can further qualify the package_name with the owner, separating the two names with a period. The name of the package is package_name. If you do not specify the owner, owner defaults to the connected authorization ID. (See Qualifying Object Names for details on accessing data objects that are owned by other users.) The authorization ID is either:
In DB2 Server for VM, this can be specified when you must load the package onto more than one database. To reload the package, the Database Services Utility connects to each specified server-name in turn (using database switching, which requires APPC/VM in multiple user mode). If an LUW is active when the RELOAD command begins, processing is unsuccessful and an error occurs.
When the TO clause is specified, the CONNECT statement is processed with no user ID or password. The attempted connection fails if implicit connections are not allowed on server-name. After the RELOAD is performed on each database, a COMMIT RELEASE (or ROLLBACK RELEASE) is done, releasing the connection to that server-name. The default user ID (the VM user ID) and the default database (as specified to SQLINIT) are reestablished for a new LUW. Any explicit connections done before the RELOAD are therefore lost and must be reissued if required.
If owner was not specified, the VM user ID is assumed, because it is the ID used to connect to each server-name.
When you use TO, the Database Services Utility ignores preceding CONNECT statements and uses the VM user ID as a default. If you do not want to use your VM user ID, issue the explicit CONNECT statements as required, and use the RELOAD command without a TO clause. If you do not specify the TO clause, the Database Services Utility reloads the package onto only the currently connected database.
There is no specific limit on the number of database names typed; however, there is an implied limit in that the maximum length of a Database Services Utility command is 8192 characters.
Alternatively, RELOAD PACKAGE can read its input from SYSIPT by using a READ MEMBER. You use the READ MEMBER NOCONT option to properly close the SYSIPT file. An example of using READ MEMBER with NOCONT is:
RELOAD PACKAGE (package_name) REPLACE INFILE(SYSIPT); READ MEMBER package_member (NOCONT
In DB2 Server for VM: this is the name of the sequential input file defined with a CMS FILEDEF command. Do not specify SYSIN or SYSPRINT as the ddname.
Format: >>-UNLOAD PACKAGE----(package_name)---+----------------------+--> '-FROM--(server_name)--' >----OUTFILE--(--ddname--+--------------------------+-----------> | .-2000--. | '-BLKSZ--(--+-size--+---)--' >-----+-----------------------------------+--)----------------->< | .-NOREWIND--. | | .-(TAPE)--+-REWIND----+--. | '-PDEV--+-(DASD)-----------------+--' VM Example: VSE Example: Authorization: You must be the owner of the package you want to unload. To unload In VM, you must also have CONNECT authority to a specified database. |
The UNLOAD PACKAGE command unloads a specific package to a file. You can unload packages flagged as invalid in the database because RELOAD command processing automatically preprocesses the package again, thus revalidating it. Any unresolved dependencies in the package are then flagged when the RELOAD command preprocesses it again.
Note: | The UNLOAD PACKAGE command is not supported if you are using DRDA flow. |
Following are descriptions of each part of the command:
In DB2 Server for VSE, you can further qualify the package_name with the owner, separating the two names with a period.
The name of the package is package_name. If you do not specify the owner (see Qualifying Object Names for details), owner defaults to the currently connected authorization ID.
The DB2 Server for VM authorization ID is either:
In DB2 Server for VM, this identifies the application server containing the package. To unload the package, the Database Services Utility connects to the specified server_name (using application server switching, which requires APPC/VM in multiple user mode). If an LUW is active, the UNLOAD command fails with an error. When FROM is specified, the CONNECT is attempted with no user ID or password. The attempted connection fails if implicit connects are not allowed on server_name.
After the package is unloaded, a COMMIT (or ROLLBACK) RELEASE is done, releasing the connection to server_name. The default user ID (the VM user ID), and the default database (as specified to SQLINIT) are reestablished for a new LUW. Any explicit CONNECT statements that you issued before the UNLOAD command are therefore lost and must be reissued, if required. When you use FROM, the Database Services Utility ignores any preceding CONNECT statements and uses the VM user ID as a default. If you do not want to use your VM user ID, issue the explicit CONNECT statements as needed, and use the UNLOAD command without a FROM clause.
In DB2 Server for VSE, this is the TLBL or DLBL job control statement file name for the sequential output file.
BLKSZ and PDEV can be specified in any order but must occur after the ddname parameter.
Format: >>-REBIND PACKAGE----(package_name)---------------------------->< Example: REBIND PACKAGE(SMITH.PROG) Authorization: You must be the owner of the package you want to rebind. To rebind |
The REBIND PACKAGE command allows you to repreprocess an existing package immediately without unloading and reloading the package. You can use the REBIND PACKAGE command with single or multiple user mode.
Note: | The REBIND PACKAGE command is not supported if you are using the DRDA protocol. |
Following is the description of the command:
You can qualify the name of the package by specifying the owner of the package; you must, however, have DBA authority to repreprocess a package belonging to another user. If you do not specify the owner, owner defaults to the connected authorization ID. See Qualifying Object Names for details on accessing data objects that are owned by other users.