Converting a nonautomatic storage database to use automatic storage
You can convert an existing nonautomatic storage database to use automatic storage by using the CREATE STOGROUP statement to define the default storage group within a database.
Before you begin
- Once you have created a storage group, you cannot drop all storage groups for a database.
- Only DMS table spaces can be converted to use automatic storage.
About this task
Databases that are created specifying the AUTOMATIC STORAGE NO clause of the CREATE DATABASE command do not have storage groups associated with them. Instead, storage is associated with the table spaces for the database. When you define a storage group for a database, existing table spaces are not automatically converted to use automatic storage. By default, only future table spaces that you create are automatic storage table spaces. You must use the ALTER TABLESPACE statement to convert existing table spaces to use automatic storage.
Procedure
You can convert an existing database to an automatic storage database by using the CREATE STOGROUP statement to create a storage group within it.
CREATE STOGROUP sg ON storagePath
where sg is
the storage group and storagePath is the path you
want to use for automatic storage table spaces.Example
Example 1: Converting a database on UNIX or Linux® operating systems
CREATE STOGROUP sg ON '/data1/as', '/data2/as'
Example 2: Converting a database on Windows operating systems
CREATE STOGROUP sg ON 'F:\DB2DATA', 'G:'
What to do next
Once you have created a storage group you can create automatic storage table spaces in which to store tables, indexes and other database objects by using the CREATE TABLESPACE statement.