5.1.1 Environment setup procedure

Executor: HiRDB administrator

This section describes the plug-in environment setup procedure using commands. This procedure assumes that the HiRDB environment setup has been completed (HiRDB is already running).

To set up the plug-in environment:

  1. Estimate the resources needed to install plug-ins.
  2. Terminate the active HiRDB.
  3. Install plug-ins.
  4. Start HiRDB.
  5. Add data dictionary LOB RDAREAs, user RDAREAs, and user LOB RDAREAs.#1
  6. Register plug-ins.
  7. Initialize the registry facility.#2
  8. Terminate HiRDB.
  9. Add the pdplugin operand.
  10. Start HiRDB.
  11. Register registry information.

#1: A data dictionary LOB RDAREA is not necessary if stored functions, stored procedures, or plug-ins are already being used. A user RDAREA (user LOB RDAREA) is required if a table is created for a newly added plug-in.

#2: May not be needed, depending on the plug-in.

Organization of this subsection
(1) Estimating resources
(2) Terminating HiRDB
(3) Installing plug-ins
(4) Starting HiRDB
(5) Adding user RDAREAs
(6) Registering plug-ins
(7) Initializing the registry facility
(8) Terminating HiRDB
(9) Adding the pdplugin operand
(10) Starting HiRDB
(11) Registering registry information

(1) Estimating resources

Before a plug-in can be installed into the HiRDB system, the sizes of the following resources must be estimated:

For details about how to estimate the resources required for each plug-in, see the applicable plug-in documentation.

(2) Terminating HiRDB

Before setting up plug-ins, use the pdstop command to terminate the active HiRDB.

(3) Installing plug-ins

Install your plug-ins. For details about the installation procedure, see the applicable plug-in documentation.

(4) Starting HiRDB

The HiRDB administrator uses the pdstart command to start HiRDB.

(5) Adding user RDAREAs

Before plug-ins are registered into HiRDB, the RDAREA administrator uses the create rdarea statement of the database structure modification utility (pdmod) to add RDAREAs. The following RDAREAs need to be added:

For details about how to add RDAREAs, see 4.7 Creating user RDAREAs, 4.8 Creating user LOB RDAREAs, or 4.9 Creating data dictionary LOB RDAREAs.

If a database environment has already been constructed, there is no need to add RDAREAs after installing plug-ins.

#1: You need to add this RDAREA if you want to create a separate table for plug-ins and store the table in a new RDAREA.
#2: You need to add this RDAREA to make the stored-procedure facility available to HiRDB before the registry facility initialization utility (pdreginit) is executed.

(6) Registering plug-ins

Use the pdplgrgst command to register your plug-ins in HiRDB. You can enter the pdplgrgst command from any server machine.

The following figure illustrates the plug-in registration procedure.

Figure 5-1 Plug-in registration procedure

[Figure]

(a) pdplgrgst command input format

Following shows the input format of the pdplgrgst command:

pdplgrgst plug-in-definition-filename PIC-filename
Example of HiRDB Text Search Plug-in
  • Data type plug-in
    pdplgrgst _phsgml.adt _phsgml.pic
    (Current directory: C:\TSPlugin\_phsgml\etc)
  • Index type plug-in
    pdplgrgst _phngram.idx _phngram.pic
    (Current directory: C:\TSPlugin\_phngram\etc)
Notes
  • To register an index-type plug-in, you need to register the corresponding data type plug-in beforehand.
  • Register both data type and index type plug-ins in the same schema.
(b) Owner of a plug-in

The owner of a plug-in (owner of the abstract data type, index type, and function provided by a plug-in) is treated as MASTER. This allows the authorization identifier to be omitted when specifying the plug-in-provided function call processing using SQL statements.

Specifying a user other than MASTER as the plug-in owner

You can specify the user executing the pdplgrget command as the plug-in owner instead of MASTER. To do this, specify the -u option in the pdplgrget command, in which case the pdplgrget command executor (the authorization identifier specified in the PDUSER operand in the client environment definitions) becomes the owner of the plug-in.

Notes
  1. The pdplgrgst command executor's schema must have already been defined.
  2. If a plug-in provides both abstract data type and index type, be sure to assign the same owner.
  3. Only the plug-in owner can delete or upgrade his/her plug-in. To delete or upgrade a plug-in, specify the -u option in the pdplgrgst command.
  4. If you delete a plug-in owner's schema, the plug-in itself is also deleted. In this case, do the following:
    [Figure]Delete the pdplugin operand from the system common definitions.
  5. When more than one plug-in includes a function that has the same name and number of parameters, you must first register one of the plug-ins, define the function that calls the function in that plug-in, and then register the other plug-ins. However, an error is returned when the plug-in is registered if the function you define declares an abstract data type for a parameter or a return value, and that function is used in a view definition. If this occurs, you must delete the view table that uses that function, and then register the plug-in again.

(7) Initializing the registry facility

Some plug-ins require the registry facility. In such cases, use the registry facility initialization utility's (pdreginit) create rdarea statement to create the following RDAREAs. This operation is not necessary when the registry facility is already being used with plug-ins.

Execute the registry facility initialization utility (pdreginit) only once before all plug-ins are registered.

The registry RDAREA and registry LOB RDAREA store the registry information. Which of the two RDAREAs is used is determined automatically on the basis of the length of the data to be registered.

The following figure illustrates the procedure for creating the registry RDAREA and the registry LOB RDAREA.

Figure 5-2 Procedure for creating a registry RDAREA and registry LOB RDAREA

[Figure]

(8) Terminating HiRDB

To enable a plug-in, HiRDB must be terminated normally by entering the pdstop command. No tables or indexes that use the registered plug-in can be defined until HiRDB has been restarted.

After HiRDB has been terminated, a backup copy should be made of all the updated RDAREAs.

(9) Adding the pdplugin operand

After HiRDB has been terminated normally, add the pdplugin operand in the system common definitions. Specify the name of a plug-in to be used in the pdplugin operand.

For a HiRDB/Parallel Server, you need to add the pdplugin operand in the system common definitions on all server machines; otherwise, you will not be able to start HiRDB.

(10) Starting HiRDB

Use the pdstart command to start HiRDB.

(11) Registering registry information

Once the registry facility has been initialized, registry information required by the plug-in must be registered. The plug-in and the registry facility can then be used. For details about how to register registry information, see the applicable plug-in documentation.