IMS Utilities and Recovery: Complete Operations Guide

TT
TopicTrick

IMS database administration depends on a set of utility programs for backup, recovery, and reorganisation. Unlike relational databases where a DBA can issue SQL commands for most maintenance, IMS administration is utility-driven — batch JCL jobs that perform specific operations on the database. Understanding these utilities is essential for anyone responsible for IMS systems.

The IMS Recovery Framework

IMS provides complete database recovery through three components:

  1. Image Copies: Full or incremental copies of the database at a point in time
  2. IMS Log: The continuous record of every change made to the database
  3. Recovery Utilities: Programs that use image copies and log records to restore a database

The IMS log is always active during online and batch processing. When combined with periodic image copies, the log enables recovery to any point in time.

Image Copy Utility (DFSUDMP0)

The image copy utility creates a backup of an IMS database by reading all the database's VSAM/OSAM extents and writing them to a sequential output dataset.

Types of image copy:

  • Full image copy: Complete copy of the entire database
  • Incremental image copy: Copies only the blocks changed since the last image copy
jcl
//IMSCOPY  EXEC PGM=DFSRRC00,PARM='ULU,DFSUDMP0'
//DFSRESLB DD DSN=IMS.SDFSRESL,DISP=SHR
//IMS      DD DSN=IMS.PSBLIB,DISP=SHR
//         DD DSN=IMS.DBDLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  COPY DBDNAME(CUSTDB) DDNAME(CUSTDB01) ICTYPE(IC)
/*
//CUSTDB01  DD DSN=IMS.DATABASE.CUSTDB,DISP=SHR
//IMAGECOPY DD DSN=IMS.BACKUP.CUSTDB.IC,
//             DISP=(NEW,CATLG),SPACE=(CYL,(10,5))

Schedule full image copies at least daily for active databases, more frequently for critical high-update databases.

Database Recovery Utility (DFSRRC00 with DFSURDB0)

The recovery utility restores a database from an image copy and applies log records to bring it forward to a specified point in time.

Forward recovery procedure:

  1. Identify the most recent image copy before the failure
  2. Restore the database from the image copy (DFSURDB0 RESTORE)
  3. Apply log records from the image copy point to the recovery point (DFSURDB0 FORWARD)
jcl
//IMSRECOV EXEC PGM=DFSRRC00,PARM='ULU,DFSURDB0'
//DFSRESLB DD DSN=IMS.SDFSRESL,DISP=SHR
//IMS      DD DSN=IMS.PSBLIB,DISP=SHR
//         DD DSN=IMS.DBDLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  RESTORE DBDNAME(CUSTDB) ICDSN(IMS.BACKUP.CUSTDB.IC)
  FORWARD DBDNAME(CUSTDB) TOTIME(20260425.093000)
/*

Database Unload Utility (DFSURGL0)

DFSURGL0 unloads an IMS database to a flat sequential file in hierarchical sequence. This is used for:

  • Creating a backup before a database change
  • Exporting data for migration
  • Creating input for the reload utility after reorganisation
jcl
//IMSUNLD  EXEC PGM=DFSRRC00,PARM='DLI,DFSURGL0,UNLDPSB'
//DFSRESLB DD DSN=IMS.SDFSRESL,DISP=SHR
//IMS      DD DSN=IMS.PSBLIB,DISP=SHR
//         DD DSN=IMS.DBDLIB,DISP=SHR
//CUSTDB01 DD DSN=IMS.DATABASE.CUSTDB,DISP=SHR
//UNLOAD   DD DSN=IMS.UNLOAD.CUSTDB,
//            DISP=(NEW,CATLG),SPACE=(CYL,(50,10))
//SYSOUT   DD SYSOUT=*

Database Reload Utility (DFSURUL0)

DFSURUL0 loads a database from the sequential file created by DFSURGL0. Used after DBD changes that require rebuilding the database, or to initialise a new database.

jcl
//IMSLOAD  EXEC PGM=DFSRRC00,PARM='DLI,DFSURUL0,LOADPSB'
//DFSRESLB DD DSN=IMS.SDFSRESL,DISP=SHR
//IMS      DD DSN=IMS.PSBLIB,DISP=SHR
//         DD DSN=IMS.DBDLIB,DISP=SHR
//CUSTDB01 DD DSN=IMS.DATABASE.CUSTDB.NEW,DISP=SHR
//UNLOAD   DD DSN=IMS.UNLOAD.CUSTDB,DISP=SHR
//SYSOUT   DD SYSOUT=*

Database Reorganisation

IMS databases, particularly HISAM databases, accumulate overflow and free space fragmentation over time. Reorganisation involves unloading, recreating the physical datasets, and reloading:

  1. Take an image copy (safety backup)
  2. Stop online access to the database (quiesce)
  3. Unload with DFSURGL0
  4. Delete and reallocate the VSAM/OSAM datasets
  5. Reload with DFSURUL0
  6. Take a new image copy
  7. Resume online access

For HIDAM/HDAM databases, reorganisation reduces pointer fragmentation and restores performance. Most sites schedule monthly or quarterly reorganisation for active databases.

ACBGEN — Application Control Block Generation

After any DBD or PSB change, ACBs must be regenerated. ACBGEN merges updated DBDs and PSBs into new ACBs:

jcl
//ACBGEN  EXEC PGM=DFSRRC00,PARM='ULU,DFSUACB0'
//DFSRESLB DD DSN=IMS.SDFSRESL,DISP=SHR
//IMS      DD DSN=IMS.PSBLIB,DISP=SHR
//         DD DSN=IMS.DBDLIB,DISP=SHR
//IMSACB   DD DSN=IMS.ACBLIB,DISP=SHR
//SYSIN    DD *
  BUILD PSB(CUSTPGM)
  BUILD DBD(CUSTDB)
/*

Frequently Asked Questions

Q: How often should image copies be taken? For active production databases, take full image copies daily during the maintenance window (typically overnight) and incremental copies every few hours during the day if update rates are high. The recovery point objective (RPO) — how much data loss is acceptable — drives the frequency. A 4-hour RPO requires image copies at least every 4 hours.

Q: What is the DBRC and why is it important for IMS recovery? DBRC (Database Recovery Control) is an IMS component that tracks the history of all database activities — image copies, log volumes, recovery operations. DBRC ensures recovery utilities use the correct log volumes and image copies in the correct sequence. Without DBRC, manually tracking which log volumes cover which time periods becomes error-prone. DBRC is essentially mandatory in production IMS environments.

Q: Can IMS databases be recovered without stopping the online system? Yes — IMS supports concurrent image copy (online image copy) using IBM's DFSMS or ICF Catalog facilities, allowing backups to be taken while the database is online. Full recovery still requires stopping online access for the database being recovered, but the backup process itself can be concurrent.


Part of the IMS Mastery Course — Module 20 of 22.