HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
5.10.6 Import group definition
(1) Format
[{{ group import-group-name
by [authorization-identifier.]table-identifier[{{,[authorization-identifier.]
table-identifier }} ...]
/**** Definition of key range-based partitioning method ****/
[{{[ in 'target-FES's-host-name'/'target-FES's-server-identifier'
[/'target-FES's-port-number']]
[ having key-range-partitioning-condition-statement[{{,key-range-partitioning-condition
-statement}} ...]|other ]
}} ...]
/**** Definition of hash partitioning method ****/
[{{ hash
{ in 'target-FES's-host-name'/'target-FES's-server-identifier'
[/'target-FES's-port-number']
[(RDAREA-name {{,RDAREA-name}} ...|other)]
[{{ ,'target-FES's-host-name'/'target-FES's-server-identifier'
[/'target-FES's-port-number'] ]
[(RDAREA-name {{,RDAREA-name}} ...|other)]
|divide into SQL-process-segments-count }
}} ...]]
(2) Explanation of the operands
- group import-group-name
~ <symbolic name of 1-8 characters>
Specify a name for a group that is to be subject to import processing. The specified name must be unique in all import group definitions in the import definition. You cannot specify any of the following names as an import group name regardless of the case (uppercase or lowercase):
- trngroup
- othergrp
- uocxxx#
#: xxx is a three-digit unsigned integer.
In the case of trngroup, for example, you cannot specify names such as trngroup, TRNGROUP, or TrnGroup.
- by [authorization-identifier.]table-identifier[{{,[authorization-identifier.]table-identifier }} ...]
Specify the target tables that are to constitute the group.
- authorization-identifier
- Specify the authorization identifier for a target table that is to be a member of the group. If you omit the authorization identifier, Datareplicator assumes the authorization identifier specified in the import system definition.
- table-identifier
- Specify the table identifier of a target table that is to be a member of the group. This table identifier must be unique in all groups. In the case of key range partitioning or hash partitioning, you can specify only one table identifier in the corresponding import group definition.
- in 'target-FES's-host-name'/'target-FES's-server-identifier' [/'target-FES's-port-number' ]
If multiple front-end servers are running using the multi-FES facility at the target HiRDB, specify the intended target front-end server's host name, server identifier, and port number. If you are using the multi-FES facility but you omit the in clause, the target HiRDB's system manager selects a target front-end server for the import group. If you are not using the multi-FES facility, Datareplicator assigns all import groups to the only active front-end server regardless of whether the in clause is specified.
To execute import processing on a single table in key range-based partitions, specify the in and having clauses as many times as there are key ranges. In this case, you can also specify the partitioning conditions in the having clause. You can specify a maximum of eight in clauses per import group definition. When you specify multiple in clauses in a single import group definition, you cannot omit the having clause. You can also specify multiple front-end servers at the same target within the same import group definition.
If the target HiRDB is one of multiple front-end servers, specify the host name of the applicable front-end server. To connect to the host for which -p port-number is specified with pdunit in the HiRDB system definition (if the system switchover facility is used), you must specify that port number. The specification format is as follows:
- host-name-of-target-FES:port-number-of-target-FES
- target-FES's-host-name ~ <identifier of 1-32 characters>
- Specify the host name specified in the target front-end server's PDFESHOST environment variable.
- target-FES's-server-identifier ~ <identifier of 1-8 characters>
- Specify the server identifier specified in the target front-end server's PDSERVICEGRP environment variable.
- target-FES's-port-number ~ <identifier of 1-5 characters>
- Specify the port number specified in the target front-end server's PDNAMEPORT environment variable.
For details about the above environment variables, see the HiRDB Version 9 UAP Development Guide.
The following shows the number of target front-end servers that can be specified in the in clause:
Table-based partitioning method: One target front-end server per group
Key range-based partitioning method: One target front-end server per range
Hash partitioning method: 2 to 8 target front-end servers per group
- having key-range-partitioning-condition-statement[{{,key-range-partitioning-condition-statement}} ...]|other
To execute import processing on a single table in key range-based partitions, specify condition statements for partitioning. You can specify only one having clause per in clause. If you specify multiple pairs of in and having clauses, Datareplicator checks them sequentially beginning with the first pair and executes import processing for the first condition that is satisfied.
If you specify a fixed-length character string (CHAR, MCHAR, or NCHAR), add trailing spaces to satisfy conditions so that the condition value length is equal to the definition length.
If none of the condition statements is true for the import data, import processing will not take place. To execute import processing even when none of the condition statements is true, specify having other at the end of each import group definition.
- having key-range-partitioning-condition-statement
- Specify a condition statement for establishing a key range partition. Specify the condition statement in the following format:
- column-name=literal
- Column value is equal to the specified literal.
- column-name<>literal
- Column value is not equal to the specified literal.
- column-name>literal
- Column value is greater than the specified literal.
- column-name>=literal
- Column value is equal to or greater than the specified literal.
- column-name<literal
- Column value is smaller than the specified literal.
- column-name<=literal
- Column value is equal to or smaller than the specified literal.
- column-name IS NULL
- Column value is null.
- column-name IS NOT NULL
- Column value is not null.
You can specify a maximum of eight condition statements per having clause. When you specify multiple condition statements in one having clause, Datareplicator joins all the specified conditions by AND. For example, if the specification is having c1=100 c2=200, Datareplicator executes import processing only on the data that satisfies both conditions c1=100 and c2=200.
- having other
- Specify this operand to import data even when none of the specified key range partitioning condition statements is true. You can specify other only once at the end of each import group definition. Specifying other more than once will result in an error during analysis of the import definition. Specifying a having clause after other will also result in an error.
- hash
Specify this operand to distribute the update information among the processes when multiple SQL processes are executed in parallel for import processing on a single table. You use HiRDB's hash partitioning function when you want to distribute the update information. The hash key column is retrieved from HiRDB. If the retrieved column is not the mapping key, an error occurs during analysis of the import definition.
This hash partitioning is applicable only to a table that is hash-partitioned by HiRDB. Specifying hash for any other table will result in an error during analysis of the import definition. A source column and the target hash key column must satisfy the following conditions:
- The source and target columns be of the same data type.
- If the columns' data type is decimal, the source and target columns must have the same precision and scaling.
- If the columns' data type is character, the length of the source column must be equal to or less than the length of the target column.
- If the column's data type is TIMESTAMP, the decimal places are the same.
An error occurs during analysis of the import definition if all these conditions are not satisfied. Because Datareplicator uses HiRDB's client library when it executes hash partitioning using the hash option, you must add $PDDIR/client/lib to the SHLIB_PATH environment variable.
- RDAREA-name
Hash partitioning involves assignment of data storage for each RDAREA; therefore, specify the RDAREA name as the assignment condition for each target FES specification. If this specification is omitted, Datareplicator determines the destination automatically.
You can omit the RDAREA name, but in such a case you must make sure that a target FES specification with an RDAREA name is not mixed with a target FES specification without an RDAREA name in the same group statement. If they are mixed in the same group statement, a definition analysis error will occur and import processing will be terminated.
A single group statement can contain only one RDAREA name. If multiple RDAREA names are specified in the same group statement, a definition analysis error will occur and import processing will be terminated.
To import data in all RDAREAs that are not specified as a condition, specify other as the RDAREA name. When other is omitted, Datareplicator assumes that other is specified for the last target FES specification in the group statement. When specifying other, observe the following rules:
- Specify other at the end of the last in clause.
Correct:
in 'host1'/'fes1'(rdarea1,rdarea2),
'host2'/'fes2'(rdarea3,rdarea4),
'host3'/'fes3'(other)
Wrong:
in 'host1'/'fes1'(rdarea1,rdarea2),
'host2'/'fes2'(other),
'host3'/'fes3'(rdarea5,rdarea6)
In the example of a wrong specification, you can avoid the error by swapping lines 2 and 3.
- other cannot be specified together with another RDAREA.
Wrong (1):
in 'host1'/'fes1'(rdarea1,rdarea2),
'host2'/'fes2'(rdarea3,rdarea4),
'host3'/'fes3'(rdarea5,other)
In the example of wrong specification (1), you can avoid the error by deleting other.
Wrong (2):
in 'host1'/'fes1'(rdarea1,rdarea2),
'host2'/'fes2'(rdarea3,other),
'host3'/'fes3'(rdarea5,rdarea6)
In the example of wrong specification (2), you can avoid the error by swapping lines 2 and 3 and deleting other.
Unlike a key range, the hash option cannot be used to exclude an unspecified range from import processing. The omitted RDAREAs are applied to the last FES specification. Therefore, we recommend that you define all RDAREA names in your FES specifications without omitting any of them.
- divide into SQL-process-segments-count
~ <unsigned integer> ((2-8))
Specify the number of SQL processes to be executed when HiRDB will execute multiple SQL processes in parallel, such as by hash partitioning, for import processing on a table at a single server. If the specified value is less than 2 or more than 8, an error occurs during analysis of the import definition.
When an import group definition is specified, the target Datareplicator divides the import processing into the specified groups and executes them in parallel. You can use an import group definition to create a maximum of 128 import groups. The table below explains the use of an import group definition to create import groups. Note that if you are defining a target group that employs key range-based partitioning or hash range partitioning, make sure that PURGE TABLE is not executed on the table.
Table 5-20 Use of an import group definition to create import groups
| Classification of import processing |
Creation of import groups during import processing |
| Importing data into the table specified in the import group definition |
Datareplicator creates groups according to specifications in the import group definition. |
| Importing data into a table that is not specified in the import group definition |
Datareplicator creates one group for all tables subject to import processing that are not specified in the import group definition. |
| Importing with a UOC routine |
Datareplicator creates a group for each UOC routine and automatically assigns group names in the range UOC001 to UOC128. |
The following are the rules for specifying key range partitioning conditions:
#: In the case of date data, Datareplicator only checks to determine whether the date is after the last date of the month. Datareplicator does not check for a leap year.
- Handling of trailing space characters in a fixed-length character string data type
To specify a fixed-length character string data type in a condition statement, you must observe the following rules as appropriate to the ref_data_backspace operand value in the import environment definition:
- When suppress is specified
Specify the value of the fixed-length character string data type without the trailing space characters.
- When nosuppress is specified
Specify the value of the fixed-length character string data type including the trailing space characters.
If you modify an import group definition while import processing is stopped for a reason other than normal termination or event termination, a loss of conformity might occur in the import processing between before and after the modification.
- Import processing method when import processing involves a UOC routine
If import processing involves use of a UOC routine, Datareplicator executes the processing using the table-based import method regardless of the specification of the import system definition, events, or the hdsrfctl command.
All rights reserved. Copyright (C) 2007, 2013, Hitachi, Ltd.