Backup and Recovery of DB2 Analytics Accelerator data now possible! Part II

Creating a backup of data stored in an Accelerator

 

This is the second part of “Backup and Recovery of DB2 Analytics Accelerator data now possible!”. In this portion, we cover some of the details of the backup process of data stored in an Accelerator. We will start with two main scenarios and differentiate when a backup of Accelerator data might be needed:

  • Data is loaded into an Accelerator from non-DB2 for z/OS sources and should be backed up during the load process
  • Data already exists in an Accelerator-shadow or accelerator-only table and needs to be backed up

Note:  You will more than likely perform backups of data in Accelerator-only tables where no corresponding data exists in DB2 for z/OS. However, there may be exceptions where a backup is required for Accelerator-shadow tables. For example, prior to the introduction of Accelerator-only tables in the IBM DB2 Analytics Accelerator in V4.1 PTF4, the DB2 Analytics Accelerator Loader for z/OS (Loader) could be used to load data to an Accelerator-shadow table. This left the corresponding table empty in DB2 for z/OS.

The Loader supports backup of both Accelerator-shadow tables and Accelerator-only tables to cover all use cases. The backup process is identical regardless of the underlying type of Accelerator table.

Backup during the load process

 

Data can be loaded into an Accelerator using either a stored procedure, ACCEL_LOAD_TABLES, or the IBM DB2 Analytics Accelerator Loader for z/OS.

 

When invoking the stored procedure ACCEL_LOAD_TABLES, data is unloaded from DB2 for z/OS and transferred via USS pipes to Accelerator-shadow tables. This data originates in DB2 for z/OS and is managed in DB2 for z/OS only. Therefore, a backup and recovery strategy should be implemented using DB2 for z/OS standard processes. In this example, if data needs to be recreated in an Accelerator; it can be unloaded again using the ACCEL_LOAD_TABLES stored procedure from DB2 for z/OS. Alternatively, if IBM DB2 Analytics Loader for z/OS is available, it can be reloaded into an accelerator from the last image copy that is also restored in DB2 for z/OS.

 

The sweet spot for the Loader is for data that exists only in Accelerator-only tables and does not exist in DB2 for z/OS. Note that the concept of Accelerator-only tables was discussed in Part I of this blog.

 

We will discuss two different options for backing up data from Accelerator-only tables using the Loader. The first option can be compared to DB2 for z/OS LOAD utility’s feature to create an inline copy when data is loaded into DB2 for z/OS. IBM DB2 Analytics Accelerator Loader for z/OS uses a similar mechanism to back up data at the same time it is loaded into an Accelerator.

 

In order to create an inline copy when data is loaded into an Accelerator, you will need to add information about which data sets to use for local and remote backups as well as proper keywords to the syntax.

 

The Loader supports two local and two remote copies for each table. In example 1-1, we specify all four copy data sets: keyword ACCEL_COPYDDN points to DD statements to be used for primary and backup copies for the local site, keyword ACCEL_RECOVERYDDN points to DD statements to be used for primary and backup copies for the remote recovery site.

 

A modified LOAD job is shown in example 1-1. Lines marked in blue show required modifications as compared to a standard IBM DB2 Analytics Accelerator Loader for z/OS process for loading data into an Accelerator.

 

Example 1-1: JCL to create an inline copy during Accelerator load processing

 

//HLOD0100 EXEC PGM=DSNUTILB,

//              REGION=0000M,

//              PARM=('UB1A')

//STEPLIB  DD DISP=SHR,DSN=HLO.PRD0210.LOADLIB

//         DD DISP=SHR,DSN=UB1A.SDSNEXIT

//         DD DISP=SHR,DSN=DSN.VB10.SDSNLOAD

//ISYSREC  DD DISP=SHR,DSN=USER1.HLO.SYSREC

//HLOCPYLP DD DSN=USER1.HLO1533.LP,DISP=(NEW,CATLG,DELETE),

//            SPACE=(CYL,(1,1))

//HLOCPYLB DD DSN=USER1.HLO1533.LB,DISP=(NEW,CATLG,DELETE),

//            SPACE=(CYL,(1,1))

//HLOCPYRP DD DSN=USER1.HLO1533.RP,DISP=(NEW,CATLG,DELETE),

//            SPACE=(CYL,(1,1))

//HLOCPYRB DD DSN=USER1.HLO1533.RB,DISP=(NEW,CATLG,DELETE),

//            SPACE=(CYL,(1,1))

//HLODUMMY DD DUMMY

//SYSPRINT DD SYSOUT=*

//UTPRINT  DD SYSOUT=*

//SYSIN DD *

TEMPLATE ISYSUT1

    DSN '&US..IDSU.&DB..&TS..&UQ.'

    DISP(MOD,DELETE,CATLG)

    SPACE (10,100) CYL

TEMPLATE ISORTOUT

    DSN '&US..IDSO.&DB..&TS..&UQ.'

    DISP(MOD,DELETE,CATLG)

    SPACE (10,100) CYL

LOAD DATA

    IDAA_ONLY ON 'accelerator-name'

    ACCEL_ON_SUCCESS_ENABLE NO

    INDDN ISYSREC

    ACCEL_LOAD_TASKS 1

    RESUME YES

    ACCEL_COPYDDN(HLOCPYLP, HLOCPYLB)

    ACCEL_RECOVERYDDN(HLOCPYRP, HLOCPYRB)

    WORKDDN(ISYSUT1,ISORTOUT)

    INTO TABLE "schema"."table"

/*

 

Once data is loaded for schema.table to an Accelerator, backup data sets created during the process are registered in a new table called HLOUCOPY. Only data sets which are registered in HLOUCOPY can be used to recover data to an Accelerator.

Backup an Accelerator-shadow table or Accelerator-only table

 

If data exists on the Accelerator in either an Accelerator-shadow or Accelerator-only table and needs to be backed up, you can use the ISPF interface of IBM DB2 Analaytics Accelerator Loader for z/OS to build the required JCL. You can also create the JCL yourself. Example 1-2 shows the JCL to back up a table that already exists in an Accelerator:

 

Example 1-2: JCL to backup data in an Accelerator

 

//HLOB0100 EXEC PGM=HLOUBKUP,                                   

//         REGION=0000M,                                        

//         PARM=('PA1A')                                        

//STEPLIB  DD DISP=SHR,DSN=RSDEMO.HLO.SHLOLOAD                  

//         DD DISP=SHR,DSN=DSN.PA1A.SDSNEXIT                    

//         DD DISP=SHR,DSN=RSRTE.DSN.VA10.SDSNLOAD              

//HLOCPYLP DD DSN=hlq.backup.dataset.local,DISP=(NEW,CATLG,DELETE),

//           SPACE=(CYL,(100,100))                                  

//HLOCPYRP DD DSN=hlq.backup.dataset.remote,DISP=(NEW,CATLG,DELETE),

//           SPACE=(CYL,(100,100))                                  

//HLODUMMY DD DUMMY                                              

//SYSPRINT DD SYSOUT=*                                          

//SYSIN    DD *                                                 

  BACKUP_ACCELERATOR TABLE                                      

    schema.table                                              

    ACCEL_COPYDDN(HLOCPYLP)                                     

    ACCEL_RECOVERYDDN(HLOCPYRP)                                 

/*                                                                                                 

In the example shown, we used one local and remote copy data set. HLOCPYLP was specified as a local backup data set and HLOCPYRP was specified as a remote backup data set.

 

Once the job is completed, the backup data sets that were created during the process, are registered in table HLOUCOPY. HLOUCOPY keeps track of backup operations related to an Accelerator.

 

In Part III this blog, we'll discuss restoring data in an Accelerator based on previously created backups.

Views: 222

Comment

You need to be a member of The World of DB2 to add comments!

Join The World of DB2

© 2017   Created by Surekha Parekh.   Powered by

Badges  |  Report an Issue  |  Terms of Service