Converting table spaces to use automatic storage
You can convert some or all of your database-managed space (DMS) table spaces in a database to use automatic storage. Using automatic storage simplifies your storage management tasks.
Before you begin
Ensure that the database has at least one storage group. To do so, query SYSCAT.STOGROUPS, and issue the CREATE STOGROUP statement if the result set is empty.
Note:
- If you are not using the automatic storage feature, you must not use the storage paths and naming conventions that are used by automatic storage. If you use the same storage paths and naming conventions as automatic storage and you alter a database object to use automatic storage, the container data for that object might be corrupted.
- The reclaimable_space_enabled table space attribute is not modified when the table space is altered to be automatic storage. If reclaimable_space_enabled is false, then the reclaimable storage feature is not available. A table space's reclaimable_space_enabled attribute cannot be changed. So, the data must be moved to a new table space by unloading and loading the data, or by using the ADMIN_MOVE_TABLE utility.
Procedure
To convert a DMS table space to use automatic storage, use one of the following methods:
Example
To convert a database managed table space SALES to automatic storage during a redirected restore, do the following:
- To set up a redirected restore to
testdb
, issue the following command:RESTORE DATABASE testdb REDIRECT
- Modify the table space SALES to be managed
by automatic storage. The SALES table space has
an ID value of 5.
SET TABLESPACE CONTAINERS FOR 5 USING AUTOMATIC STORAGE
Note: To determine the ID value of a table space during a redirect restore use the GENERATE SCRIPT option of the RESTORE DATABASE command. - To proceed with the restore, issue the following:
RESTORE DATABASE testdb CONTINUE
- Update the storage group information in the catalog
tables.
CONNECT TO testdb ALTER TABLESPACE SALES MANAGED BY AUTOMATIC STORAGE
- If you modified the storage group for the table space during the redirected restore operation,
issue the following
command:
ALTER TABLESPACE SALES MANAGED BY AUTOMATIC STORAGE USING STOGROUP sg_default