Scalable Database Server, HiRDB Version 8 Command Reference
![[Contents]](FIGURE/CONTENT.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
(1) Reorganizing a row-partitioned table in units of tables
- Example 1
- This example reorganizes a row-partitioned table (TABLE1) in units of tables.
- The example assumes that the table (TABLE1) and indexes are defined as follows:
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
- Index definition (partitioning key index):
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER04))
- Index definition (non-partitioning key index):
CREATE INDEX INDEX2 ON TABLE1(C2,C1) IN (PDBUSER05)
- Overview
![[Figure]](FIGURE/ZU820080.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080360.GIF)
- Explanation of the command
- This example reorganizes the row-partitioned table (TABLE1) in units of tables.
- -k rorg: Specification for reorganization
- -t TABLE1: Name of the table being reorganized
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload c:\hirdb\pdrorg\unload_file1 1
idxwork c:\hirdb\pdrorg\idx_file 2
sort c:\hirdb\pdrorg\sortwork,8192 3
|
- Explanation:
- Specifies the unload data file:
c:\hirdb\pdrorg\unload_file1: Name of the unload data file
- Specifies the directory in which index information files are to be created:
c:\hirdb\pdrorg\idx_file: Name of the directory in which index information files are created
- Specifies the work directory for sorting:
c:\hirdb\pdrorg\sortwork: Name of the directory in which the sort work file is created
8192: Size of buffer for sorting (in KB)
(2) Reorganizing a row-partitioned table in units of RDAREAs
- Example 2
- This example reorganizes a row-partitioned table (TABLE1) in units of RDAREAs.
- The example assumes that the table (TABLE1) and indexes are defined as follows:
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
- Index definition (partitioning key index):
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER04))
- Index definition (non-partitioning key index):
CREATE INDEX INDEX2 ON TABLE1(C2,C1) IN (PDBUSER05)
- Overview
![[Figure]](FIGURE/ZU820010.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080130.GIF)
(a) Reorganizing TABLE1 (RDAREA PDBUSER01)
- Explanation of the command
- This example reorganizes the row-partitioned table (TABLE1) in units of RDAREAs.
- -k rorg: Specification for reorganization
- -t TABLE1: Name of the table being reorganized
- -r PDBUSER01: Name of the RDAREA being reorganized
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload c:\hirdb\pdrorg\unload_file1 1
idxwork c:\hirdb\pdrorg\idx_file 2
sort c:\hirdb\pdrorg\sortwork,8192 3
|
- Explanation:
- Specifies the unload data file:
c:\hirdb\pdrorg\unload_file1: Name of the unload data file
- Specifies the directory in which index information files are to be created:
c:\hirdb\pdrorg\idx_file: Name of the directory in which index information files are created
- Specifies the work directory for sorting:
c:\hirdb\pdrorg\sortwork: Name of the directory in which the sort work file is created
8192: Size of buffer for sorting (in KB)
(b) Creating INDEX2
You cannot use INDEX2 as is. To use INDEX2, you need to reorganize RDAREA PDBUSER02 and output index information for PDBUSER02. Create indexes from this index information file and the existing index information file 2 in batch mode by executing pdrorg (specifying -k ixmk).
For details, see Section 8.6 Creating indexes in batch mode.
(3) Reorganizing a table with LOB columns
- Example 3
- For a table with LOB columns (TABLE2), this example reorganizes its LOB column structure base table and LOB columns at the same time.
- The example assumes that the table and index are defined as follows:
CREATE TABLE TABLE2(C1 INT NOT NULL,C2 BLOB IN
((LOBUSER01), (LOBUSER02))) IN
((PDBUSER01) C1 > 10,(PDBUSER02))
CREATE INDEX INDEX2 ON TABLE2(C1) IN
((PDBUSER03),(PDBUSER04))
- Overview
![[Figure]](FIGURE/ZU820020.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080180.GIF)
- Explanation of the command
- This example reorganizes the table with LOB columns (TABLE2) in units of tables (both LOB column structure base table and LOB columns at the same time).
- -k rorg: Specification for reorganization
- -t TABLE2: Name of the table being reorganized
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload c:\hirdb\pdrorg\unload_file1 1
index INDEX2 PDBUSER03 c:\hirdb\pdrorg\index_inf1 2
index INDEX2 PDBUSER04 c:\hirdb\pdrorg\index_inf2 2
sort c:\hirdb\pdrorg\sortwork,8192 3
lobunld c:\hirdb\pdrorg\lobunld_file1 4
|
- Explanation:
- Specifies the unload data file:
c:\hirdb\pdrorg\unload_file1: Name of the unload data file
- Specifies the index information files to which index information is output:
INDEX2: Index identifier
PDBUSER03, PDBUSER04: Names of the index storage RDAREAs
c:\hirdb\pdrorg\index_inf1, c:\hirdb\pdrorg\index_inf2: Names of the index information files
- Specifies the work directory for sorting:
c:\hirdb\pdrorg\sortwork: Name of the directory in which the sort work file is created
8192: Size of buffer for sorting (in KB)
- Specifies the LOB data unload file:
c:\hirdb\pdrorg\lobunld_file1: Name of the LOB data unload file
(4) Reorganizing a table with an abstract data type
- Example 4
- This example reorganizes a table (TABLE1) with columns of abstract data type (SGMLTEXT). The abstract data type (SGMLTEXT) is provided by the HiRDB Text Search Plug-in.
- The example assumes that the table and index are defined as follows:
CREATE TABLE TABLE1(C1 INT,C2 SGMLTEXT ALLOCATE
(SGMLTEXT IN LOBUSER01)
PLUGIN'<DTD>sgml.dtd</DTD>' ) IN PDBUSER01
- Plug-in index definition:
CREATE INDEX INDEX1 USING TYPE NGRAM ON TABLE1(C2) IN LOBUSER02
- Overview
![[Figure]](FIGURE/ZU820030.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080200.GIF)
- Explanation of the command
- This example reorganizes the table (TABLE1).
- -k rorg: Specification for reorganization
- -t TABLE1: Name of the table being reorganized
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload c:\hirdb\pdrorg\unload_file1 1
index INDEX1 LOBUSER02 c:\hirdb\pdrorg\ixdir\INDEX1_LOBUSER02 2
|
- Explanation:
- Specifies the unload data file:
c:\hirdb\pdrorg\unload_file1: Name of the unload data file
- Specifies the index information file:
INDEX1: Index identifier of the plug-in index subject to batch index creation
LOBUSER02: Name of the index storage RDAREA for the plug-in index subject to batch index creation
c:\hirdb\pdrorg\ixdir\INDEX1_LOBUSER02: Name of the index information file
(5) Reorganizing a row-partitioned table in units of tables
- Example 5
- This example reorganizes a row-partitioned table (TABLE1) in units of tables.
- The example assumes that the table and indexes are defined as follows:
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
- Index definition (partitioning key index):
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER05))
- Index definition (non-partitioning key index):
CREATE INDEX INDEX2 ON TABLE1(C2,C1)
IN ((PDBUSER04),(PDBUSER06))
- Overview
![[Figure]](FIGURE/ZU820040.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080230.GIF)
- Explanation of the command
- This example reorganizes the row-partitioned table (TABLE1) in units of tables.
- -k rorg: Specification for reorganization
- -t TABLE1: Name of the table being reorganized
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload bes1:c:\hirdb\pdrorg\unload_file1 1
idxwork bes1 c:\hirdb\pdrorg\idxwork 2
sort bes1 c:\hirdb\pdrorg\sortwork,8192 3
unload bes2:c:\hirdb\pdrorg\unload_file2 1
idxwork bes2 c:\hirdb\pdrorg\idxwork 2
sort bes2 c:\hirdb\pdrorg\sortwork,8192 3
|
- Explanation:
- Specifies the unload data file:
bes1, bes2: Names of the servers containing the unload data files
c:\hirdb\pdrorg\unload_file1, c:\hirdb\pdrorg\unload_file2: Names of the unload data files
- Specifies the directory for index information files to which index information is to be output:
bes1, bes2: Names of the servers used to create index information files
c:\hirdb\pdrorg\idxwork: Name of the directory for index information files
- Specifies the work directory for sorting:
bes1, bes2: Names of the servers used to create the sort work file
c:\hirdb\pdrorg\sortwork: Name of the directory in which the sort work file is created
8192: Size of buffer for sorting (in KB)
(6) Reorganizing a table with LOB columns
- Example 6
- For a table with LOB columns (TABLE2), this example reorganizes both the LOB column structure base table and LOB columns at the same time.
- The example assumes that the table and index are defined as follows:
CREATE TABLE TABLE2(C1 INT NOT NULL,C2 BLOB IN
((LOBUSER01), (LOBUSER02))) IN
((PDBUSER01) C1 > 10,(PDBUSER02))
CREATE INDEX INDEX2 ON TABLE2(C1) IN
((PDBUSER03),(PDBUSER04))
- Overview
![[Figure]](FIGURE/ZU820050.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080270.GIF)
- Explanation of the command
- This example reorganizes the table with LOB columns (TABLE2) in units of tables (both the LOB column structure base table and LOB columns at the same time).
- -k rorg: Specification for reorganization
- -t TABLE2: Name of the table being reorganized
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload bes1:c:\hirdb\pdrorg\unload_file1 1
unload bes2:c:\hirdb\pdrorg\unload_file2 1
index INDEX2 PDBUSER03 c:\hirdb\pdrorg\index_inf1 2
index INDEX2 PDBUSER04 c:\hirdb\pdrorg\index_inf2 2
sort bes1 c:\hirdb\pdrorg\sortwork,8192 3
sort bes2 c:\hirdb\pdrorg\sortwork,8192 3
lobunld bes1:c:\hirdb\pdrorg\lobunld_file1 4
lobunld bes2:c:\hirdb\pdrorg\lobunld_file2 4
|
- Explanation:
- Specifies the unload data file:
bes1, bes2: Names of the servers containing the unload data files
c:\hirdb\pdrorg\unload_file1, c:\hirdb\pdrorg\unload_file2: Names of the unload data files
- Specifies the index information files to which index information is output:
INDEX2: Index identifier
PDBUSER03, PDBUSER04: Names of the index storage RDAREAs
c:\hirdb\pdrorg\index_inf1, c:\hirdb\pdrorg\index_inf2: Names of the index information files
- Specifies the work directory for sorting:
bes1, bes2: Names of the servers used to create the sort work file
c:\hirdb\pdrorg\sortwork: Name of the directory in which the sort work file is created
8192: Size of buffer for sorting (in KB)
- Specifies the LOB data unload files:
bes1, bes2: Names of the servers containing the LOB data unload files
c:\hirdb\pdrorg\lobunld_file1, c:\hirdb\pdrorg\lobunld_file2: Names of the LOB data unload files
(7) Reorganizing tables in units of schemas
- Example 7
- This example reorganizes all tables owned by schema USER01, for which the following tables have been defined:
CREATE TABLE TABLE1(C1 INT) IN (BES1R01)
CREATE TABLE TABLE2(C1 BLOB IN LOBUSER01) IN(BES2R01)
CREATE TABLE TABLE3(C1 ADT1) IN(BES3R01)
- Overview
![[Figure]](FIGURE/ZU820090.GIF)
- Relationship between input/output files and RDAREAs
![[Figure]](FIGURE/ZW080320.GIF)
- Explanation of the command
- This example reorganizes all tables owned by schema USER01. When reorganizing tables in units of schemas with a HiRDB/Parallel Server, the system assumes the -g and -j options.
- -k rorg: Specification for reorganization
- -t USER01.all: Specification for all the tables owned by schema USER01
- c:\hirdb\pdrorg\control_file: Name of the control information file
- Contents of the control information file (c:\hirdb\pdrorg\control_file)
unload bes1:c:\hirdb\pdrorg\unload_file1 1
idxwork bes1 c:\hirdb\pdrorg\idxwork 2
sort bes1 c:\hirdb\pdrorg\sortwork,8192 3
idxwork bes2 c:\hirdb\pdrorg\idxwork 2
sort bes2 c:\hirdb\pdrorg\sortwork,8192 3
idxwork bes3 c:\hirdb\pdrorg\idxwork 2
sort bes3 c:\hirdb\pdrorg\sortwork,8192 3
|
- Explanation:
- Specifies the unload data file:
bes1: Name of the server containing the unload data file
c:\hirdb\pdrorg\unload_file1: Name of the unload data file
- Specifies the directory for index information files to which index information is to be output:
bes1, bes2, bes3: Names of the servers used to create index information files
c:\hirdb\pdrorg\idxwork: Name of the directory for index information files
- Specifies the work directory for sorting:
bes1, bes2, bes3: Names of the servers used to create the sort work file
c:\hirdb\pdrorg\sortwork: Name of the directory in which the sort work file is created
8192: Size of buffer for sorting (in KB)
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.