Scalable Database Server, HiRDB Version 8 Command Reference
![[Contents]](FIGURE/CONTENT.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
(1) Shared mode
- Example 1
- This example adds an RDAREA (user03) to a table (reb_table) in a HiRDB/Single Server and executes the rebalancing utility in the shared mode.
CREATE TABLE reb_table(hkeys INT NOT NULL,names CHAR(30))
FIX HASH HASHA BY hkeys IN (user01,user02)
CREATE INDEX idx1 ON reb_table(hkeys) IN ((idx01),(idx02))
- Adding an RDAREA with ALTER TABLE
ALTER TABLE reb_table ADD RDAREA user03 FOR INDEX idx1 in idx03
|
- Explanation:
- This statement adds RDAREA user03 to table reb_table. It also adds RDAREA idx03 to index idx1.
- pdrbal command
pdrbal -k share -t reb_table c:\hirdb\pdrbal\control_file
|
- Explanation:
- -k share: Operation mode (shared mode)
- -t reb_table: Name of the rebalancing table
- c:\hirdb\pdrbal\control_file: Control information file
- Contents of the control information file (c:\hirdb\pdrbal\control_file)
execstop time,9:00 1
report c:\hirdb\pdrbal\rest_file 2 |
- Explanation:
- Terminates pdrbal nine hours later.
- Outputs the execution result of pdrbal to the process results file (c:\hirdb\pdrbal\rest_file).
- Example 2
- This example adds an RDAREA (user03) to a table (sgml_table) in a HiRDB/Single Server and executes the rebalancing utility in the shared mode. The sgml_table table contains the columns of abstract data type provided by a plug-in.
CREATE TABLE sgml_table (
hkeys INT NOT NULL,
doctext SGMLTEXT ALLOCATE (sgmltext IN ((LOB1D),
(LOB2D)))
PLUGIN '<DTD>NEWSPAPER</DTD><EXTRACTparm>extract.prm
</EXTRACTparm>'
)
FIX HASH HASHA BY hkeys IN (user01,user02)
CREATE INDEX idx1 ON sgml_table(hkeys) IN ((idx01),(idx02))
CREATE INDEX ngram_index USING TYPE MASTER.NGRAM on sgml_table(doctext)
in ((LOB1I),(LOB2I))
- Adding an RDAREA with ALTER TABLE
ALTER TABLE sgml_table ADD RDAREA user03
FOR COLUMN doctext ALLOCATE(sgmltext IN LOB3D)
FOR INDEX idx1 in idx03,ngram_index in LOB3I
|
- Explanation:
- This statement adds RDAREA user03 to table sgml_table. It also adds RDAREA idx03 to index idx1 and RDAREA LOB3I to plug-in index ngram_index.
- pdrbal command
pdrbal -k share -t sgml_table c:\hirdb\pdrbal\control_file
|
- Explanation:
- -k share: Operation mode (shared mode)
- -t sgml_table: Name of the rebalancing table
- c:\hirdb\pdrbal\control_file: Control information file
- Contents of the control information file (c:\hirdb\pdrbal\control_file)
execstop time,12:00 1
unld_func type=sgmltext,func=unsgmltext(sgmltext) 2
reld_func type=sgmltext,func=sgmltext(blob) 3
report c:\hirdb\pdrbal\rest_file 4 |
- Explanation:
- Terminates pdrbal 12 hours later.
- Specifies a constructor parameter reverse creation function.
sgmltext: Name of the abstract data type
unsgmltext: Name of the constructor parameter reverse creation function
sgmltext: Type of argument
- Specifies a constructor function.
sgmltext: Name of the abstract data type
sgmltext: Name of the constructor function
blob: Type of argument
- Outputs the execution result of pdrbal to the process results file (c:\hirdb\pdrbal\rest_file).
(2) Exclusive mode
- Example 3
- This example adds an RDAREA (user03) to a table (reb_table) in a HiRDB/Single Server and executes the rebalancing utility in the exclusive mode.
CREATE TABLE reb_table(hkeys INT NOT NULL,names CHAR(30))
FIX HASH HASHA BY hkeys IN (user01,user02)
CREATE INDEX idx1 ON reb_table(hkeys) IN ((idx01),(idx02))
- Adding an RDAREA with ALTER TABLE
ALTER TABLE reb_table ADD RDAREA user03 FOR INDEX idx1 in idx03
|
- Explanation:
- This statement adds RDAREA user03 to table reb_table. It also adds RDAREA idx03 to index idx1.
- pdrbal command
pdrbal -k exclusive -t reb_table -l n c:\hirdb\pdrbal\control_file
|
- Explanation:
- -k exclusive: Operation mode (exclusive mode)
- -t reb_table: Name of the rebalancing table
- -l n: no-log mode
- c:\hirdb\pdrbal\control_file: Control information file
- Contents of the control information file (c:\hirdb\pdrbal\control_file)
idxwork c:\hirdb\pdrbal\idxwork1 1
sort c:\hirdb\pdrbal\sortwork 2
report c:\hirdb\pdrbal\rest_file 3
|
- Explanation:
- Specifies a directory for index information files (c:\hirdb\pdrbal\idxwork1).
- Specifies a work directory for sorting (c:\hirdb\pdrbal\sortwork).
- Outputs the execution result of pdrbal to the process results file (c:\hirdb\pdrbal\rest_file).
- Example 4
- This example adds an RDAREA (user03) to a table (reb_table) in a HiRDB/Parallel Server and executes the rebalancing utility in the exclusive mode.
CREATE TABLE reb_table(hkeys INT NOT NULL,names CHAR(30))
FIX HASH HASHA BY hkeys IN (user01,user02)
CREATE INDEX idx1 ON reb_table(hkeys) IN ((idx01),(idx02))
- Relationship among servers, RDAREAs, table, and index
![[Figure]](FIGURE/ZU100070.GIF)
- Adding an RDAREA with ALTER TABLE
ALTER TABLE reb_table ADD RDAREA user03 FOR INDEX idx1 in idx03
|
- Explanation:
- This statement adds RDAREA user03 to table reb_table. It also adds RDAREA idx03 to index idx1.
- pdrbal command
pdrbal -k exclusive -t reb_table -l n c:\hirdb\pdrbal\control_file
|
- Explanation:
- -k exclusive: Operation mode (exclusive mode)
- -t reb_table: Name of the rebalancing table
- -l n: no-log mode
- c:\hirdb\pdrbal\control_file: Control information file
- Contents of the control information file (c:\hirdb\pdrbal\control_file)
idxwork bes2 c:\hirdb\pdrbal\idxwork_bes2 1
sort bes2 c:\hirdb\pdrbal\sortwork_bes2 2
report c:\hirdb\pdrbal\rest_file 3
|
- Explanation:
- Specifies a directory for index information files (c:\hirdb\pdrbal\idxwork_bes2) at the bes2 back-end server.
- Specifies a work directory for sorting (c:\hirdb\pdrbal\sortwork_bes2) at the bes2 back-end server.
- Outputs the execution result of pdrbal to the process results file (c:\hirdb\pdrbal\rest_file).
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.