Changing Db2-managed objects to use the new qualifier

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:

  1. Remove all table spaces and index spaces from the storage group by converting the data sets temporarily to user-managed data sets.
    1. 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)
    2. 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;
  2. 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).

  3. 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;
  4. 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.

  5. 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.

  6. Start each database, using the following command:
    -START DATABASE(dbname) SPACENAM(*)
  7. Verify the success of the procedure by entering the following command:
    -DISPLAY DATABASE(dbname)
  8. Using SQL, verify that you can access the data.