When only a specific area needs to be restructured, once database objects have been moved to a new Storage Area, area extents can be removed from the database structure.
The TABLEMOVE utility can be used with the database online. Refer to the following Articles for the performance considerations:
Example:
- The sports database tables Invoice, Customer, Item, Salesrep, State, Local-Default, and Ref-Call are moved from the "Info Area" into a new area.
- Their associated indexes are moved at the same time into a separate index area.
- Finally, the Info Area is removed from the database structure.
1. Create the example database:$ prodb $DLC/sports sports2. Add new Storage Areas to the database structure:$ prostrct add sports add.stwhere
'add.st' file contains the following:
d "New Area":9,128;64 .
d "Index Area":10,1;1 .
3. Update the structure file and confirm that those areas have been added:
$ prostrct list sports
4. Start the database:
$ proserve sports -B 3000 -i
5. Move those tables and indexes:
$ proutil sports -C tablemove Invoice "New Area" "Index Area"
$ proutil sports -C tablemove Customer "New Area" "Index Area"
$ proutil sports -C tablemove Item "New Area" "Index Area"
$ proutil sports -C tablemove Salesrep "New Area" "Index Area"
$ proutil sports -C tablemove State "New Area" "Index Area"
$ proutil sports -C tablemove Local-Default "New Area" "Index Area"
$ proutil sports -C tablemove Ref-Call "New Area" "Index Area"
6. There is now no data in the Info Area, so it can be removed offline:
$ proshut sports -by
$ proutil sports -C truncate bi
$ prostrct remove sports d "Info Area"
7. List the database structure to confirm that the area has been removed and also to update its 'sports.st' structure file:
$ prostrct list sports