Using concurrent copy to back up a running BQL database

Overview

BSA supports concurrent copy. This means that you can create a backup of the BQL database while the database is running.

Requirements

To back up a BQL database while it is running requires the concurrent copy function of z/OS DFSMS, or equivalent functions if you are using non-IBM products.

For detailed information on hardware requirements, refer to the appropriate IBM publication if you are using z/OS DFSMS. If you are using non-IBM products, refer to the documentation of these products.

What is concurrent copy?

Concurrent copy is a 3990 extended function that enables data center operations staff to take a copy or a dump of data while applications are updating that data. You can use concurrent copy to back up any data that can be backed up using DFSMSdss or DFDSS because DFSMSdss is the external interface to concurrent copy.

Concurrent copy delivers a copy of the data in a consistent form. The point in time of data consistency is the time when the concurrent copy environment is initialized. During the initialization of the concurrent copy environment the database is unavailable, but this takes only a matter of seconds. After the initialization of the concurrent copy environment is complete, the copy is logically complete and the database becomes available again.

While concurrent copy copies the database, all write operations to the database are intercepted. Before carrying out updates to tracks that have not yet been backed up, concurrent copy makes a copy of the original track in a side file. Backup uses the track in the side file instead of the updated track. The copy is physically complete once the concurrent copy process finishes copying the data to the output device.

Lock BQL DB and initialize CC environment

During the initialization of the concurrent copy (CC) environment the database is unavailable.

To prevent access to the database during this phase, the database must be locked. After the initialization of the concurrent copy environment is complete (indicated by message ADR734I), the database can be unlocked.

You can lock and unlock the BQL database using the program BST05LAU (see "BST05LAU: Locking and unlocking a BQL database") or BST05CMD (see example below).

BQL DB backup using concurrent copy

The following is a description of the basic procedure for using concurrent copy to back up a BQL database. For each individual Beta Systems product, special conditions may apply and additional steps may be necessary.

Caution: Before using the concurrent copy function, always refer to the product documentation first to find out whether the product supports this function.

Procedure

To back up a BQL database using concurrent copy:

  1. Run a backup job that locks the BQL database and then copies the datasets using concurrent copy function of ADRDSSU.

    Step 1: Locking the BQL database

    +-----------------------------------------------------------------+
    |//stepname EXEC PGM=BST01RFF,REGION=0M, |
    |// PARM='S=nn,BnnLST=xx,PGM= BST05CMD,SIGNON=YES' |
    |// ... |
    |//BQLIN DD * |
    | LOCK DATABASE |
    +-----------------------------------------------------------------+

    As a result of this step, the database components are locked. (This applies also to shared databases.)

    Step 2: Copying datasets using CC function of ADRDSSU

    +-----------------------------------------------------------------+
    |//stepname EXEC PGM=ADRDSSU |
    |// ... |
    |//SYSIN DD * |
    | statement CC |
    +-----------------------------------------------------------------+

    As a result of this step, the concurrent copy environment is initialized (DD SYSIN specifies CONCURRENT or CC).

  2. After the initialization of the concurrent copy environment is complete (Message ADR734I (xxx)-mmmmm(yy), date time CONCURRENT COPY INITIALIZATION [ UN ] SUCCESSFUL FOR ...), run a job to unlock the database.

    +-----------------------------------------------------------------+
    |//stepname EXEC PGM=BST01RFF,REGION=0M, |
    |// PARM='S=nn,BnnLST=xx,PGM= BST05CMD,SIGNON=YES' |
    |// ... |
    |//BQLIN DD * |
    | UNLOCK DATABASE |
    +-----------------------------------------------------------------+

    As a result of this job, the database components become available again.

Sample backup job

+--------------------------------------------------------------------+
|jobcard |
|//*-----------------------------------------------------------------|
|//* STEP1: LOCK ALL DATABASES *|
|//*-----------------------------------------------------------------|
|//* |
|//STEP1 EXEC PGM=BST01RFF,REGION=0M, |
|// PARM='S=nn,BnnLST=xx,PGM=BST05CMD,SIGNON=YES' |
|//STEPLIB DD DISP=SHR,DSN=BSA.LOAD |
|// DD DISP=SHR,DSN=BETAnn.LOAD |
|//SFFPARM DD DISP=SHR,DSN=BETA.PARMLIB |
|//BnnDEF DD DISP=SHR,DSN=BETAnn.DB.DEF |
|//* |
|//BQLPRINT DD SYSOUT=* |
|//SYSUDUMP DD SYSOUT=* |
|//BQLIN DD * |
| LOCK DATABASE |
|/* |
|//*---------------------------------------------------------------- |
|//* STEP2: BACKUP THE DATABASES WITH ADRDSSU * |
|//*---------------------------------------------------------------- |
|//* |
|//STEP2 EXEC PGM=ADRDSSU,REGION=0M,COND=(4,LT,STEP1) |
|//OUTDSN DD DSN=BACKUP.BETAnn,DISP=(,CATLG), |
|// UNIT=ROBO,LABEL=(1,SL) |
|//SYSPRINT DD SYSOUT=* |
|//SYSIN DD * |
| DUMP DATASET (INCLUDE(BETAnn.**) - |
| BY(DSORG,EQ,VSAM)) - |
| SHARE - |
| CONCURRENT - |
| OUTDD(OUTDSN) - |
| TOLERATE(ENQFAILURE) - |
| ALLDATA(*) - |
| OPTIMIZE(4) |
|/* |
+--------------------------------------------------------------------+

You can also find a sample job for BST05LAU in the BSA.SAMPLIB in member BQLLSAVE.

Sample unlock job

+--------------------------------------------------------------------+
|jobcard |
|//*-----------------------------------------------------------------|
|//* SAMPLE JOB TO RELEASE THE DATABASES *|
|//*-----------------------------------------------------------------|
|//* |
|//STEP1 EXEC PGM=BST01RFF,REGION=0M, |
|// PARM='S=nn,BnnLST=00,PGM=BST05CMD,SIGNON=YES' |
|//STEPLIB DD DISP=SHR,DSN=BSA.LOAD |
|// DD DISP=SHR,DSN=BETAnn.LOAD |
|//SFFPARM DD DISP=SHR,DSN=BETA.PARMLIB |
|//BnnDEF DD DISP=SHR,DSN=BETAnn.DB.DEF |
|//* |
|//BQLPRINT DD SYSOUT=* |
|//SYSUDUMP DD SYSOUT=* |
|//BQLIN DD * |
| UNLOCK DATABASE |
|/* |
+--------------------------------------------------------------------+

You can also find a sample job for BST05LAU in the BSA.SAMPLIB in member BQLULOCK.