2.78 pdmemdb (In-memory data processing operations)

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

(1) Function

The pdmemdb command enables you to do the following:

You can use the pddbls -M command to check the pdmemdb command's execution result.

(2) Executor

HiRDB administrator

(3) Format

 pdmemdb -k processing-type {-r RDAREA-name[,RDAREA-name]...|-r ALL}
                      [-p page-specification-type][-d][-W execution-monitoring-interval]

(4) Options

(a) -k processing-type

Specifies the processing to be performed by the pdmemdb command.

stay:
RDAREAs specified in the -r option are to be placed in memory.
rels:
RDAREAs specified in the -r option are to be released from memory.
reload:
Data is to be reloaded into the in-memory data buffers from the in-memory RDAREAs specified in the -r option.
cancel:
Update information is to be discarded from the in-memory data buffers allocated for the in-memory RDAREAs specified in the -r option.

The status of in-memory data buffers and RDAREAs after execution of the pdmemdb command depends on the option that is specified. For details, see Table 2-13 Prerequisites for pdmemdb command execution (status of in-memory data buffers and target RDAREAs).

(b) -r RDAREA-name[,RDAREA-name]... ~<identifier> ((1-30))

Specifies the names of the RDAREAs that are to be processed.

The pdmemdb command results in an error if any of the following RDAREAs is specified:

Do not specify a table to be expanded to the memory database or an index defined for such a table. If a table to be expanded to the memory database or an index defined for such a table is placed in memory and HiRDB is terminated forcibly while using the in-memory data buffer, all data in the memory database since the last time in-memory data was released might be lost. For details, see Notes about using this command together with the rapid batch facility in the HiRDB Version 9 Memory Database Installation and Operation Guide.

Rules
For the rules for specifying RDAREAs, see 1.5.2 Specification of RDAREAs in operation commands and utilities.
(c) -r ALL

Specifies that the command is to apply the processing specified in the -k option to all RDAREAs on which that processing can be performed.

You can use this option to release all in-memory RDAREAs from memory with one operation.

If you specify this option when you are placing RDAREAs in memory, unneeded RDAREAs might be placed in memory, so we recommend that you not specify this option when you are placing RDAREAs in memory.

Note
Do not specify -r ALL if there is an RDAREA that contains an audit trail table, a falsification prevented table, or a table to be expanded to the memory database, or an index defined for such a table. If -r ALL is specified in such a case, the RDAREA containing the audit trail table or falsification prevented table will also placed in memory. For the reasons why an RDAREA containing an audit trail table or a falsification prevented table must not be placed in memory, see (7) Notes. If a table to be expanded to the memory database or an index defined for such a table is placed in memory and HiRDB is terminated forcibly while using the in-memory data buffer, all data in the memory database since the last time in-memory data was released might be lost.

The command will not process the following RDAREAs when -r ALL is specified:

(d) -p page-specification-type <<free>>

Specifies whether the shared memory used by in-memory data buffers is to be page-fixed in real memory:

free:
Do not page-fix the shared memory used by in-memory data buffers in real memory.
fixed:
Page-fix the shared memory used by in-memory data buffers in real memory.

You can specify this option when you specify stay in the -k option.

Paging of shared memory is avoided by page-fixing in real memory the shared memory used by in-memory data buffers (fixed specification), which will improve shared memory access performance.

Determine whether page fixing is to be performed based on the size of the shared memory used by the in-memory data buffers and the size of the server machine's real memory. If the page-fixed memory is too large for the real memory, paging will occur frequently, resulting in a shortage of virtual memory. Therefore, you must evaluate the ratio of the shared memory pool to the real memory and all virtual memory. For the formula for determining the size of the shared memory used by in-memory data buffers, see the HiRDB Version 9 Installation and Design Guide.

The guideline for page fixing is that the size of real memory minus the size of shared memory to be page-fixed should be no more than half the size of the swap area minus the size of the shared memory to be page-fixed.

The following notes about specifying fixed apply to AIX:

You can use AIX commands to determine whether the shared memory is fixed in memory. For details, see the AIX documentation.

(e) -d

Specifies that in-memory data is to be released forcibly. When you release in-memory data forcibly, update data in the in-memory data buffers is not applied to the in-memory RDAREAs.

You can specify this option when you specify rels in the -k option.

(f) -W execution-monitoring-interval ~<unsigned integer> ((0 to 3600))

Specifies (in minutes) the monitoring interval when the execution time of the pdmemdb command is to be monitored. For guidelines on the value to specify and details about the resulting operation, see the description of the pd_cmd_exec_time operand in the system common definition in the manual HiRDB Version 9 System Definition.

If 0 is specified in this option, the command's execution time is not monitored.

If this option is omitted, the value of the pd_cmd_exec_time operand in the system common definition takes effect.

(5) Return code

The following are the pdmemdb command's return codes:

(6) Rules

  1. You can execute the pdmemdb command while HiRDB is running.
  2. In a HiRDB parallel server configuration, execute the pdmemdb command on the server machine where the system manager is defined.
  3. You can execute the pdmemdb command while the data dictionary RDAREA is in one of the following statuses:
    • Open and shutdown release status
    • Open and command shutdown status
  4. You can execute the pdmemdb command only if HiRDB Accelerator has been set up correctly and 1 or a greater value is specified in the pd_max_resident_rdarea_no operand.
  5. Before you execute the pdmemdb command, check the status of the in-memory data buffers and the target RDAREAs. The pdmemdb command cannot be executed unless they are in the correct status. The following table shows the prerequisites for execution of the pdmemdb command (status of in-memory data buffers and target RDAREAs).

    Table 2-13 Prerequisites for pdmemdb command execution (status of in-memory data buffers and target RDAREAs)

    Specification of -k option in the pdmemdb commandPrerequisites for command executionStatus after command execution
    In-memory data buffer statusRDAREA statusIn-memory data buffer statusRDAREA status
    stayUnused statusCommand shutdown and closed status#Database synchronized statusCommand shutdown and closed status
    reloadBuffer error statusError shutdown and closed status
    rels-d option omittedDatabase synchronized statusCommand shutdown and closed statusUnused status (in-memory data released)Command shutdown and closed status
    -d option specifiedDatabase non-synchronized statusCommand shutdown and open statusError shutdown and closed status
    Buffer error statusError shutdown and closed status
    RDAREA error statusCommand shutdown and open status
    Buffer error status and RDAREA error statusError shutdown and closed status
    cancelDatabase non-synchronized statusCommand shutdown and open statusBuffer error statusError shutdown and open status

#: If the status has changed from online reorganization hold to command shutdown and closed, the pdmemdb -k stay command cannot be executed.

(7) Notes

  1. The time required for processing by the pdmemdb command increases proportionally to the size of the processed RDAREAs. Note that no synchronization points are applied during that time.
  2. If you execute the command with stay, reload, or rels specified in the -k option, do not apply kill to the command process. If you kill the command process, HiRDB (or the unit for a HiRDB parallel server configuration) might terminate abnormally.
  3. If HiRDB is terminated forcibly or abnormally while there are in-memory RDAREAs, update information in the in-memory data buffers will not be applied to the in-memory RDAREAs. In such a case, the in-memory RDAREAs might be placed in error shutdown status.
    • For user RDAREAs and user LOB RDAREAs
      User RDAREAs and user LOB RDAREAs are placed in error shutdown status if they are not in database synchronized status.
    • For list RDAREAs
      List RDAREAs are placed in error shutdown status if they are in RDAREA error status or both-system error status (buffer error status and RDAREA error status).
    When you place data in memory, be sure to make a backup copy. The backup copy is needed in the following cases:
    • The RDAREA was placed in both-system error status (buffer error status and RDAREA error status)
    • The most recent status is to be restored
    • The related RDAREAs were placed in memory (including when definition SQL statements are executed on the in-memory RDAREAs)
    For details about acquiring a backup, see the manual HiRDB Version 9 Batch Job Accelerator.
  4. We recommend that you do not perform pair volume operations on a disk that contains in-memory RDAREAs. If you perform pair volume operations without knowing whether the in-memory data buffers and in-memory RDAREAs are in synchronized status (database synchronized status) or database non-synchronized status, data integrity might be lost.
  5. Do not execute the pdstop, pdchgconf, or pdprgrenew command while in-memory processing is underway (from the time of execution of the pdmemdb command until completion of in-memory processing). If you execute one of these commands and both commands terminate normally, the shared memory segment to which an in-memory data buffer has been allocated might not be released. In such a case, you must use an OS facility to check the usage status of the shared memory segment and (if necessary) to release the shared memory segment.
  6. If HiRDB is terminated forcibly or abnormally, update information in in-memory data buffers is not applied to the in-memory RDAREAs. Therefore, do not place in memory an RDAREA containing an audit trail table or a falsification prevented table.
    If you use the database recovery utility, you can also apply update information and restore an in-memory RDAREA containing an audit trail table or a falsification prevented table to its most recent status. However, for security reasons, we do not recommend performing in-memory data processing on such an RDAREA.
    Note also that if you use the automatic data loading facility, you might not be able to apply update information to the audit trail table because the facility for automatically loading audit trail table data runs in the pre-update log acquisition mode.
  7. The pdmemdb command places the specified RDAREAs in the EX lock mode. If another transaction is accessing a specified RDAREA, the pdmemdb command is placed in wait status until that transaction terminates.
  8. When you specify multiple RDAREAs in the -r option (to process multiple RDAREAs at once) and an error occurs in one of the RDAREAs, processing of all the RDAREAs is ignored.
    For a HiRDB parallel server configuration, this mechanism is applied separately to each back-end server. A command specification example for a HiRDB parallel server configuration is shown below.
    Example:
    pdmemdb -k stay -r RD01,RD02,RD03,RD04
    For this example, RD01 and RD02 are managed by back-end server 1, and RD03 and RD04 are managed by back-end server 2. If in-memory processing on RD02 fails, RD01 will also not be placed in memory. However, RD03 and RD04 will be placed in memory.
    In this case, the pdmemdb command will return 4 as the return code.
    Reference note
    This rule also applies to batch specification and the ALL specification.
    The table below describes the difference in error handling between direct or batch specification and the ALL specification:
    Condition during pdmemdb command execution or in the event of an errorDirect or batch specificationALL specification
    In-memory data processing is not applicable to at least one of the specified RDAREAs, such as a shared RDAREAThe pdmemdb command results in an error. None of the specified RDAREAs is placed in memory.The RDAREAs to which in-memory data processing is not applicable are not placed in memory. The other RDAREAs are all placed in memory.
    Processing on at least one of the specified RDAREAs resulted in an error for a reason such as a shortage of shared memoryProcessing discussed in 8 in Notes is performed.