Hitachi

Hitachi Advanced Database Setup and Operation Guide


15.7.2 Steps to take when a data DB area can no longer be added

This subsection explains the steps to take when you can no longer add a new data DB area.

The maximum number of data DB areas that the HADB server can manage is 1,014. You cannot add data DB areas beyond this upper limit.

Therefore, if you want to add a new data DB area when there are already 1,014 data DB areas, you need to combine the existing data DB areas so that the resulting number of data DB areas does not exceed the upper limit.

Note

If you will be combining data DB areas, we recommend that you combine data DB areas that store base tables and indexes whose sizes are small (a few megabytes). For details, see 5.6.1 Points to consider when designing a data DB area.

Organization of this subsection

(1) Deleting and combining data DB areas that store tables and indexes (when execution of the adbidxrebuild command is unnecessary)

The following figure shows how to delete and combine data DB areas that store tables and indexes.

Figure 15‒2: Example 1 of combining existing data DB areas

[Figure]

■ Relationship between the base table and B-tree indexes
  • B-tree indexes A and B are defined for base table A.

  • B-tree index C is defined for base table C.

  1. Output the data from the table stored in the data DB area to be deleted.

    Use the adbexport command to output the data of the base table into an output data file. Here, the data to output is the data in base table C, stored in data DB area 1014.

  2. Delete the table and indexes stored in the data DB area to be deleted.

    Use the DROP TABLE statement to delete any base table or index that is defined for the data DB area to be deleted. Executing the DROP TABLE statement deletes the indexes defined for the base table at the same time. Here, the items to delete are base table C and B-tree index C, stored in data DB area 1014.

  3. Delete the data DB area designated for deletion.

    Use the adbmodarea command to delete the data DB area designated for deletion. Here, that is data DB area 1014.

  4. Redefine a table and indexes for the newly-combined data DB area.

    Use the CREATE TABLE or CREATE INDEX statement to redefine, for the newly-combined data DB area, any base table or index deleted in step 2. Here, redefine base table C and B-tree index C for data DB area 1013.

  5. Re-store all table data that was output.

    Use the adbimport command to re-store all base table data output in step 1 in the base table that you redefined in step 4. Here, re-store the data in redefined base table C.

Because combining the existing data DB areas has brought the number of data DB areas below the upper limit, you can now add a new data DB area.

(2) Deleting and combining data DB areas that store tables and indexes (when execution of the adbidxrebuild command is necessary)

The following figure shows how to delete and combine data DB areas that store tables and indexes.

Figure 15‒3: Example 2 of combining existing data DB areas

[Figure]

■ Relationship between the base table and B-tree indexes
  • B-tree indexes A, B, and C are defined for base table A.

  • No index is defined for base table B.

  1. Output the data from the table stored in the data DB area to be deleted.

    Use the adbexport command to output the data of the base table into an output data file. Here, the data to output is the data in base table B, stored in data DB area 1014.

  2. Delete the tables and indexes stored in the data DB area to be deleted.

    Use the DROP TABLE statement to delete the base table defined for the data DB area to be deleted. Also use the DROP INDEX statement to delete any index. Here, the items to delete are base table B and B-tree index C stored in data DB area 1014.

  3. Delete the data DB area designated for deletion.

    Use the adbmodarea command to delete the data DB area designated for deletion. Here, that is data DB area 1014.

  4. Redefine a table and indexes for the newly-combined data DB area.

    Use the CREATE TABLE or CREATE INDEX statement to redefine for the newly-combined data DB area any base table or index deleted in step 2. Here, redefine base table B for data DB area 1013. Also redefine B-tree index C for base table A.

  5. Re-store all table data that was output.

    Use the adbimport command to re-store all base table data that was output in step 1in the base table that you redefined in step 4. Here, re-store the data in redefined base table B.

  6. Rebuild indexes.

    Because the index you redefined in step 4 is in unfinished status, you need to rebuild it. Use the adbidxrebuild command to rebuild the index. Here, execute the adbidxrebuild command on base table A for which B-tree index C was redefined.

Because combining the existing data DB areas has brought the number of data DB areas below the upper limit, you can now add a new data DB area.

(3) Deleting and combining data DB areas that store only indexes

The following figure shows how to delete and combine data DB areas that store only indexes.

Figure 15‒4: Example 3 of combining existing data DB areas

[Figure]

■ Relationship between the base table and the B-tree index

B-tree index A is defined for base table A.

  1. Delete the index stored in the data DB area to be deleted.

    Use the DROP INDEX statement to delete any index stored in the data DB area to be deleted. Here, delete B-tree index A stored in data DB area 1014.

  2. Delete the data DB area designated for deletion.

    Use the adbmodarea command to delete the data DB area designated for deletion. Here, that is data DB area 1014.

  3. Redefine indexes for the newly-combined data DB area.

    Use the CREATE INDEX statement to redefine for the newly-combined data DB area the index deleted in step 1. Here, redefine B-tree index A for base table A stored in data DB area 1013.

  4. Rebuild indexes.

    Because the index you redefined in step 3 is in unfinished status, you need to rebuild it. Use the adbidxrebuild command to rebuild the index. Here, execute the adbidxrebuild command on base table A for which B-tree index A was redefined.

Because combining the existing data DB areas has brought the number of data DB areas below the upper limit, you can now add a new data DB area.