midwest ims rug 09_2013 - ims13 db versioning and alter.pdf

Post on 13-Dec-2014

263 Views

Category:

Technology

5 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

®

IMS 13

IMS 13 Database Versioning and

Alter

© 2012 IBM Corporation

Alter

IMS 13

Database Versioning

08- IMS 13 DB & DBRC: 2

Database Versioning

IMS 13

Database Versioning

� Background

– Customers need to support multiple views of the physical IMS data

– Customers need to make database structure changes while minimizing

the impact to existing application programs that do not need sensitivity to the new physical structure of the database

� Solution

– Enable application programs to use different versions of the same

08- IMS 13 DB & DBRC: 3

– Enable application programs to use different versions of the same physical IMS database

– Maintain multiple views of the physical IMS data in the IMS catalog

– Allow physical database structure changes without modifying all the application programs using the database

� Benefit

– Minimize impact and reduce cost associated with making and

coordinating coding changes to affected application programs when a physical database structure changes

IMS 13

Database Versioning Overview (cont’d)

� Database Versioning supports the following database types

– DEDB

– HDAM

– HIDAM

– PHDAM

– PHIDAM

08- IMS 13 DB & DBRC: 4

� Database Versioning only supports the following database structure changes

– For all supported database types

• Increasing the length of a segment

• Adding a new field to space at the end of a segment

– For Full-Function and HALDB database types

• Adding new field(s) that remap existing field(s) and space at the end of a segment

IMS 13

� Database Versioning must be enabled

� Versioning is at the DBD level

– Users define the version of a database definition on the DBD

– Version numbers must be maintained in incremented values

� Database Versioning requires enablement of the IMS catalog

Database Versioning Overview (cont’d)

08- IMS 13 DB & DBRC: 5

� Database Versioning requires enablement of the IMS catalog

– DBD definitions for versioned databases must be in the IMS catalog

� Application programs scan elect the desired database version

– Specifying the version number on the PCB of the PSB

– Specifying the version number on a DL/I INIT VERSION call

IMS 13

� DFSDFxxx PROCLIB: new DATABASE section keywords

– Specify whether database versioning is enabled and default version

• DBVERSION=

• DBLEVEL=

� Database and Program Generation Statements

– Specify the database version number

Database Versioning Implementation

08- IMS 13 DB & DBRC: 6

– Specify the database version number

• DBD: DBVER=

• PCB: DBVER=

– Override the default versioning specified in DFSDFxxx

• PSBGEN: DBLEVEL=

� “INIT VERSION” DL/I Call

– Overrides the version number that is specified on the PCB statement

– Must be issued before issuing a DL/I DB call to the database

IMS 13

Solution Overview – DFSDFxxx PROCLIB Member

� New keywords added to DATABASE section

– DBVERSION = Y | N

• Enables database versioning

• Database versioning is disabled by default

– DBLEVEL = CURR | BASE

• Ignored when DBVERSION=N

08- IMS 13 DB & DBRC: 7

• Ignored when DBVERSION=N

• CURR (default)

– IMS returns data from all databases using the current DBD version,

which is the current physical level, unless a specific version is specified

• BASE

– IMS returns data from all databases using the lowest DBD version

number retrieved from IMS Catalog, unless a specific version is specified

IMS 13

Solution Overview – DBD Version Number

� If database versioning is enabled, the database version used to return the IMS data is determined by the following hierarchy:

1. DL/I INIT VERSION call

2. PCB Statement DBVER= parameter

08- IMS 13 DB & DBRC: 8

3. PSBGEN Statement DBLEVEL= parameter

4. DFSDFxxx DATABASE Section DBLEVEL= parameter

DL/I INIT VERSION call takes precedence over all other database version number specifications and defaults

IMS 13

Solution Overview – Current IMS Catalog Flow Timestamp instances

DBJK21 DBJK22 DBJK23

ACBLI B

DBJK21 TS0V0DBJK22 TS0V0T1V0

IMS Catalog

DBJK21 DBJK22 DBJK23

DBDLIB

PSBJK

PSBLIB

PSBGEN

--------------------------

PCB

--------------------------

PSB=PSBJK Source

DBJK21

DBD Source

DBJK22

DBJK23

DBDGEN

PSBGEN

ACBGEN

08- IMS 13 DB & DBRC: 9

DBJK21

DBJK22

DBJK23

Application

DBJK21

DBJK22

DBJK23

IMS

DBJK22 TS0V0T1V0DBJK23 TS0V0

PSBJK--------------------------

DBJK21

DBJK22

DBJK23

DBJK21

DBJK22

DBJK23

DLIActive

IMS 13

Solution Overview – Database Versioning Flow Example

DBJK21 V1DBJK22 V1DBJK23 V1

ACBLI B

DBJK21 V0,V1DBJK22 V0,V1

IMS Catalog

DBJK21 V1DBJK22 V1DBJK23 V1

DBDLIB

PSBJK

PSBLIB

PSBGEN

--------------------------

PCB

--------------------------

PSB=PSBJK Source

DBJK21 V1

DBD Source

DBJK22 V1

DBJK23 V1

DBDGEN

PSBGEN

ACBGEN

08- IMS 13 DB & DBRC: 10

DBJK21 V0

DBJK22 V1

DBJK23 V1

Application

DBJK21

DBJK22

DBJK23

IMS

DBJK22 V0,V1DBJK23 V0,V1

PSBJK--------------------------

DBJK21 V0

DBJK22

DBJK23 V1

DBJK21 V0

DBJK22 V1

DBJK23 V1

DLI

Retrieve from Catalog

DBJK21 V1

DBJK22 V1

DBJK23 V1

Active

IMS 13

Solution Overview – Database Versioning Flow Example

DBJK21 V2DBJK22 V2DBJK23 V2

ACBLI B

DBJK21 V0,V1,V2DBJK22 V0,V1,V2

IMS Catalog

DBJK21 V2DBJK22 V2DBJK23 V2

DBDLIB

PSBJK

PSBLIB

PSBGEN

DBLEVEL=BASE

--------------------------

PCB

--------------------------

PSB=PSBJK Source

DBJK21 V2

DBD Source

DBJK22 V2

DBJK23 V2

DBDGEN

PSBGEN

ACBGEN

08- IMS 13 DB & DBRC: 11

DBJK21 V1

DBJK22 V0

DBJK23 V2

Application

DBJK21

DBJK22

DBJK23

IMS

DBJK22 V0,V1,V2DBJK23 V0,V1,V2

PSBJK--------------------------

DBJK21 V1

DBJK22

DBJK23 V2

DBJK21 V2

DBJK22 V2

DBJK23 V2

DBJK21 V1

DBJK22 V0

DBJK23 V2

DLI

Retrieve from Catalog

Active

IMS 13

Solution Overview – Database Versioning Flow Example

DBJK21 V3DBJK22 V3DBJK23 V3

ACBLI B

DBJK21 V0,V1,V2,V3DBJK22 V0,V1,V2,V3

IMS Catalog

DBJK21 V3DBJK22 V3DBJK23 V3

DBDLIB

PSBJK

PSBLIB

PSBGEN

DBLEVL=CURR

--------------------------

PCB

--------------------------

PSB=PSBJK Source

DBJK21 V3

DBD Source

DBJK22 V3

DBJK23 V3

DBDGEN

PSBGEN

ACBGEN

08- IMS 13 DB & DBRC: 12

DBJK21 V1

DBJK22 V3

DBJK23 V2

Application

DBJK21

DBJK22

DBJK23

IMS

DBJK22 V0,V1,V2,V3DBJK23 V0,V1,V2,V3

PSBJK--------------------------

DBJK21 V1

DBJK22

DBJK23 V2

DBJK21 V3

DBJK22 V3

DBJK23 V3

DBJK21 V3

DBJK22 V2

DBJK23 V1

DLI

Retrieve from Catalog

Active

IMS 13

Solution Overview – Database Versioning Flow Example

DBJK21 V3DBJK22 V3DBJK23 V3

ACBLI B

DBJK21 V0,V1,V2,V3DBJK22 V0,V1,V2,V3

IMS Catalog

DBJK21 V3DBJK22 V3DBJK23 V3

DBDLIB

PSBJK

PSBLIB

PSBGEN

DBLEVL=CURR

--------------------------

PCB

--------------------------

PSB=PSBJK Source

DBJK21 V3

DBD Source

DBJK22 V3

DBJK23 V3

DBDGEN

PSBGEN

ACBGEN

08- IMS 13 DB & DBRC: 13

DBJK21 V1

DBJK22 V3

DBJK23 V2

Application

DBJK21

DBJK22

DBJK23

IMS

DBJK22 V0,V1,V2,V3DBJK23 V0,V1,V2,V3

PSBJK--------------------------

DBJK21 V1

DBJK22

DBJK23 V2

DBJK21 V3

DBJK22 V3

DBJK23 V3

DBJK21 V3

DBJK22 V2

DBJK23 V1

DLI

Retrieve from Catalog

INIT VERSION(

DBJK21=3

DBJK22=2

DBJK23=1)

Active

Override

PSBGEN

IMS 13

� Enable IMS Catalog

– Populate catalog with DBD version definitions

– Before Database Versioning is enabled for a database, IMS continues

to only recognize only the current active database definition

� Recommendations

– In preparation to enable Database Versioning, specify the new DBD and PSB statement versioning attributes

Database Versioning Migration Considerations

08- IMS 13 DB & DBRC: 14

and PSB statement versioning attributes

• Use the DBLEVEL=CURR setting so all applications access the

databases at latest levels by default

• Use the PCB DBVER= parameter if an application needs to continue using an old version of a database

– All systems in an IMSplex must be running IMS 13

– Enable Database Versioning

IMS 13

HALDB Alter

08- IMS 13 DB & DBRC: 15

HALDB Alter

IMS 13

HALDB Alter

� Background

– Customers face the challenge of maintaining online database availability

while making structural changes to a HALDB database

– Customers cannot make structural changes to a Full Function HALDB without taking the database offline to unload/reload

� Solution

08- IMS 13 DB & DBRC: 16

– Structural changes can be made to DBD segment definitions

– Online reorganization command must be issued to apply the structural

change to the HALDB database

– Online change command must be issued to activate the new ACBLIB

member

� Benefit

– Make structural changes to a database while maintaining database availability

IMS 13

HALDB Alter Prerequisites

� Software requirements

– CSL

• SCI

• OM

– DBRC RECON MINVERS (‘13.1’)

08- IMS 13 DB & DBRC: 17

– DBRC RECON MINVERS (‘13.1’)

� Hardware requirements

– Same as base IMS 13

IMS 13

HALDB Alter Overview

� Structural changes can be made to HALDB databases while the database remains online

– Add a new field to space at the end of an existing segment

– Increase the length of an existing segment

– Define new fields that remap existing fields and space in an existing segment

08- IMS 13 DB & DBRC: 18

existing segment

� HALDB Alter is only supported for database types:

– PHDAM

– PHIDAM

IMS 13

HALDB Alter Overview (cont’d)

� After changes are made to the DBD segment definition

– Type-2 Online Reorg command is used to alter a database from the current structure to the new structure

• Type-1 command /INITIATE OLREORG does not support altering a HALDB

– Online Change commands are used to bring the changed ACBLIB

08- IMS 13 DB & DBRC: 19

– Online Change commands are used to bring the changed ACBLIB DBD member online

– Application programs can start using the new database structure

IMS 13

FIELD 1

FIELD 2 Space

FIELD 2 SpaceNew

FIELD 3

Add a new field to space at the end of a segment

Example 1

FIELD 1

08- IMS 13 DB & DBRC: 20

FIELD 1

FIELD 3

Example 2

FIELD 1 FIELD 2

FIELD 2 Space

New

FIELD 3Space

IMS 13

FIELD 1

FIELD 2

New SpaceFIELD 2

Increase the length of an existing segment

Example 1

FIELD 1

08- IMS 13 DB & DBRC: 21

FIELD 1

Example 2

FIELD 1 FIELD 2

FIELD 2

New Space

Space

Space

IMS 13

FIELD 1

FIELD 2

SpaceFIELD 2

Define new fields to remap existing fields & space in a segment

Example 1

FIELD 1

Overlay

FIELD 3

New

FIELD 5

Overlay

FIELD 4

Space

08- IMS 13 DB & DBRC: 22

FIELD 1

Example 2

FIELD 1 FIELD 2

FIELD 2

SpaceNew

FIELD 4

Space

Overlay

FIELD 3Space

IMS 13

HALDB Alter Preparation

� Change the DBD source code

– Define new fields in space at end of segment

• Specify new FIELD statements

– Increase the length of a segment

• Specify new length in the BYTES= parameter of SEGM statement

– Overlay existing fields and space in a segment

08- IMS 13 DB & DBRC: 23

– Overlay existing fields and space in a segment

• Specify overlay and new FIELD statements

� Run DBDGEN

– Changed DBD used as input

� Run ACBGEN

– //IMSACB DD pointing to the staging ACBLIB

IMS 13

HALDB Alter Online Processing

� Online reorg is used to alter the structure of a HALDB database

– The input DBD comes from the current version in the active ACBLIB

– The output DBD comes from the new version in a staging ACBLIB

� Delta files are built to represent the changes between the active/input DMB and the staged/output DMB

08- IMS 13 DB & DBRC: 24

active/input DMB and the staged/output DMB

� All database partitions are included in the reorg process

� Application programs accessing the existing database continue running using the current version of the DBD

� Max of 10 TCBs will be scheduled concurrently for an ALTER process, if necessary

IMS 13

HALDB Alter Example

� Update DBD source for MASTER database

– Increases the size of segment B from 30 bytes to 40 bytes

� Run DBDGEN

� Run ACBGEN(s) into staging ACB library

� DBRC CHANGE.PART ALTERSZE() to alter BLK or CI size, if necessary

� Issue INIT OLREORG NAME(MASTER) OPTION(ALTER)

– Builds the input DMB control blocks using the active ACBLIB

A

B

C

MASTER DB

08- IMS 13 DB & DBRC: 25

– Allocates the staging ACBLIB

– Builds the output DMB control blocks using the staging ACBLIB

– Allocates the output database data set(s)

� Make updates to affected application programs

� Backup active ACBLIB members affected by changes

� Stop MASTER DB access

� Perform Online Change

� Start MASTER DB access

New DMBIMS

Staging ACBLIB

Old DMBActive

ACBLIB

Input data sets

A – J, X

Output data sets

M – V, Y

OLR

IMS 13

Fast Path DEDB Alter

08- IMS 13 DB & DBRC: 26

Fast Path DEDB Alter

IMS 13

DEDB Alter

� IMS 13 adds ability to dynamically change DEDB specifications

– Users can dynamically change UOW, SIZE, ROOT, Randomizer while DEDB is online

– New DEDB Alter utility is used for DEDB changes

– DRD is not required for DEDB Alter

– Supports VSO Areas if /VUNLOAD is done before DEDB Alter is executed

08- IMS 13 DB & DBRC: 27

� Benefits

– Improved management of DEDB definitions

• Eliminate system down time for modifications to DEDB definitions

• Improve data availability since changes are done while DEDB is online

IMS 13

Preparation for DEDB Alter

� DEDB Alter function changes:

– ALTERAREA area_name

• Modify the active DEDB AREA statement (SIZE, UOW, ROOT, RMNAME)

– REPLRAND

• Modify the active DEDB AREA statement (RMNAME)

08- IMS 13 DB & DBRC: 28

� IMS Gens needed for ALTERAREA, REPLRAND:

– Run the DBDGEN utility to create new DEDB DBD definitions

– Run the ACBGEN utility for all PSBs that reference changed DEDB DBD

• New ACBs are added to staging ACBLIB data sets

IMS 13

New DEDB Alter Utility (DBFUDA00)

� DEDB Alter utility supports three functions

– ALTERAREA area_name

• Allow DBD parms (UOW, ROOT, SIZE, RMNAME) to change values

– REPLRAND

08- IMS 13 DB & DBRC: 29

• Allow DBD parm (RMNAME) to change Randomizer name

� The following requirements apply when using the DEDB Alter utility:

– DEDB databases must be registered to DBRC.

– The randomizer must be a genuine two-stage randomizer and defined as a two-stage randomizer in the DBD.

– To run the DEDB Alter utility, all IMS™ data-sharing systems must be at the IMS Version 13 or later level. The MINVERS value in the RECON data set must be 13.1 or later.

IMS 13

Preparation for DEDB Alter

� Allocate Shadow Area data sets

– Shadow Area data sets used for migrating existing data from Active Areas

– Single Area Data Sets (SADS)

• Single Shadow data set is required

– Multiple Area Data Sets (MADS)

• 2 to 7 Shadow data sets are required

08- IMS 13 DB & DBRC: 30

• 2 to 7 Shadow data sets are required

– SADS can become MADS and MADS can become SADS after DEDB Alter

• Depends on the number of allocated Shadow Area data sets

– Shadow data sets are not accessible by the IMS System

• Accessible to DEDB Alter utility only

� Allocate Shadow IC data sets:

– Created while DEDB Alter migrates data to Shadow Area data sets

IMS 13

Preparation for DEDB Alter

� Register Shadow data sets to DBRC (INIT.ADS)

>>-INIT.ADS--ADDN(shadowname)--ADSN(shadowname)--AREA(name)--DBD(name)--->

08- IMS 13 DB & DBRC: 31

.-UNAVAIL-----.

>--+---------+-------+---------------+--------------------------><

` '-AVAIL----------' '-SHADOW------+-------'

'-IC----'

IMS 13

Preparation for DEDB Alter

� Format Shadow data sets with DEDB Area Init Util (DBFUMIN0)

– Shadow Area data sets and Shadow IC data sets formatted

– Two new control cards:

– ACTIVE = Format Area data sets for DEDB Area

– SHADOW = Format Shadow Area and Shadow IC data sets

– Formats Active or Shadow data sets in one execution, but not both

08- IMS 13 DB & DBRC: 32

– Formats Active or Shadow data sets in one execution, but not both

– When DBRC=Y, formats both Shadow Area and Shadow IC in one execution

� New ACB from Staging ACBLIB used for formatting

� After utility completes, flags are set in RECON:

– Shadow Area data sets are marked “SHADOW AVAIL”

– Shadow IC Area data sets are marked “SHADOW IC AVAIL”

� Shadow data sets must be formatted before DEDB Alter utility runs

IMS 13

Preparation for DEDB Alter

� ACBLIB staging library needs dynamic allocation member

– Create a DFSMDA member for the ACBLIB staging library

• If one does not already exist

– Sample JCL:

08- IMS 13 DB & DBRC: 33

DFSMDA TYPE=INITIAL DFSMDA TYPE=IMSACB,DSNAME=STAGING.LIBRARY DFSMDA TYPE=FINAL

� New DEDB Alter Datasharing Group Name

– Defined in <SECTION=FASTPATH> in DFSDFxxx Proclib Member

– ALTERGRP=nnnnn (Prefixed by DBFnnnnn)

– Used for datasharing communications between datasharing partners

IMS 13

DEDB Area Structure

Root Addressable Part

(Roots and Direct Dependents)V

S

A

M

D

BUnit of WorkUnit of Work

Unit of Work

ROOT

08- IMS 13 DB & DBRC: 34

Independent Overflow Part

(Overflow from Root Addressable Part)

Reorganization Unit of Work

Sequential Dependent Part

(Sequential Dependents Only)

M

D

E

F

I

N

E

B

D

No longer used

Unit of Work

Not Allowed with

ALTERAREA

Allowed with

REPLRAND

ROOT

SDEP DDEP

DDEP

DDEP

IMS 13

DEDB Alter Summary

� IMS 13 adds ability to dynamically change DEDB specifications

– Users can dynamically change UOW, SIZE, ROOT and Randomizer while DEDB is online

– New DEDB Alter utility is used to make changes

� Benefits

– Improved management of DEDB definitions

08- IMS 13 DB & DBRC: 35

– Improved management of DEDB definitions

• Eliminate system down time for modifications to DEDB definitions

• Improve data availability since changes are done while DEDB is online

top related