3.13 Maintaining Efficient Tablespace Use by GeoRaster Objects

After delete or rollback operations, unused space allocated to a raster data table is not automatically returned to the underlying tablespace. This could result in wasted tablespace area. Since GeoRaster databases are usually large, it’s a good practice to efficiently maintain tablespace usage, particularly when disk space is limited. In general, you should use the LOB storage format SecureFiles LOBs (SecureFiles) or use BasicFiles LOBS (BasicFiles) in an automatic segment space management tablespace when creating RDTs. Then you can explicitly shrink the rasterBlock LOB segment or the raster data table by altering the raster data table, so that the table segment can be compacted and unused LOB segment can be released to the tablespace, as shown in Example 3-4 and Example 3-5.

Example 3-4 Shrinking a RasterBlock LOB Segment

ALTER TABLE city_images_rdt MODIFY LOB (rasterBlock)(SHRINK SPACE);

Example 3-5 Shrinking a Raster Data Table

ALTER TABLE city_images_rdt ENABLE ROW MOVEMENT;
ALTER TABLE city_images_rdt SHRINK SPACE CASCADE;

See shrink_clause in the ALTER TABLE statement in Oracle Database SQL Language Reference for more information.

As a good practice, if there will be some temporary GeoRaster objects to be created and used, you can always consider creating temporary GeoRaster tables and RDT tables to hold those GeoRaster objects. Once they are not needed, the temporary GeoRaster and RDT tables can be dropped to release the disk space.