You can convert an existing nonautomatic storage database
to use automatic storage using the ALTER DATABASE statement to add
new storage paths to the database.
About this task
Databases
that do not use automatic storage do not have
storage paths associated
with them. Instead, storage is associated with the table spaces for
the database. When you add new storage paths to a database for which
automatic storage was not previously enabled, the database becomes
an
automatic storage database. However, adding new storage
paths to a database will only enable the database for automatic storage;
by default, future table spaces that you create will use automatic
storage, but existing table spaces are not automatically converted.
You must use the ALTER TABLESPACE statement to convert existing table
spaces to use automatic storage.
Note: Only DMS table spaces can be
converted to use automatic storage.
Restrictions
You
cannot disable automatic storage for a database if it has been created
with or converted to use automatic storage.
Before you begin
You must have a storage location that you can identify with
a path (for Windows operating
systems, a path or a drive letter) available to use as a storage path
for your automatic storage table spaces.
Procedure
To convert an existing database to an automatic storage
database, use the ALTER DATABASE statement to add storage paths to
it:
- Formulate an ALTER DATABASE statement with an ADD STORAGE
ON clause. For example, to convert the database DATABASE1
to use automatic storage, use the following statement:
ALTER DATABASE DATABASE1 ADD STORAGE ON storagePath
where storagePath is
the path you want to use for automatic storage table spaces.
- Run the statement.
Example
Example
1: Converting a database on UNIX or Linux operating systems
Assume
the database EMPLOYEE is a nonautomatic storage database, and that
/data1/as and
/data2/as are
the paths you want to use for automatic storage table spaces. To convert
EMPLOYEE to an automatic storage database, use the following statement:
ALTER DATABASE EMPLOYEE ADD STORAGE ON '/data1/as', '/data2/as'
Example
2: Converting a database on Windows operating
systems
Assume the database SALES is a nonautomatic storage
database, and that
F:\DB2DATA and
G: are
the paths you want to use for automatic storage table spaces. To convert
SALES to an automatic storage database, use the following statement:
ALTER DATABASE EMPLOYEE ADD STORAGE ON 'F:\DB2DATA', 'G:'
What to do next
If
you have existing DMS table spaces that you want to convert to use
automatic storage, use the ALTER TABLESPACE statement with the MANAGED
BY AUTOMATIC STORAGE clause to change them.