ALTER STOGROUP

The ALTER STOGROUP statement changes the description of a storage group at the current server.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is implicitly or explicitly specified.

Authorization

The privilege set that is defined below must include one of the following:

  • Ownership of the storage group
  • SYSADM or SYSCTRL authority
Privilege set: If the statement is embedded in an application program, the privilege set is the privileges that are held by the owner of the package. If the statement is dynamically prepared, the privilege set is the union of the privilege sets that are held by each authorization ID and role of the process.

Syntax

Read syntax diagram
>>-ALTER STOGROUP--stogroup-name-------------------------------->

   .----------------------------------------------------.   
   |                         .-,-------------.          |   
   V  (1)                    V  (2)          |          |   
>----------+-ADD VOLUMES-(-+-------volume-id-+-+-)----+-+------->
           |               | .-,---.           |      |     
           |               | V     |           |      |     
           |               '---'*'-+-----------'      |     
           |                    .-,-------------.     |     
           |                    V  (2)          |     |     
           '-REMOVE VOLUMES-(-+-------volume-id-+-+-)-'     
                              | .-,---.           |         
                              | V     |           |         
                              '---'*'-+-----------'         

>--+-------------------+--+-------------------+----------------->
   '-DATACLAS--dc-name-'  '-MGMTCLAS--mc-name-'   

>--+-------------------+---------------------------------------><
   '-STORCLAS--sc-name-'   

Notes:
  1. The same clause must not be specified more than once.
  2. The same volume-id must not be specified more than once in the same clause.

Description

stogroup-name
Identifies the storage group to be altered. The name must identify a storage group that exists at the current server.
ADD VOLUMES(volume-id,...) or ADD VOLUMES('*',...)
Adds volumes to the storage group. Each volume-id is the volume serial number of a storage volume to be added. It can have a maximum of six characters and is specified as an identifier or a string constant.

A volume-id must not be specified if any volume of the storage group is designated by an asterisk (*). An asterisk must not be specified if any volume of the storage group is designated by a volume-id.

You cannot add a volume that is already in the storage group unless you first remove it with REMOVE VOLUMES.

Asterisks are recognized only by Storage Management Subsystem (SMS). If the data set that is associated with the storage group is non SMS managed, either ADD VOLUMES or REMOVE VOLUMES must be specified. Neither ADD VOLUMES or REMOVE VOLUMES is required if DATACLAS, MGMTCLAS, or STORCLAS is specified. SMS usage is recommended, rather than using DB2® to allocate data to specific volumes. Having DB2 select the volume requires non-SMS usage or assigning an SMS Storage Class with guaranteed space. However, because guaranteed space reduces the benefits of SMS allocation, it is not recommended.

If you do choose to use specific volume assignments, additional manual space management must be performed. Free space must be managed for each individual volume to prevent failures during the initial allocation and extension. This process generally requires more time for space management and results in more space shortages. Guaranteed space should be used only where the space needs are relatively small and do not change.

REMOVE VOLUMES(volume-id,...) or REMOVE VOLUMES('*',...)
Removes volumes from the storage group. Each volume-id is the volume serial number of a storage volume to be removed. Each volume-id must identify a volume that is in the storage group.

The REMOVE VOLUMES clause is applied to the current list of volumes before the ADD VOLUMES clause is applied. Removing a volume from a storage group does not affect existing data, but a volume that has been removed is not used again when the storage group is used to allocate storage for table spaces or index spaces.

Asterisks are recognized only by Storage Management Subsystem (SMS). If the data set that is associated with the storage group is non SMS managed, either ADD VOLUMES or REMOVE VOLUMES must be specified. Neither ADD VOLUMES or REMOVE VOLUMES is required if DATACLAS, MGMTCLAS, or STORCLAS is specified.

DATACLAS dc-name
Identifies the name of the SMS data class to associate with the DB2 storage group. The SMS data class name must be from 1-8 characters in length. The SMS storage administrator defines the data class that can be used. DATACLAS must not be specified more than one time.
MGMTCLAS mc-name
Identifies the name of the SMS management class to associate with the DB2 storage group. The SMS management class name must be from 1-8 characters in length. The SMS storage administrator defines the management class that can be used. MGMTCLAS must not be specified more than one time.
STORCLAS sc-name
Identifies the name of the SMS storage class to associate with the DB2 storage group. The SMS storage class name must be from 1-8 characters in length. The SMS storage administrator defines the storage class that can be used. STORCLAS must not be specified more than one time.

Notes

Work file databases:
If the storage group altered contains data sets in a work file database, the database must be stopped and restarted for the effects of the ALTER to be recognized. To stop and restart a database, issue the following commands:
  -STOP DATABASE(database-name)
  -START DATABASE(database-name)
Device types:
When the storage group is used at run time, an error can occur if the volumes in the storage group are of different device types, or if a volume is not available to z/OS® for dynamic allocation of data sets.

When a storage group is used to extend a data set, all volumes in the storage group must be of the same device type as the volumes used when the data set was defined. Otherwise, an extend failure occurs if an attempt is made to extend the data set.

Number of volumes:
There is no specific limit on the number of volumes that can be defined for a storage group. However, the maximum number of volumes that can be managed for a storage group is 133.

If the VOLUMES clause is specified, the maximum number of volumes is 59.

Verifying the existence of volumes and classes:
When processing the VOLUMES, DATACLAS, MGMTCLAS, or STORCLAS clauses, DB2 does not check the existence of the volumes or classes or determine the types of devices that are identified or if SMS is active. Later, when the storage group allocates data sets, the list of volumes is passed in the specified order to Data Facilities (DFSMSdfp). See DB2 Administration Guide for more information about creating DB2 storage groups.
SMS data set management:
You can have Storage Management Subsystem (SMS) manage the storage needed for the objects that the storage group supports. To do so, specify ADD VOLUMES('*') and REMOVE VOLUMES(current-vols) in the ALTER statement, where current-vols is the list of the volumes currently assigned to the storage group. SMS manages every data set created later for the storage group. SMS does not manage data sets created before the execution of the statement.

You can also specify ADD VOLUMES(volume-id) and REMOVE VOLUMES('*') to make the opposite change.

See DB2 Administration Guide for considerations for using SMS to manage data sets.

Examples

Example 1: Alter storage group DSN8G100. Add volumes DSNV04 and DSNV05.
   ALTER STOGROUP DSN8G100
       ADD VOLUMES (DSNV04,DSNV05);
Example 2: Alter storage group DSN8G100. Remove volumes DSNV04 and DSNV05.
   ALTER STOGROUP DSN8G100
     REMOVE VOLUMES (DSNV04,DSNV05);