You can keep an existing Db2 storage
group and change only the high-level qualifier.
About this task
The following procedure applies to most Db2-managed objects, but not to partition-by-growth table spaces. For information about changing the high-level qualifier for partition-by-growth table spaces, follow the procedure in Moving Db2-managed data with REORG, RECOVER, or REBUILD.
Procedure
To change Db2-managed objects:
- Remove all table spaces and index spaces from the storage
group by converting the data sets temporarily to user-managed data
sets.
- Stop each database that has data sets you are going
to convert, using the following command:
-STOP DATABASE(dbname) SPACENAM(*)
Restriction: Some databases must be
explicitly stopped to allow any alterations. For these databases,
use the following command:
-STOP DATABASE(dbname)
-
Convert to user-managed data sets with the USING VCAT clause of the SQL ALTER TABLESPACE and
ALTER INDEX statements, as shown in the following statements.
The data sets are VSAM linear data sets cataloged in the integrated catalog facility catalog that catalog-name identifies. For more information about catalog-name values, see Naming conventions in SQL.
ALTER TABLESPACE dbname.tsname
USING VCAT catalog-name;
ALTER INDEX creator.index-name
USING VCAT catalog-name;
- Drop the storage group, using the following statement:
DROP STOGROUP stogroup-name;
The DROP succeeds only if all the objects that referenced
this STOGROUP are dropped or converted to user-managed (USING VCAT
clause).
- Re-create the storage group using the correct volumes and
the new alias, using the following statement:
CREATE STOGROUP stogroup-name
VOLUMES (VOL1,VOL2)
VCAT catalog-name;
- Using IDCAMS, rename the data sets for the index spaces
and table spaces to use the new high-level qualifier. Also, be sure
to specify the instance qualifier of your data set, y,
which can be either I or J:
ALTER oldcat.DSNDBC.dbname.*.y0001.A001 -
NEWNAME(newcat.DSNDBC.dbname.*.y0001.A001)
ALTER oldcat.DSNDBD.dbname.*.y0001.A001 -
NEWNAME(newcat.DSNDBD.dbname.*.y0001.A001)
If your table space or index space spans more than one data
set, be sure to rename those data sets also.
- Convert the data sets back to Db2-managed data sets by using the new Db2 storage group.
Use the following SQL ALTER TABLESPACE and ALTER INDEX statements:
ALTER TABLESPACE dbname.tsname
USING STOGROUP stogroup-name
PRIQTY priqty
SECQTY secqty;
ALTER INDEX creator.index-name
USING STOGROUP stogroup-name
PRIQTY priqty
SECQTY secqty;
If you specify USING STOGROUP without
specifying the PRIQTY and SECQTY clauses, Db2 uses the default values.
- Start each database, using the following command:
-START DATABASE(dbname) SPACENAM(*)
- Verify the success of the procedure by entering the following
command:
-DISPLAY DATABASE(dbname)
- Using SQL, verify that you can access the data.