3. Statements : OpenROAD SQL Statements : Modify Statement : Modify...to Relocate
 
Share this page                  
Modify...to Relocate
To move the data without changing the number of locations or storage structure, specify modify...to relocate.
For example, to relocate the employee table to three different areas:
modify employee to relocate
        with    oldlocation = (area1, area2, area3),
                newlocation = (area4, area5, area6);
The data in area1is moved to area4, the data in area2 is moved to area5, and the data on area3 is moved to area6. The number of areas listed in the oldlocation and newlocation options must be equal. The data in each area listed in the oldlocation list is moved “as is” to the corresponding area in the newlocation list. The oldlocation and newlocation options can only be used when relocate is specified.
To change some but not all locations, specify only the locations to be changed. For example, you can move only the data in area1 of the employee table:
modify employee to relocate
    with    oldlocation = (area1),
            newlocation = (area4);
Areas 2 and 3 are not changed.
The DBMS Server is very efficient at spreading a table or index across multiple locations. For example, if a table is to be spread over three locations:
create table large (wide varchar(2000))
        with location = (area1, area2, area3);
rows are added to each location in turn, in 16 page (approximately 32K for the 2K page size) chunks. If it is not possible to allocate 16 full pages on an area when it is that area's turn to be filled, the table is out of space, even if there is plenty of room in the table's other areas.