Sample BACKUP SYSTEM control statements

Use sample control statements as models for developing your own BACKUP SYSTEM utility control statements.

Example 1: Creating a full backup of a Db2 subsystem or data sharing group

The following control statement specifies that the BACKUP SYSTEM utility is to create a full backup copy of a Db2 subsystem or data sharing group. The full backup includes copies of both the database copy pool and the log copy pool. In this control statement, the FULL option is not explicitly specified, because it is the default.

//STEP1    EXEC DSNUPROC,TIME=1440,                
//         UTPROC='',                              
//         SYSTEM='DSN'                            
//SYSIN    DD *                                    
  BACKUP  SYSTEM                                   
/*  

Example 2: Creating a data-only backup of a Db2 subsystem or data sharing group

The following control statement specifies that BACKUP SYSTEM is to create a backup copy of only the database copy pool for a Db2 subsystem or data sharing group.

//STEP1    EXEC DSNUPROC,TIME=1440,              
//         UTPROC='',                            
//         SYSTEM='DSN'                          
//SYSIN    DD *                                  
  BACKUP  SYSTEM  DATA ONLY                      
/*                                               

Example 3: Creating a fast replication copy of the database copy pool and dumping the copy to tape

The following control statement specifies that BACKUP SYSTEM is to create a fast replication copy of the database copy pool and initiate a dump to tape of the fast replication copy.

//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K                      
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''       
//*                                                         
//*                                                         
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,                     
//     DISP=(MOD,DELETE,CATLG),                             
//     SPACE=(16384,(20,20),,,ROUND),                       
//     UNIT=SYSDA                                           
//DSNUPROC.SYSIN    DD  *                                   
   BACKUP  SYSTEM DATA ONLY DUMP                            
/*                                                

Example 4: Creating a fast replication copy of the database copy pool, dumping the copy to tape, and allowing oldest copy to be overwritten

The following control statement specifies that BACKUP SYSTEM is to perform the following actions:

  • Create a fast replication copy of the database copy pool
  • Initiate® a dump to tape of the fast replication copy
  • Allow the oldest fast replication copy to be overwritten
//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K                      
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''       
//*                                                         
//*                                                         
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,                     
//     DISP=(MOD,DELETE,CATLG),                             
//     SPACE=(16384,(20,20),,,ROUND),                       
//     UNIT=SYSDA                                           
//DSNUPROC.SYSIN    DD  *                                   
    BACKUP  SYSTEM DATA ONLY DUMP FORCE                     
/*                                          

Example 5: Dumping an existing fast replication copy to tape

The following control statement specifies that BACKUP SYSTEM is to dump the existing fast replication copy X'E5F9F1C1BD1909683AA8A1A600000E6962DE' to tape, using the DB2STGD2 dump class.

//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K 
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC='' 
//*       
//*   
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1, 
//     DISP=(MOD,DELETE,CATLG), 
//     SPACE=(16384,(20,20),,,ROUND),  
//     UNIT=SYSDA  
//DSNUPROC.SYSIN    DD  * 
      BACKUP  SYSTEM DATA ONLY DUMPONLY 
        TOKEN (X'E5F9F1C1BD1909683AA8A1A600000E6962DE')
          DUMPCLASS(DB2STGD2) 
/*  
Start of change

Example 6: Creating a system-level backup with alternate copy pools

The following control statement specifies that BACKUP SYSTEM is to use an alternate copy pool for the system-level backup. The DBBSG option specifies the backup storage group for the database copy pool. The LGBSG option specifies the backup storage group for the log copy pool.

BACKUP SYSTEM DUMPONLY TOKEN(X'C4C2F2C1CD93124D9A9833340000A50079AA') DUMPCLASS(DB2STGD2)
ALTERNATE_CP(ALTERNATE1) DBBSG(BACKUP2) LGBSG(BACKUP1)

When you run this utility, the output messages show that the utility uses the following copy pool names:

  • DSN$ALTERNATE1$DB for the database copy pool
  • DSN$ALTERNATE1$LG for the log copy pool
DSNU050I 220 09:46:07.85 DSNUGUTC - BACKUP SYSTEM DUMPONLY TOKEN(X'C4C2F2C1CD93124D9A9833340000A50079AA')
DUMPCLASS(DB2STGD2) ALTERNATE_CP(ALTERNATE1) DBBSG(BACKUP2) LGBSG(BACKUP1) 
DSNU1600I   220 09:46:07.85 DSNUVBBD - BACKUP SYSTEM UTILITY FOR DATA STARTING,
                       COPYPOOL = DSN$ALTERNATE1$DB  
                       TOKEN = X'C4C2F2C1CD93124D9A9833340000A50079AA'.
...
DSNU1600I   220 09:46:07.94 DSNUVBBD - BACKUP SYSTEM UTILITY FOR LOGS STARTING, 
                       COPYPOOL = DSN$ALTERNATE1$LG 
                       TOKEN = X'C4C2F2C1CD93124D9A9833340000A50079AA'.

BACKUP SYSTEM generated these names based on the ALTERNATE_CP value in the utility statement and the DB2® convention for copy pool names.

Related information:
End of change