IMS Fundamentals - part 1

33
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 IMS Fundamentals

Transcript of IMS Fundamentals - part 1

Page 1: IMS Fundamentals - part 1

Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1

© Copyright IBM Corporation 2008

IMS Fundamentals

Page 2: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

Objectives

• Differentiate the IMS DBMS approach and capabilities from traditional master files

• Describe hierarchical data structures, database records and the goals for accessing them through DL/I

• Identify the principle IMS DB control blocks and differentiate the physical view from the application view of a database

• Identify and describe the principal facilities for backup and recovery of IMS databases

Page 3: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

USERTERMINAL

USERTERMINAL

MASTERTERMINAL

USERTERMINAL

MSGQUEUE

ONLINE LOG DATA

SETRECON CORPORATE

DATABASE

z/OS

MPRMessage

Processing Region

APPL PGM APPL PGM APPL PGM

BMPBatch

Message Processing

IFPFast Path

Region

IMSCTLControl Region

TELECOMMU- NICATIONS

MESSAGE SCHEDULING

LOGGING/ RESTART

DBRCRecovery Control

LOG CTL

DLISASDL/I

Subordinate Address-space

DL/I ACTION MODULES

IMS/TM makes data available to the end user

IMS Overview - Environment

Page 4: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

Overview - Component and Features (1 of 2)

• Primary Products– IMS Transaction Manager - IMS/TM– IMS Database Manager - IMS/DB

• Product Implementations– DB/DC– DBCTL– DCCTL

• Related Products– IBM IMS Data Management Tools

• e.g. IMS Hardware Supported Compression - Extended - more examples on next page

Page 5: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

Overview - Component and Features (2 of 2)

• Related Products– IMS Database Control Suite for z/OS– IMS High Performance Pointer Checker for z/OS– IMS Parallel Reorganization for z/OS– IMS DEDB Fast Recovery for z/OS– IMS Queue Control Facility for z/OS– Batch Terminal Simulator– IMS Workload Router– and many, many, more

Page 6: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

What Is a Database System?

• "A system that allows multiple independent users to have concurrent access to a central repository of information..."

• Advantages

– Centralized files for all applications

– Elimination of duplicate space and effort

– Single information source provides complete, accurate information processing

Page 7: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

ONE SETOF BOOKS

ONE PLACE TOMAKE CHANGES

InventoryControl

Accounting

Engineering

Production

DATA BASE

A Central Repository

Page 8: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

DATA BASE

z/OSOperating System

DL/I

Application

Program

WHAT IS DL/I?

• "Data Language/One is a data management facility that serves as an interface between an application program and a database.."

Page 9: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

Limits of Traditional Systems

• Fixed file contents limits the use of the data, and impacts application expansion

• Additional files create data redundancy, and additional data maintenance

• Interrelating data from multiple files complicates design and programming

• Recovery procedures are non-standard, or ignored until a disaster occurs!

Page 10: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

PARTSFILEA

PARTSFILEB

PARTSFILEC

PROGRAM A(INVENTORY)

FILEDESC

PROGRAM B(ENGINEERING)

FILEDESC

PROGRAM C(ACCOUNTING)

FILEDESC

Traditional Approach

Page 11: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

PROGRAM A(INVENTORY)

PROGRAM C(ACCOUNTING)

PROGRAM B(ENGINEERING)

PARTS

DATA

BASE

DATA DESCRIPTION

Database Approach

Page 12: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMP

NO

EMP

NAME

DATE

HIRE

ADDRLINE

1

ADDRLINE

2......... DEDUCT 2 3 4 5

Field Length Field Length

Employee No.Employee NameDepartmentDate HiredAddress Line 1Address Line 2Address Line 3Address Line 4Gross SalarySalary ClassAuth Date

6 30 2 6

25 25 25 25 6 3

6

Taxes Fit FICA State Local Deductions (Up to 5) Type Amount Balance (12x5)

6555

25560

Fixed File Contents

Page 13: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMPLOYEE NO. 6EMPLOYEE NAME 30DEPARTMENT 2DATE HIRED 6

ADDR LINE (S)O-n

FIT 6FICA 5STATE 5LOCAL 5

EMPLOYEE(44 bytes)

SALARY(15 bytes)

ADDRESS(25 bytes)

TAXES(21 bytes)

DEDUCT(12 bytes)

TYPE 2AMT 5BAL 5

GROSS SALARY 6SALARY CLASS 3AUTH DATE 6

DL/I Hierarchy (1 of 2)

Page 14: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

Level 1

Level 2

Level 3

Twins

Twins

RootSegment

B1

B2

SALARY

TAXES

C11

C12

ADDRESS

D1

D2

DEDUCT

C21

C22C23

EMPLOYEE

A

DL/I Hierarchy (2 of 2)

Page 15: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

SALARY

TAXES

ADDRESS

DEDUCT

EMPLOYEE

ADDRESSSALARY

21

1112

13X1

X2X3

XY

UV

W

Hierarchic Sequence Exercise

• Place the number or letter in the boxes in the sequence that these segments will be accessed by a sequential "get-next" function.

Page 16: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMPNO

EMPNAME

ADDRLINE

DEPTNO.

NO.DEPT

YTDSALARY

YTDFIT

YTDFICA

YTDSTATE

PERSONNELINFORMATION

EMPLNAME

EMPLNO.

ADDR DEPTJOB

CODESKILLCODE

EDUC EXPR

PAYROLLSYSTEM

PERSONNELSYSTEM

15 PROGRAMS

PERSONNELSYSTEM

ExpandPayrollMaster?

ORCreate new file? PERSONNEL

MASTER

PAYROLLMASTER

Add A New Application

Page 17: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMPLOYEE

SALARY ADDRESS

TAXES DEDUCT

SKILL

EXPR EDUC

PERSONNEL DATA

DL/I Easy To Expand

Page 18: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMPLOYEE

ADDRESSSALARY

TAXES DEDUCT

SKILL

EXPR EDUC

MILITARY SERVICE

MILITARY HISTORY

UPDATES

Payroll DataMilitary DataPersonnel Data

Multi-Application Updates

Page 19: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

PROGRAM

DATA DESCRIPTION

DATABASE

PSB DBD

Data Independence

• Separate the program from the physical characteristics of the databases

• Advantages

– Simplifies application program development– Provides security, integrity, and consistency of a database– Facilitates changes to database

Page 20: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

LOGICAL VIEW PHYSICAL VIEW

PSB DBDPCB... SEGM... SENSEG...

Find an employee Execute complexwith a specified IMS, VSAM, z/OS, andskill (programmer?) DASD low-level code

Logical View/Physical View

Page 21: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

DBDLIB

DBDMACRO

LIB

DBDGEN-PROCESS

DBD NAME=EMPLOYEE , ACCESS=HDAM. . .DATASET DD1=EMPLDATASEGM NAME=EMPLOYEE , BYTES=44 , PARENT=0FI ELD NAME=( SERI AL , SEQ , U) , BYTES=6 , START=1FI ELD NAME=FULNAME , BYTES=18 , START=20SEGM NAME=SALARY , BYTES=15 , PARENT=EMPLOYEEFI ELD NAME=RATE , BYTES=5 , START=5SEGM NAME=TAXES , BYTES=21 , PARENT=SALARYSEGM NAME=DEDUCT , BYTES=12 , PARENT=SALARYFI ELD NAME=TYPE , BYTES=4 , START=1 . .END

INPUTSTATEMENTS

DEDUCTTAXES

EMPLOYEE

SALARY

Database Description (DBD)

Page 22: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

MACROLIB

PSBGEN-PROCESS

PCB TYPE=DB , DBDNAME=EMPLOYEE , PROCOPT=A , KEYLEN=45SENSEG NAME=EMPLOYEE , PROCOPT=GSENSEG NAME=SALARY , PARENT=EMPLOYEE , PROCOPT=GRSENSEG NAME=TAXES , PARENT=SALARYSENSEG NAME=DEDUCT , PARENT=SALARYPCB TYPE=DB , DBDNAME=PROJECT , PROCOPT=G , KEYLEN=22SENSEG NAME=PROJECT

.

.PSBGEN LANG=COBOL , PSBNAME=EMPLPROJEND

PSBLIB

PSB

PCB

PCB

INPUTSTATEMENTS

Program Specification Block (PSB)

Page 23: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMPLOYEE

ADDRESSSALARY

TAXES DEDUCT

SKILL

EXPR EDUC

MILITARYSERVICE

MILITARYHISTORY

Logical Data Structurefor Payroll processing

Segment Sensitivity

• What is the Logical Data Structure for an Employee Mailing List?

Page 24: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

MYPROG

MYPSB

DBD

PGMLIB

PSBLIB

DBDLIB

IMS

Batch IMS Execution

Page 25: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

ACBLIB

PSB

DBD

DBDLIBPSBLIB

PSB

ACBGENPROCESS

CONTROLSTATEMENTS

DBD

Application Control Blocks

• Application Control Blocks (ACB) Utility:– Defines Application Control Block library (ACBLIB)– Uses database descriptors (DBDs)– Uses program descriptions (PSBs)

• ACBGEN:– Verifies PSB-PCB-DBD existence and compatibility– Verifies KEYLEN parameter

Page 26: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

EMPLOYEE

SALARY ADDRESS

LOGICAL DATABASE STRUCTURE

z/OS ADDRESS-SPACE:

APPLICATIONPROGRAM:

PSB

PCB(Logical View)

DBD(PHYSICAL)

HSAM HISAM HDAM HIDAM

PCBMASK

CALL 'CBLTDLI'USING. . .

DL/I

Application Program View

Page 27: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

APPLICATION

PROGRAM

DL/I

DATABASE

SYSTEMLOG

Database Recovery

• All Database changes are logged!

• System Log is used by DL/I to– Recover databases from errors– Back out updates when program abnormally terminates

• "Before" and "After" images of DL/I segments

Page 28: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

DATABASE DATA SET

COURSE

CLASS

STUDENTINSTRUCT

Original Database

IMAGE-COPY

UTILITY

DATABASE DATA SET

Backup Copy of Database

CI#1

CI#2

.

.

.

Backing-Up a Database

• CIC - Concurrent image copy allows update of databases while image copy runs. It produces a "fuzzy" image copy.

Page 29: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

LOG DATA SET

STUDENT AFTER

CLASS BEFORE

CLASS AFTER

ISRT

REPL

z/OS Address-space:

Application Program: ... ...

ISRT COURSE = 'U3700' CLASS = 'SL981015' STUDENT ... ...

GHU COURSE = 'U3700' CLASS = 'SL981015'REPL

... ...

INPUT/OUTPUT AREA:

DL/I Action Modules

DATABASE DATA SET

COURSE

CLASS

STUDENTINSTRUCT

Logging Database Changes

Page 30: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

DATABASE DATA SET

Backup Copy of Database

CI#1

CI#2...

DATABASE DATA SET

COURSE

CLASS

STUDENTINSTRUCT

Recovered Database

DATABASE

RECOVERY

UTILITY

LOG DATA SET

STUDENT AFTER

CLASS BEFORE

CLASS AFTER

ISRT

REPL

Database Recovery

Page 31: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

CHANGEACCUMULATION

CHANGEACCUM

DATASET

LOG3

LOG2

LOG1

Sort to cut recovery time.Consolidate changes

Optional – include previous change accum dataset

Logs must be in creation sequence

Database Log Change Accumulation

Page 32: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

DL/I Goals

• DATA INDEPENDENCE– No file description coding within program– No recompilations due to changes in the physical storage or access

method– Same type of DL/I coding regardless of language, or physical access

method• DATA INTEGRATION:

– Less file-related logic to code– Only one field in one database to maintain

• DATA SENSITIVITY:– Less storage to reserve– Fewer fields to define– No recompilations due to addition/deletion of non-sensitive segments– Processing Options (PROCOPTs)

• DATA BASE INTEGRITY:– No logic or coding for recovery in case of failure

Page 33: IMS Fundamentals - part 1

© Copyright IBM Corporation 2008

Unit Summary

• Using the IMS DBMS approach, databases are shared among applications.

• Accessing database records using DL/I satisfies a set of shared processing goals and requires navigation through hierarchical data structures.

• Three principle IMS DB control blocks are used to describe the physical database structure and to support different program views of available data.

• The principle facilities for IMS backup and recovery were discussed.