Hitachi

Hitachi Advanced Database Setup and Operation Guide


11.1.6 Changing a single-chunk table to a multi-chunk table

To change a single-chunk table to a multi-chunk table, first, delete the single-chunk table. Then, redefine the table as either of the following multi-chunk tables:

Important

The following shows the procedure for changing a single-chunk table to a multi-chunk table.

Procedure:

  1. Check the table definition of the single-chunk table that you want to change to a multi-chunk table.

    Check the specification content of the CREATE TABLE statement when the single-chunk table was defined. This information is used in step 4 for defining a multi-chunk table.

    If the content that was specified for the CREATE TABLE statement when the single-chunk table was defined is unknown, see (28) Finding out base table definition information in B.22 Searching a dictionary table. By searching the dictionary table, you can check the specification content of the CREATE TABLE statement when a single-chunk table was defined.

  2. Output all data in the single-chunk table.

    Use the adbexport command to output all data from the single-chunk table to an output data file.

  3. Delete the single-chunk table.

    Use the DROP TABLE statement without specifying drop-behavior to delete the single-chunk table.

  4. Define a multi-chunk table.

    Use the CREATE TABLE statement to define a multi-chunk table. Note the following points when you create the specification content to be used in the CREATE TABLE statement:

    • Use the specification content (checked in step 1) used in the CREATE TABLE statement when the single-chunk table was defined, and create a CREATE TABLE statement.

    • Add a chunk specification to the CREATE TABLE statement. Note that the contents of the chunk specification differ depending on whether a regular multi-chunk table or archivable multi-chunk table is to be defined. For details about the contents of a chunk specification, see 11.4.1 Defining a multi-chunk table.

  5. Define an index for the multi-chunk table.

    If an index was defined for the single-chunk table that was deleted, use the CREATE INDEX statement to redefine the index for the multi-chunk table defined in step 4. Note the following points when you create a CREATE INDEX statement:

    • If the content that was specified for the CREATE INDEX statement when the index for the single-chunk table was defined is unknown, see (29) Finding out index definition information in B.22 Searching a dictionary table. By searching the dictionary table, you can check the contents of the CREATE INDEX statement that were used when the index for a single-chunk table was defined.

    • You cannot define a unique index for a multi-chunk table.

  6. Store data in the multi-chunk table.

    Use the adbimport command to store the data output in step 2 in the multi-chunk table that was redefined in step 4. Do not specify the -d or -b option for the adbimport command.

  7. Re-validate viewed tables.

    The viewed tables whose underlying table is the single-chunk table that was deleted in step 3 are invalidated. Therefore, after defining a multi-chunk table, you must re-validate the viewed tables. When you re-validate the viewed tables, see (4) When viewed tables are invalidated due to erroneous deletion of a table in 11.2.8 Releasing a viewed table from invalidation.

Note

For details about the adbexport and adbimport commands, see the manual HADB Command Reference.

For details about the DROP TABLE, CREATE TABLE, and CREATE INDEX statements, see the manual HADB SQL Reference.