DB2 10.5 for Linux, UNIX, and Windows

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.

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:

  1. To set up a redirected restore to testdb, issue the following command:
    RESTORE DATABASE testdb REDIRECT
  2. 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.
  3. To proceed with the restore, issue the following:
    RESTORE DATABASE testdb CONTINUE
  4. Update the storage group information in the catalog tables.
    CONNECT TO testdb
    ALTER TABLESPACE SALES MANAGED BY AUTOMATIC STORAGE
  5. If you modified the storage group for the table space during the redirected restore operation, issue the following command:
    RESTORE DATABASE testdb USING STOGROUP sg_default