2.17 pdclibsync (Manipulate C library files)

Organization of this section
(1) Function
(2) Executor
(3) Format
(4) Options
(5) Rules
(6) Return code
(7) Note
(8) Output format

(1) Function

The pdclibsync command enables you to perform the following operations on C library files:

You use this command when you use C stored procedures or C stored functions.

(2) Executor

HiRDB administrator

(3) Format

(a) HiRDB single server configuration

pdclibsync [{-I|-R|-D|-L}]

          [-U authorization-identifier[,authorization-identifier]...]

          [-f C-library-file-name]

(b) HiRDB parallel server configuration

pdclibsync [{-I|-R|-D|-L|-S}]

          [-x host-name[,host-name]...]

          [-U authorization-identifier[,authorization-identifier]...]

          [-f C-library-file-name]

(4) Options

(a) {-I|-R|-D|-L|-S}

Specifies the processing to be performed by the pdclibsync command.

-I
Registers a new C library file into HiRDB. The C library file is stored in the directory specified in the pd_c_library_directory operand.
When you specify this option, you must also specify the -u and -f options.
If the C library file specified in the -f option has already been registered, executing the command with this option specified will result in an error.
-R
Re-registers a C library file into HiRDB (overwrites the C library file that has already been registered).
When you specify this option, you must also specify the -u and -f options.
-D
Deletes a C library file.
When you specify this option, you must also specify the -u and -f options.
If the C library file specified in the -f option is not registered in HiRDB, executing the command with this option specified will result in an error.
-L
Displays a list of C library files that are registered in HiRDB.
-S
This option is applicable to a HiRDB parallel server configuration only.
Re-registers a C library file on the server machine specified in the -x option into all server machines that constitute a HiRDB parallel server configuration. If the -x option is omitted, the command copies the C library file located on the server machine where the dictionary server is defined.
For example, if you use this option when you add a server machine, you can register a C library file into that sever machine.

The table below shows the relationships between the options of the pdclibsync command.

Table 2-1 Relationships between the options of the pdclibsync command

Option for specifying the type of C library file manipulationOther option
-x-u-f
-IOMM
-ROMM
-DOMM
-LOOO
-SO#OO
Legend:
M: Specification is mandatory
O: Specification is optional
#: If you specify the -x option, specify only one host name.
(b) -x host-name[,host-name]...

This option is applicable to a HiRDB parallel server configuration only.

[Figure]-S option is specified
Specifies the host name on the server machine that contains the source C library file. No more than one host name can be specified.
If this option is omitted, the host name of the server machine where the dictionary server is defined is assumed.
[Figure]An option other than -S is specified
Specifies the hosts that are to be processed by the pdclibsync command (when you wish to limit the hosts that are to be processed by the command).
For example, if you specify the -D option to delete a C library file and also specify the -x option, the C library file is deleted only on the specified host (or hosts).
(c) -U authorization-identifier[,authorization-identifier]...

Specifies authorization identifiers. Neither MASTER nor HiRDB can be specified as an authorization identifier.

When you specify the -I, -R, or -D option, you must specify this option.

[Figure]-I option is specified
Specifies the authorization identifier of an owner of the C library file. This is the authorization identifier of the owner of a C stored procedure or C stored function.
Only the HiRDB administrator and a user whose authorization identifier is specified here can manipulate the registered C library file.
[Figure]An option other than -I is specified
Specifies the authorization identifier of a user who owns the C library file that is to be processed by this command.
(d) -f C-library-file-name

Specifies the name of the C library file that is to be manipulated.

When you specify the -I, -R, or -D option, you must specify this option.

If you specify the -S or -L option but omit this option, all registered C library files will be subject to this command's manipulation.

(5) Rules

  1. You can execute the pdclibsync command regardless of whether HiRDB is active.
  2. You can execute the pdclibsync command from any server machine.
  3. Do not execute the pdclibsync command again while it is already executing.

(6) Return code

The following are the pdclibsync command's return codes:

0: Normal termination
4: Abnormal termination
This code is returned if the command terminates abnormally before it processes the specified C library file(s).
For example, this code is returned if an attempt is made to register a new C library file but the specified file has already been registered, or if an attempt is made to delete a C library file that cannot be found.
8: Abnormal termination
This code is returned if the command terminates abnormally while processing the specified C library file(s).
When this code is returned, check the displayed message, eliminate the cause of the error, and then re-execute the command. Note that this code may be returned because a C library file has become corrupted. Display a list of C library files and check if any of files has an unusual file size; such a file might be corrupted, in which case you must take appropriate action (such as re-registering the C library file).

(7) Note

  1. While transaction processing is underway, do not attempt to register or delete a C library file that might contain a C function used by a C stored routine executed within an executing transaction.

(8) Output format

When the -L option or no option is specified in the pdclibsync command, the following information is displayed:

HOSTNAME(aabbcc)  DATE        TIME       SIZE    OWNER   FILE
dd...d            eeee/ff/gg  hh:ii:jj   kk...k  ll...l  mm...m
   :                :            :         :       :       :

Explanation

aabbcc:
Displays the time the pdclibsync command was executed.
dd...d:
Displays the name of the host that executed the pdclibsync command.
eeee/ff/gg:
Displays the date of the C library file.#
hh:ii:jj:
Displays the time of the C library file#
kk...k:
Displays the size of the C library file (bytes).
ll...l:
Displays the name of the C library file's owner.
mm...m:
Displays the name of the C library file.

#: If the C library file was registered or re-registered by an SQL statement (INSTALL CLIB or REPLACE CLIB), the date and time the SQL statement was executed are displayed. If the C library file was registered or re-registered by the pdclibsync command, the date and time the C library file was registered or re-registered are displayed.