Performing manual name swapping

The name swapping process swaps the name of the shadow database with the name of the original database.

Procedure

Complete the following steps to do data set name swapping manually:

  1. Issue a /DBRECOVERY command for each database involved to obtain exclusive control of the database. You must specify the GLOBAL option if the database is shared by multiple IMS systems. You must ensure that the /DBRECOVERY command that is issued on the local IMS system and the /DBRECOVEY commands that are propagated to the sharing IMS systems all complete successfully.

    When data set names are swapped for a HALDB, you must issue the /DBRECOVERY command for each partition that has been reorganized.

  2. Create IDCAMS ALTER statements to swap database data set names.

    Refer to the sample ALTER commands that are written in the HPSOUT2 data set. If you have specified the HPSGSWAP DD statement, the HPSGDBRC DD statement, or both, the same command stream is written in the data set that is specified on the DD statement. The data set that is specified on the HPSGSWAP DD statement is intended to be used as the SYSIN for IDCAMS, and the data set that is specified on the HPSGDBRC DD statement is intended to be used as the SYSIN for DSPURX00. You can use the command stream without change, or you can modify it to suit to your requirements. For sample command streams, see IDCAMS Command Stream for Name Swapping report and DBRC Notification Command Stream report.

    For VSAM data sets, you must rename the cluster and component names together.

    Attention: Be careful when you specify control statement INDEXBLD=YES,NEW for a database for which a secondary index is defined but the original index data set does not exist. In this case, the IDCAMS command stream that is generated by the Smart Reorg utility can be used only for renaming the cluster name of the shadow index data set to the cluster name of the original index data set. The commands for renaming the index and data components are not generated, and the information message HPSG0311I is issued. If you also want to change the component names, add the lines (*1), as shown in the following figure.
    Figure 1. IDCAMS command stream for changing cluster and component names for secondary index
           IF MAXCC EQ 0 THEN -
             DO
               ALTER   cluster_of_shadow_index_data_set          –
               NEWNAME(cluster_of_original_index_data_set        )
       *1      ALTER   data_component_of_shadow_index_data_set   -
       *1      NEWNAME(data_component_of_original_index_data_set )
       *1      ALTER   index_component_of_shadow_index_data_set  -
       *1      NEWNAME(index_component_of_original_index_data_set)
             END