The section presents examples of using the database reorganization utility (reorganizing a table), listed as follows:
Example | Description | Classification |
---|---|---|
1 | Reorganizing a row-partitioned table in units of tables | S |
2 | Reorganizing a row-partitioned table in units of RDAREAs | S |
3 | Reorganizing a table with LOB columns
| S |
4 | Reorganizing a table with an abstract data type (SGMLTEXT type)
| S |
5 | Reorganizing a row-partitioned table in units of tables | P |
6 | Reorganizing a table with LOB columns
| P |
7 | Reorganizing a table using EasyMT as an unload data file
| P |
8 | Reorganizing tables in units of schemas | P |
S: HiRDB/Single Server
P: HiRDB/Parallel Server
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER04))
CREATE INDEX INDEX2 ON TABLE1(C2,C1) IN (PDBUSER05)
unload /usr/unload_file1 1 |
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER04))
CREATE INDEX INDEX2 ON TABLE1(C2,C1) IN (PDBUSER05)
unload /usr/unload_file1 1 |
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.
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))
unload /usr/unload_file1 1 |
CREATE TABLE TABLE1(C1 INT,C2 SGMLTEXT ALLOCATE
(SGMLTEXT IN LOBUSER01)
PLUGIN'<DTD>sgml.dtd</DTD>' ) IN PDBUSER01
CREATE INDEX INDEX1 USING TYPE NGRAM ON TABLE1(C2) IN LOBUSER02
unload /hd001/unload_file1 1 |
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER05))
CREATE INDEX INDEX2 ON TABLE1(C2,C1)
IN ((PDBUSER04),(PDBUSER06))
unload bes1:/usr/unload_file1 1 |
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))
unload bes1:/usr/unload_file1 1 |
CREATE TABLE TABLE1(C1 INT NOT NULL,C2 CHAR(8),C3 INT)
IN ((PDBUSER01) C1 > 10,(PDBUSER02))
CREATE INDEX INDEX1 ON TABLE1(C1)
IN ((PDBUSER03),(PDBUSER05))
CREATE INDEX INDEX2 ON TABLE1(C2,C1)
IN ((PDBUSER04),(PDBUSER06))
mtguide use 1 |
CREATE TABLE TABLE1(C1 INT) IN (BES1R01)
CREATE TABLE TABLE2(C1 BLOB IN LOBUSER01) IN(BES2R01)
CREATE TABLE TABLE3(C1 ADT1) IN(BES3R01)
unload bes1:/hd001/unload_file1 1 |