1.2.4 Terminating HiRDB during OS shutdown

If an OS shutdown occurs during HiRDB operation, databases may be damaged depending on the shutdown's timing. This subsection describes how to terminate HiRDB when the OS is shut down. In the case of the AIX 5L version of HiRDB, an OS shutdown does not damage databases.

There are two ways to terminate HiRDB during an OS shutdown; you use the pdsetup command to specify the appropriate settings. Normally, you use the settings for explicit forced termination of HiRDB during an OS shutdown.

Organization of this subsection
(1) Explicit forcible termination of HiRDB during an OS shutdown
(2) Terminating HiRDB normally during OS shutdown, or terminating HiRDB during OS shutdown depending on whether or not termination of the OS is forced

(1) Explicit forcible termination of HiRDB during an OS shutdown

For explicit forcible termination of HiRDB during an OS shutdown, execute the following pdsetup command:

pdsetup -k on HiRDB-directory-name

(2) Terminating HiRDB normally during OS shutdown, or terminating HiRDB during OS shutdown depending on whether or not termination of the OS is forced

To terminate HiRDB normally during OS shutdown, or to terminate HiRDB during OS shutdown depending on whether or not the OS is terminated forcibly, execute the following pdsetup command:

pdsetup -k off HiRDB-directory-name

(a) Terminating HiRDB normally during OS shutdown

Specific conditions must be met in order to terminate HiRDB normally. You must also create and register an rc script.

Conditions for normal termination
To terminate HiRDB normally, the following conditions must be met:
  • No users can be connected to HiRDB.
  • There can be no uncompleted transactions.
  • In the case of a HiRDB/Parallel Server, no unit that does not contain the system manager can have been terminated forcibly or abnormally.
Creating and registering an rc script
Create and register the following rc script:
Contents of the rc script
Create an rc script that executes the following procedure:
  1. Terminates all clients connected to HiRDB.
  2. Executes the pdstop command to effect normal termination of HiRDB.
  3. If normal termination fails in step 2 (return code is not 0), executes the pdstop -f command to terminate HiRDB forcibly.
Location where the rc script is registered
Register the created rc script at the following location:
PlatformLocation of registration
HP-UX/sbin/init.d/xxxx
/sbin/rc1.d/Kyyyxxxx
(Symbolic link to sbin/init.d/xxxx)
Solaris/etc/init.d/xxxx
/etc/rc0.d/Kyyyxxxx
/etc/rc1.d/Kyyyxxxx
(Symbolic link to etc/init.d/xxxx)
Linux/etc/init.d/xxxx
/etc/rc0.d/Kyyyxxxx
/etc/rc1.d/Kyyyxxxx
/etc/rc6.d/Kyyyxxxx
(Symbolic link to etc/init.d/xxxx)
Legend:
xxxx:
Any name
Kyyyxxxx:
K indicates the script that is to run during termination. yyy indicates a numeric value in the range from 000 to 999; the rc scripts are executed in ascending order of this value. xxxx indicates any name.
(b) Terminating HiRDB during OS shutdown depending on whether or not the OS termination is forced

If HiRDB termination depends on whether or not termination of the OS was performed forcibly, databases may be damaged depending on when the shutdown occurs. For this reason, you should make sure that you perform explicit forced termination of HiRDB during an OS shutdown.