2.107 pdsetup (Register or delete HiRDB system in OS)

Organization of this section
(1) Function
(2) Executor
(3) Format
(4) Options
(5) Command arguments
(6) Rules
(7) Notes

(1) Function

The pdsetup command registers a HiRDB system under the HiRDB directory into the OS so that part of the HiRDB system is started or terminated when the OS is started or terminated. This command can also copy the load module of an installed HiRDB into a specified HiRDB directory.

(2) Executor

Superuser

(3) Format

(a) HiRDB single server configuration

/opt/HiRDB_S/bin/pdsetup
  [{ -d [-f]|[-c character-code-type][-v {recom|v0904}]}]
   HiRDB-directory

(b) HiRDB parallel server configuration

/opt/HiRDB_P/bin/pdsetup
  [{ -d [-f]|[-c character-code-type][-v {recom|v0904}]}]
   HiRDB-directory

(4) Options

(a) -d

Specifies that the HiRDB system under the HiRDB directory is to be deleted from the OS. When this option is omitted, the HiRDB system is registered into the OS.

If you specify the -d option, the following message is displayed, asking whether or not to delete the files required for HiRDB execution:

KFPS00036-Q Specify whether to delete files necessary for execution from specified HiRDB home directory?

[y: Yes, n: No]

If you enter y, the command deletes the files and directories required for HiRDB execution. In this case, the files required for HiRDB execution will be copied from the installation directory the next time the pdsetup command is executed.

If you enter n, the command does not delete the files or directories.

Enter y in the following cases:

Rules
  1. When the -d option is specified, deletion of the HiRDB directory from the OS may fail if that directory is in use. If this happens, use the rm command to delete the applicable files and directories from the OS.
  2. If you specify -d option and enter y as a response and if there are many HiRDB-created files in the HiRDB directory, command execution may take some time. In this case, use the rm OS command or the pdcspool -d 0 command to delete any unneeded files beforehand.
  3. If you are deleting the HiRDB directory, be sure to terminate any UAP that is using Java Virtual Machine (JVM). Otherwise, the HiRDB directory may not be deleted completely. In this case, use the rm OS command to delete the HiRDB directory.
  4. If you delete the HiRDB system from the OS, all shared memory used by the HiRDB system is released.
(b) -f

Specifies registration and deletion of HiRDB from the operating system. The -f option can be specified only in combination with the d option. Even when HiRDB is running or is being abnormally terminated, this option can force the registration and deletion of the HiRDB from the operating system. If this option is omitted, any HiRDB processing is immediately suspended. The load modules stored in the HiRDB directory are not deleted. This option should be specified only when the pdstop -f command cannot be accepted. Normally, the pdsetup -d command should be executed after stopping the HiRDB system using the pdstop command. If the -f option is specified, some of the HiRDB processes may remain unstopped. If this happens, use the ps command of the operating system to locate those processes and use the kill command to delete them. Without this action, the HiRDB system may fail to start when the pdsetup command is executed the next time.

(c) -c character-code-type

~<Other than Linux: sjis> or <Linux: ujis>

Specifies the type of character encoding used by the HiRDB system:

sjis
Shift JIS Kanji Code
chinese
EUC Chinese Kanji Code
chinese-gb18030
Chinese Kanji Code (GB18030)
ujis
EUC Japanese Kanji Code
utf-8
Unicode (UTF-8)
According to the ISO/IEC 10646 standard, a range of from 1 to 4 bytes is assigned to each character, and bytes 5 and 6 are reserved for future standardization. Although HiRDB supports a range of from 1 to 6 bytes for each character, problems might arise in the future if you use bytes 5 to 6, to which no characters have been assigned.
utf-8_ivs: Unicode (IVS-supported UTF-8)
According to the ISO/IEC 10646 standard, characters are assigned using the byte range 1 to 4, and bytes 7 and 8. Bytes 5, 6, 9, and 10 are reserved for future use and no characters are assigned. Therefore, problems might arise in the future if you use bytes 5, 6, 9, or 10, to which no characters have been assigned.
lang-c
Single-byte character code
Rules
  1. If this option is specified when the HiRDB directory and installation directory are different, and if the HiRDB directory already contains lib, the -c option is ignored and the previous character code setting is inherited.
  2. To change the character code setting, execute pdsetup -d to delete the HiRDB directory once from the OS, and then re-execute pdsetup -c. Note that the -c and -d options are mutually exclusive. If both of them are specified, the -c option is ignored.
  3. In a HiRDB parallel server configuration, specify the same character encoding for all servers.
(d) -v {recom|v0904}

In HiRDB, the default values for system definition operands might change from one version to the next. This option specifies the default operation when operands are omitted:

recom: Recommended mode
v0904: 0904 compatibility mode
Rules
  1. If this option is omitted, the KFPS00073-Q message is displayed. Use the displayed message to select a default operation for when operands are omitted.
  2. If the following conditions are all satisfied, the previous default operation is inherited, in which case the KFPS00073-Q message is not displayed:
    • This option is omitted.
    • The HiRDB directory differs from the installation directory.
    • The last time the pdsetup -d command was executed, n was entered as the response to the KFPS00036-Q message.
  3. For the selected operation to be applied when operands are omitted, the same value must be specified in all units in the HiRDB system.

(5) Command arguments

Specifies the HiRDB directory used to install the HiRDB system. In the case of a multi-HiRDB system, this command must be executed for each HiRDB system with the appropriate HiRDB directory specified.

Do not specify a symbolically linked HiRDB directory.

(6) Rules

  1. The pdsetup command can be executed only while HiRDB is shut down.
  2. The pdsetup command must be executed at each server machine.

(7) Notes

  1. The following are the pdsetup command's return codes:
    0: Normal termination
    1: Privilege error, file creation error, locking error, etc.
  2. The following notes apply to /etc/inittab:
    PlatformNotes
    HP-UX, AIX, Solaris, and Linux (Linux 5 or earlier)
    • The pdsetup command adds the character string containing the HiRDB directory specified in the pdsetup command to the last line of /etc/inittab during registration processing and deletes the character string from /etc/inittab during deletion processing. Therefore, if a HiRDB system is re-registered after it has been deleted from the OS, the registration order might change. Note that if the registration order has changed, the process start order during OS startup also changes.
    • Do not use an editor to edit /etc/inittab while the pdsetup command is executing. Also, do not execute the pdsetup command or OpenTP1's dcsetup command for more than one HiRDB on the same machine at the same time. If you do, the contents of /etc/inittab may be damaged. If the contents of /etc/inittab are damaged, a backup file named inittabX (X: 1, 2, or 3) is saved under $PDDIR/conf/inittab. In this case, use the following procedure to recover /etc/inittab:
    1. Log in as the superuser.
    2. Copy the files to be recovered from $PDDIR/conf/Inittab to /etc/inittab.
    3. Execute /etc/init q.
    Linux (Linux 6 or later)
    • You can check the results of the pdsetup command by checking for a file whose name contains HiRDB-directory-name/bin/pdd.
  3. In the case of HiRDB version 07-03 or later, the jre directory is not created under the HiRDB directory when the pdsetup command is executed because the Java execution environment (JRE) is not included. If you use Java stored routines, you must acquire JRE.
  4. If you change HiRDB's character encoding, you must re-create the database by executing the database initialization utility. However, there is no need to re-create the database in the following cases:
    • Changing from IVS-unsupported UTF-8 to IVS-supported UTF-8
    • Changing from IVS-supported UTF-8 to IVS-unsupported UTF-8
    If you have made either of these changes, execute ALTER ROUTINE ALL to re-create the SQL objects for functions, procedures, and triggers. For a function, procedure, or trigger that specifies a scalar function whose arguments are all literals, the expected results might not be obtained unless the SQL object is re-created.
    Also check and revise (if necessary) the value of the pd_substr_length operand in the system common definition. For details about the pd_substr_length operand, see the manual HiRDB Version 9 System Definition.