Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

24.5.3 Operation using the facility for automatically loading audit trail table data

Organization of this subsection
(1) Referencing the audit trail table
(2) Timing for starting and stopping the facility for automatically loading data
(3) Operation example that temporarily stops the facility for automatically loading data
(4) HiRDB termination when the facility for automatically loading data is used
(5) HiRDB behavior when the facility for automatically loading data stops during data loading
(6) Behavior of HiRDB when data loading terminates in an error instead of finishing
(7) Notes

(1) Referencing the audit trail table

When the facility for automatically loading audit trail table data is used, the audit trail table can be referenced based on a NOWAIT search even while the pdload command is loading data.# When you reference the audit trail table, specify WITHOUT LOCK NOWAIT for the SQL's lock option. If the audit trail table is referenced without the SQL lock option specified, an SQL that tries to access the audit trail table while the pdload command is executing might be placed on lock-release wait status, or the pdload command that is trying to load data to the audit trail table being searched by means of the SQL code might time out on lock-release wait. This results in abnormal termination of the pdload command.

When a retryable error occurs, such as a time-out on lock-release wait, the facility for automatically loading data reloads data, but stops if the error keeps occurring. In this case, the facility for automatically loading data must be manually restarted. For details about the actions to take according to the error contents, see Table 24-38 Description of errors that might occur during automatic data loading and the corrective actions to take.

#
If the pdaudload command is loading data in the batch index creation mode or by using a local buffer, the audit trail table cannot be referenced based on a NOWAIT search. The following table shows when the audit trail table can be referenced, depending on the search method used:
Search method When data is not being loaded When data is being loaded
Buffer used by the pdload command Index creation method used by the pdload command
Global Local Simultaneous Batch
NOWAIT search Y Y N Y N
Other searches Y N N N N
Legend:
Y: The audit trail table can be referenced.
N: The audit trail table cannot be referenced (stays in lock-release wait status until data loading is finished).

(2) Timing for starting and stopping the facility for automatically loading data

The facility for automatically loading audit trail table data starts and stops at the following times:

In the cases listed below, the facility for automatically loading data stops immediately. For audit trail files into which data was not loaded, data is loaded when the pdstart or pdaudatld command is executed the next time around.

The pdaudatld command controls restarting and stopping the facility for automatically loading audit trail table data. For details, see the manual HiRDB Version 9 Command Reference.

#
If the unit in which the system manager is located goes down, the facility for automatically loading data starts when HiRDB restarts. If a unit in which the pdload command has not been executed goes down, the facility for automatically loading data does not stop.
For details about operations when an error occurs, see 24.11 Actions to take when an error occurs while the facility for automatic loading is being used.

(3) Operation example that temporarily stops the facility for automatically loading data

The auditor can use the pdaudatld command to temporarily stop the facility for automatically loading data at any point in time. This operation example explains the procedure for temporarily stopping the facility for automatically loading data, and then backing up the content of the audit trail table by saving it into an unload log file either when the facility is stopped or when the day's jobs are finished.

Procedure
[Figure]

Explanation
  1. Execute the pdaudatld -t command to stop the facility for automatically loading data. As a result, no data is loaded into the audit trail table until the facility restarts the next time around (the period indicated by (a) in the figure). If the pdaudatld -t command is executed while data is being loaded, the facility stops after data loading is finished.
    When the facility stops normally, the contents of all audit trail files that were waiting for data loading until the execution of the pdaudatld -t command are loaded into the audit trail table.
  2. Execute the pdls -d aud command to check the status of the audit trail files that went into data-load wait status after the facility was stopped in step 1, and to check the status of the current audit trail file.
  3. Execute the pdaudswap command to swap the current audit trail file and place it in data-load wait status.
  4. Execute the pdload command to load data from the audit trail file that was placed in data-load wait status into the audit trail table.
  5. Execute the pdrorg command to unload the content of the audit trail table at this point in time to an unload data file.
  6. The content of the audit trail table is no longer necessary since it was output to an unload data file. Delete the data from the audit trail table to prevent a capacity shortage from stopping the facility for automatically loading data.
  7. Execute the pdaudatld -b command to restart the facility for automatically loading data.

(4) HiRDB termination when the facility for automatically loading data is used

When the facility for automatically loading audit trail table data is used, the behavior of HiRDB during termination might change. The following table describes the behavior of HiRDB for each type of termination and the corrective action to take in each case.

Table 24-13 HiRDB behavior during termination when the facility for automatically loading audit trail table data is used

Type of termination Automatic data loading execution status HiRDB behavior Corrective action
Termination processing Operating status of the facility for automatically loading data#1
Normal system termination (pdstop execution)
or
planned system termination (pdstop -P execution)
Not executed Same as when the facility for automatically loading data is not used Keeps ENABLE. --
Executing
  • Displays the message KFPS05719-W.
  • After all data has finished loading, the normal termination processing begins (the message KFPS05720-I is displayed when data loading into the audit trail table is completed).

  • Changes to DISABLE (WAIT).
  • If audit trail file swapping occurs, data loading is re-executed before HiRDB stops if the pdstop command is not yet executed, or when HiRDB starts the next time around if the pdstop command has been executed.
Forced system termination (pdstop -f execution) Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing
  • Keeps ENABLE.
  • Data loading being executed abnormally terminates simultaneously with the forced system termination.
  • For an audit trail file from which data was being loaded, data is reloaded when HiRDB starts the next time around.
Normal non-manager unit termination (pdstop -u or -x)#4 Unit containing the audit trail table, or unit containing an audit trail file from which data is automatically being loaded Not executed. Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing The unit does not terminate normally. The message KFPS05070-E or KFPS05234-E is displayed and the pdstop command terminates in error. To stop the applicable unit normally, first use the pdaudatld -t command to stop the facility for automatically loading data, and then execute the pdstop -u/-x command.
All other units Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing
Forced non-manager unit termination (pdstop -z or -z -q)
Abnormal termination#2, #4
Unit containing the audit trail table, or unit containing an audit trail file from which data is automatically being loaded Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing
  • Changes to DISABLE (WAIT).
  • The message KFPS05713-E is displayed.
  • Data loading being executed terminates in an error or abnormally terminates simultaneously with the forced unit termination.
  • For an audit trail file from which data was being loaded, data is reloaded after the facility for automatically loading data restarts the next time around.
To restart the facility for automatically loading data, execute the pdaudatld -b command.
All other units Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing
Forced manager unit termination (pdstop -z or -z -q)
Abnormal termination#2, #4
Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE even after the manager unit is restarted. --
Executing
  • Keeps ENABLE even after the manager unit is restarted.
  • Data loading being executed abnormally terminates simultaneously with the forced unit termination.
  • For an audit trail file from which data was being loaded, data is reloaded after the manager unit restarts the next time around.
Normal server termination (pdstop -s or -u -s)#4 Server containing the audit trail table Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing The server does not terminate normally. The message KFPS05071-E or KFPS05235-E is displayed and the pdstop command terminates in error. To stop the applicable server normally, first use the pdaudatld -t command to stop the facility for automatically loading data, and then execute the pdstop -s/-u -s command.
All other servers Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing
Forced server termination (pdstop -s -f, -s -z or -u -s -z)#3, #4 Server containing the audit trail table Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing
  • Changes to DISABLE.
  • The message KFPS05713-E is displayed.
  • Data loading being executed terminates in an error or abnormally terminates simultaneously with the forced server termination.
  • For an audit trail file from which data was being loaded, data is reloaded after the facility for automatically loading data restarts the next time around.
To restart the facility for automatically loading data, execute the pdaudatld -b command.
All other servers Not executed Same as when the facility for automatically loading data is not used. Keeps ENABLE. --
Executing

Legend:
--: No specific action is required.
Manager unit: Unit in which the system manager is located.
Non-manager unit: Unit in which the system manager is not located.

#1
One of the following statuses is displayed when the pdaudatld -i command is executed:
ENABLE: Enabled
DISABLE (WAIT): Stopping
DISABLE: Stopped

#2
System-switching triggers include forced unit termination.

#3
Includes forced server termination by the standby-less system switchover (effects distributed) facility.

#4
Applicable only to a HiRDB parallel server configuration.

(5) HiRDB behavior when the facility for automatically loading data stops during data loading

When the facility for automatically loading audit trail table data is used, it can be stopped using the pdaudatld -t command, but the timing for stopping it varies depending on the automatic data loading execution status. The following table describes the behavior of HiRDB when the facility for automatically loading data is stopped.

Table 24-14 HiRDB behavior when the facility for automatically loading data is stopped

Automatic data loading execution status HiRDB behavior
Behavior when the pdaudatld -t command is executed Behavior of automatic data loading
Not executed
  • Immediately stops the facility for automatically loading data and displays the message KFPS05712-I.
--
Executing
  • Displays the message KFPS05719-W and waits to stop the facility for automatically loading data until data loading finishes (the message KFPS05720-I is displayed when data loading finishes).
  • Stops the facility for automatically loading data and displays the message KFPS05712-I.

  • For audit trail files that were waiting for data loading until the execution of the pdaudatld -t command, data loading is executed.
  • For audit trail files that went into data-load wait status after the pdaudatld -t command, data loading is executed when the pdstart or pdaudatld -b command is executed the next time around.

Legend:
--: No specific action is required.

(6) Behavior of HiRDB when data loading terminates in an error instead of finishing

In cases (4) and (5) above, another command (pdstop or pdaudatld -t) might be waiting for data loading into the audit trail table to be completed. When data loading is completed, command execution resumes, but if data loading terminates in error, command execution resumes without waiting for data loading completion. The following table describes the behavior of HiRDB when data loading terminates in error.

Table 24-15 HiRDB behavior when data loading terminates while waiting for data loading to the audit trail table to be completed

Command waiting for data loading completion to the audit trail table Data loading termination status
Normal termination Error termination
pdstop
  • When data loading finishes, the message KFPS05720-I is displayed.
  • HiRDB's termination processing is performed (the command termination code is 0).

  • When an error occurs, the message KFPS05721-W is displayed.
  • HiRDB's termination processing is performed without waiting for data loading to finish (the command termination code is 0).
pdaudatld -t
  • When data loading finishes, the message KFPS05720-I is displayed.
  • Stops the facility for automatically loading audit trail table data (the command termination code is 0).

  • When an error occurs, the message KFPS05721-W is displayed.
  • HiRDB's termination processing is performed without waiting for data loading to finish (the command termination code is 4).

(7) Notes

(a) Be careful to avoid a space shortage in the audit trail table

When the facility for automatically loading audit trail table data is used, there is no need to manage audit trail files (except when input/output errors occur). However, care must be taken to prevent a space shortage from occurring in the RDAREA storing the audit trail table.

As long as audit trails are being recorded in audit trail files, data loading automatically continues; therefore, if a space shortage occurs in the RDAREA storing the audit trail table, data can no longer be loaded and the facility for automatically loading data stops.

If the facility for automatically loading data stops, first delete unnecessary data or expand the RDAREA, and then restart the facility for automatically loading data. For details about the actions to take, see Table 24-38 Description of errors that might occur during automatic data loading and the corrective actions to take.

(b) When 0 is specified for the pd_lck_wait_timeout operand

If the audit trail table is swapped while data is being loaded from an audit trail file, the swapped-in audit trail table is placed in lock-release wait status until processing of the earlier audit trail file is complete. During this time no data can be loaded.

If the lock-release wait status lasts a long time for a reason such as an error in the earlier data loading process, the number of audit trail files waiting for data loading might increase. If 0 is specified for the pd_lck_wait_timeout operand, audit trail files wait until the lock-release wait status is cleared. Therefore, use the pdaudatld command to monitor the status of audit trail files.

(c) About the user who executes automatic data loading

When HiRDB loads data from audit trail files, the pdload command does not check the privileges of the executing user, and therefore no audit record from a privilege check is output. Note that the length of the user identifier that is output in an audit record at even termination is 0 bytes.