Implementing database versioning

To maintain and access multiple versions of a database, you must enable database versioning, define the new version of the database, and generate the necessary DBD, PSB, and ACB members.

Prerequisite: The IMS catalog must be enabled in your IMS system to support database versioning. See IMS catalog definition and tailoring.
To enable and implement database versioning, perform the following steps.

Procedure

  1. Enable database versioning by specifying DBVERSION=Y in the database section of the DFSDFxxx member in the IMS.PROCLIB data set.
  2. Optional: On the DBLEVEL= parameter in the DFSDFxxx member, set the system default for which version of the database IMS uses when application programs do not specify a version.
    Valid values are CURR and BASE. CURR returns data by using the version that is currently active in the IMS catalog. This is the default. BASE returns data by using version 0 of the database. Version 0 is the version of a database that existed prior to implementing versioning for the database.
  3. Code the changes to the database in the input macros to the DBD Generation utility:
    1. Specify the new version number on the DBVER keyword of the DBD statement
      Version numbers are integers that must increase in value by one when you define a new version.
    2. If you are changing the length of any segments, code the new length on the BYTES keyword of the SEGM statement.
    3. If you are defining new fields, code the FIELD statements.
      The starting offsets and lengths of existing fields cannot be changed.
  4. Code the versions that the application programs require in the input macros to the PSB Generation utility.
    Note: If multiple database PCBs in a PSB reference the same database, all of the PCBs must specify the same version of the DBD.
    1. Optionally, specify a default version level to return to application programs on the DBLEVEL keyword in one or more PSB statements.
    2. As necessary, specify specific versions to return to application programs on the DBVER keyword in the PCB statements.
    3. Generate the PCBs by running the PSB Generation utility.
  5. If you are not using an online alter function to apply the database changes to the online database, unload the database offline by using the DBD member for the existing database structure.
  6. Generate the DBD member for the new database structure by running the DBD Generation utility.
  7. If you are not using an online alter function to apply the database changes to the online database, reload the database by using the DBD member for the new database structure.
  8. Generate the ACB members for the new database version and update the IMS catalog by running the ACB Generation and Catalog Populate utility (DFS3UACB).

    If the database that you are altering has secondary indexes or is logically related to another database, in addition to specifying a BUILD DBD statement for the altered database, you must also specify a BUILD DBD statement for each secondary index database and each logically related database in the ACB Maintenance utility control statements.

  9. If you are using an online alter function to apply the database changes to an online database, start the alter function.
  10. Activate the ACB members for the new database structure and the application programs that use the database. In online systems use the Online Change (OLC) function.
  11. Start the database.
  12. Important: When a change is made to a DBD with versioning enabled, applications that are impacted by the change may need to be modified. Run a PSBGEN with the desired DBLEVEL specification.
  13. Important: Confirm that changes you have made to the database are supported for database versioning by running an application program that accesses a prior version of the database.
    IMS does not detect unsupported database changes until the first application program that requires an older version is scheduled to run.