Você está na página 1de 41

IMS Transaction Manager

Unit 5

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

5.1

Objectives
Understand the goals and architecture of IMS/TM (Transaction Management) Learn the LTERM concept and how it relates to messages, message types and queues Learn how IMSGEN control blocks required for TM are coded and maintained Know the how IMSGEN control blocks, PSB and MFS control blocks are used in TM Understand the Master Terminal Operator and IMS terminal commands Understand IMS system security, integrity and maintenance functions

Copyright IBM Corporation 2008

Multiple IMS Batch Address Spaces


z/OS
IMS/BATCH Address Space
Application

IMS/BATCH Address Space


Application

IMS/BATCH Address Space


Application

DL/I Modules

DL/I Modules

DL/I Modules

Data Buffers

Data Buffers

Data Buffers

Database (A)

System Log

Database (B)

System Log

Database (C)

System Log

Copyright IBM Corporation 2008

Goals of IMS/TM
Provide high-volume, rapid response transaction management processing for application programs accessing
IMS/DB database (full function and Fast Path) DB2 tables

Define a logical/physical terminal structure that supports


Growth Change independence Usage of common resources Productivity

Support database management integration


Data integrity through two phase commit of unit of work Reliability/availability/serviceability (RAS) through transaction/database logging

Copyright IBM Corporation 2008

IMS/TM Architecture

MASTER TERMINA L

USER TERMINA LS

z/OS
IMSCTL
Control Region

DBRC
Recovery Control

DLISAS
DL/I Subordinate Address Space DL/I ACTION MODULES

MPR
Message Processing Region APPL PGM

BMP
Batch Message Processing APPL PGM

IFP
Fast Path Region APPL PGM

TELECOMMUNICATIONS MESSAGE SCHEDULING

LOG CTL

LOGGING/ RESTART

MSG QUEUE

ONLINE LOG DATA SET

RECON

CORPORATE DATABASES

IMS/TM makes data available to the end-user...


Copyright IBM Corporation 2008

IMS/TM Dependent Regions


Maximum of 999 dependent regions
Message Processing Regions (MPRs):
Selective start-up at IMS initialization Processes "online" transactions from terminals IMSCTL automatically "schedules" application programs for execution to process IMS/DB databases, or DB2 tables Many different application programs can process in a given MPR throughout processing period
Started when JOB submitted by operations Runs one application-program to process queued transactions, IMS/DB databases, and/or z/OS files Allows batch-type programs to process IMS queues and databases while IMS/TM system is available Bypass IMS/TM scheduling via Expedited Message Handler (EMH) For large transaction volumes that require fast response
Copyright IBM Corporation 2008

Batch Message Processing (BMP) regions:

Interactive Fast Path (IFP) regions:

Logical Terminal (LTERM) Concept


IMSCTL (Control Region) DATA COMMUNICATIONS:
PHYSICAL TERMINAL

MPR (Msg. Processing Region)

LOGICAL TERMINAL

ABC

APPLICATION PROGRAM

'ANYPGM'

MESSAGES
PHYSICAL TERMINAL

LOGICAL TERMINAL

XYZ

PHYSICAL TERMINAL

3
Copyright IBM Corporation 2008

Message Types
Transactions
TRANcode (PASSWORD) 1 8 9 18 text 19 n

Originate from terminal (most IMS/TM activity) Can originate from another application-program via "program-switch"

Message-switches

LTERMnme (PASSWORD) 1 8 9 18

text 19

Allows terminals to communicate with each other

Commands

/ COMMAND-VERB 1 2

(PASSWORD)

text n

Mostly entered by MTO Some commands may be entered from user terminals

Copyright IBM Corporation 2008

Message Type Examples


Transactions:
SALARY(XPSWD) 123456 'Salary for John Doe (123456) is $xxx.xx' ADDINV PART 9876 QTY=50 'Inventory on 9876: 10-Speed Bicycle = 9950 units'

Message-Switches

ACTGTERM ACCOUNTING DEPARTMENT MEETING AT 2:00PM

Commands
/checkpoint freeze /start line 5 pterm 2 /change(zzzyyx) password 999888 to password 888999
Copyright IBM Corporation 2008

Message Queue (1 of 2)
LOGICAL TERMINAL

(LTERM)

z/OS
IMS/TM IMS/MPR1
GET FROM

IMS/MPR2
GET FROM QUEUE

QUEUE

QUEUE MANAGER

INSERT

......

INSERT TO QUEUE

......

TO QUEUE APPL APPL

QUEUE BUFFERS

MESSAGE QUEUE DATA SET(S)


All INPUT and OUTPUT messages are queued...
Copyright IBM Corporation 2008

Message Queue (2 of 2)
1. INPUT TRANSACTIONS are QUEUEd by:
MSG1 (LTERMA) X MSG2 (LTERMB) Y MSG5 (LTERMZ) Y MSG6 (LTERMA) Y

TRAN

TRAN

MSG3 (LTERMX) X MSG4 (LTERMQ) X MSG7 (LTERMX) X

MESSAGE-QUEUE BUFFERS (Control Region) MSG1 RPL1 RPL3 MSG6 MSG2 RPL2 MSG5 MSG4 MSG7 MSG3

2. OUTPUT MESSAGES are QUEUEd by:


LTERMA MESSAGE QUEUE DATA SET(S)
RPL1 (X) RPL3 (X)
Copyright IBM Corporation 2008

LTERMB
RPL2 (Y)

PSBs for IMS Transaction Manager


PCB PCB PSBGEN... TP
Alternate response IOPCB.
Used to send a message.

TYPE=TP TYPE=DB

DB
Used to read or update a database - same as IMS db.

Copyright IBM Corporation 2008

Logical Structures
APPLICATION PROGRAM:

MASK

(TP-) IOPCB

LOGICAL LOGICAL TERMINA TERMINA L L

MASK

ALT IOPCB

ALTERNATE LOGICAL LOGICAL TERMINA L TERMINAL

CUSTOMER MASK DATA BASE PCB ADDRESS PAYROLL

LOGICAL DATABASE STRUCTURE


Copyright IBM Corporation 2008

Message Format Service (MFS)


INVENTORY MENU

100

MESSAGE FORMAT SERVICES (MFS)

10 PART-NO: INVPGM A. DEVICE INPUT FORMAT (DIF)


INVENTORY ON-HAND :

INVPGM

00100

00200

00010

200

B. MESSAGE INPUT DESCRIPTOR (MID) (EDITED MESSAGE) APPL NXT=


PGM ISRT

MODNAME
1000

100 0099 200 0789 10

100

99

200

789

C. MESSAGE OUTPUT DESCRIPTOR (MOD) (EDITED MESSAGE)

10

1000

D. DEVICE OUTPUT FORMAT (DOF)


Copyright IBM Corporation 2008

MFS Formatting a Screen


FORMATTING A SCREEN:
Using /FORMAT command:
/FORMAT PAYMENU PAYROLL MENU: NAME:____________ SERIAL:___________ ADDRESS:_________ DEPT:_____________ PF1=UPDTPF3=EXIT

No program is involved

Using Program-control:
Format screen using output message from a program CALL 'CBLTDLI' USING ISRT IO-PCB IO-AREA PAYMENU
Message that is written to queue contains MOD name to be used to map a DOF (screen-format) name

Copyright IBM Corporation 2008

MFS Creating Control Blocks


Creating MFS control blocks:
//TEST EXEC @MFS //SYSIN DD * PRINT NOGEN
SF00 MSG MFLD MFLD MFLD MSGEND TYPE=OUTPUT, SOR=(SFIL00, IGNORE), OPT=2,NXT=SFIN00,FILL=PT REPLY, LTH=50,JUST=L SKILL, LTH=8, JUST=L Creates NAME,LTH=6, JUST=L

MOD...

SFIN00

MSG
MFLD MFLD MFLD MFLD MFLD MFLD MSGEND

TYPE=INPUT,SOR=SFIL00,OPT=2, NXT=SF00 TRANCD,LTH=6,FILL=NULL TYPESEG,LTH=1,JUST=L, FILL=C' ' SNE, LTH=18,JUST=L, FILL=C' ' DEGREE, LTH=1, JUST=L, FILL=C' ' SUBJECT, LTH=15, JUST=L,FILL=C' ' CDATE,LTH=4, JUST=L,FILL=C' '

Creates MID...

Copyright IBM Corporation 2008

MFS - Source
SFIL00 SFIL00 FMT DEV TYPE=(3270,2) ,FEAT=IGNORE, Creates PFK=(TRANCD,'CONVA '), DIF/DOF... DSCA=X'00A0' DIV TYPE=INOUT DPAGE CURSOR=((5,7)) DFLD 'SKILL INVENTORY UPDATE',POS=(2,30),ATTR=(NUM,PROT,HI) DFLD 'TYPE',POS=(5,2), ATTR=(NUM,PROT,HI) DFLD POS=(5,7), LTH=1 DFLD 'SKILL/EMPLOYEE/COURSE',POS=(7,2),ATTR=(NUM,PROT,HI) DFLD POS=(7,24),LTH=18 DFLD 'DEGREE',POS=(9,2),ATTR=(NUM,PROT,HI) DFLD POS=(9,9),LTH=1 DFLD 'SUBJECT',POS=(11,2),ATTR=(NUM,PROT,HI) DFLD POS=(9,9),LTH=1 DFLD 'COMPLETION DATE',POS=(13,2),ATTR=( NUM,PROT,HI) DFLD POS=(13,18),LTH=4 DFLD 'CURRENT SKILL',POS=(15,2),ATTR=(NUM,PROT,HI) DFLD POS=(15,16),LTH=8 DFLD 'CURRENT NAME',POS=(15,25),ATTR=(NUM,PROT,HI) DFLD POS=(15,39),LTH=6 DFLD 'RESULT',POS=(17,2),ATTR=(NUM,PROT,HI) DFLD POS=(17,9),LTH=50 DFLD 'USE PF KEY 1 TO BEGIN THE CONVERSATION',POS=(23,2) FMTEND

TYPESEG SNE DEGREE SUBJECT CDATE SKILL NAME REPLY

END /*
Copyright IBM Corporation 2008

Master Terminal Operator (MTO)


A system resources controller LTERM that is the operational "hub" of IMS/TM...
MASTER LOGICAL TERMINAL TERMIN AL

COMMUNICATIONS
COMMUNICATION LINES/NODES

SCHEDULING
TRANSACTION S AND PROGRAMS

INTEGRITY

CHECKPOIN T/ RESTART

PHYSICAL TERMINALS

MESSAGE REGIONS

DATABASE DUMP and RECOVERY

LOGICAL TERMINALS

DATABASE(S)

SYSTEM STATUS

z/OS system console is "back-up" to MTO console...


Copyright IBM Corporation 2008

Terminal Commands
MASTER Terminal: /NRESTART "Normal" /ERESTART "Emergency" /CHECKPOINT /DISPLAY /ASSIGN /CHANGE /STOP and /START /SIGN ON USERID PAYROLL /SIGNOFF /IAM LTERM PAYROLL /LOCK LTERM PAYROLL REMOTE Terminal:

NODE DATABASE PROGRAM TRANSACTION REGION

/BROADCAST NODE ALL PAYROLL DATABASE UNAVAILABLE UNTIL 2:00PM /RMLIST DBRC='DB DBD(DIVNTZ04) DBDS' /DBDUMP /DBRECOVERY

/HOLD /RELEASE CONV 004 /EXIT /FORMAT PAYMENU /TEST /EXCLUSIVE /RDISPLAY MASTER

/OPNDST /CLSDST /MODIFY PREPARE /MODIFY COMMIT

/RCLSDST

Copyright IBM Corporation 2008

IMS Security
What Can be Secured? Terminals, Passwords, USERID Sign-on Verification
Transactions Databases (Logical and Physical) Commands

IMS Security Maintenance Utility (SMU) maintains a dual "matrix" for security: Protects IMS Resources/Objects
IMS-provided Internal Security

User-Written Exit Routines:


/SIGN ON Exit Routine (DFSCSGN0) Transaction Authorization Exit Routine (DFSCTRN0) Security Reverification Exit Routine (DFSCTSE0)

SMU Support ended with IMS V9

Copyright IBM Corporation 2008

Terminal and Password Security (1 of 2)


LTERM-Transaction Code matrix:
Terminals can be restricted to designated applications
TRANCODE
P A Y I N G R E F I N D A D D I N V A D D P A R T T A B L E Q D L E T I N V V E N D O R D D I S B U R S R E P L I N V S A L A R Y L I S T I N V U P D T I N V

REC101

T E

SAL102 INV105

1 1

1 1 1 1 1 1 1

INV106

INV107

1
Copyright IBM Corporation 2008

Terminal and Password Security (2 of 2)


Password-Transaction Code matrix
Designated applications can be assigned a "password"
TRANCODE
P A Y I N G R E F I N D A D D I N V A D D P A R T T A B L E Q D L E T I N V V E N D O R D D I S B U R S R E P L I N V S A L A R Y L I S T I N V U P D T I N V

P A S S W O

PSWD01

PSWD02 PSWD05

1 1

R
D

PSWD06

Copyright IBM Corporation 2008

System Integrity Functions


Common Logging Facility:
Database changes, transactions, system status changes

Automatic system checkpoints


Based on system activity System Recovery and Emergency Restart

Database Recovery Control


Similar to batch recovery operations

Program Isolation
Automatic backout for program ABENDs Data Sharing by multiple programs

Normal Restart
Start with unprocessed input/output from previous execution

Copyright IBM Corporation 2008

Common Logging Facility


z/OS
IMS/TM
Control Region Buffers

DBRC
DB Recovery Control Buffers

DLISAS
DL/I Subordinate Address Space

WADS WRITE AHEAD DATA SETS

OLDS1 OLDS2 OLDS3 OLDS4 OLDS5

RECON 1 RECON 2 RECON 3

LOG ARCHIVE UTILITY

SYSTEM LOG DATA SETS

SLDS1 SLDS2

RLDS1

RECOVERY LOG DATA SETS

RLDS2
Copyright IBM Corporation 2008

Common Logging Facility (Cont)


Recording of IMS/DB and IMS/TM system activity:
"Before" and "After" images of changed DL/I segments System status via periodic checkpoints Input and Output messages are logged

Provides integrity and recoverability of DB/TM systems:


Used for Dynamic Backout of failing transactions Used for system "warm" and "emergency" restarts Used for database recovery Used for performance and accounting statistics

Log Write-Ahead (LWA):


To guarantee database integrity, log records are physically written before database physically written Only selected "events" qualify for this technique

Copyright IBM Corporation 2008

OLDS and WADS


Online Log Data Set (OLDS)
Contains log records needed for:
Restart Recovery Backout: Batch and Dynamic

Consists of multiple data sets Allows IMS/TM to continue logging when an "OLDS switch" occurs because of the following:
OLDS is full I/O error while writing to an OLDS Operator commands /DBR or /DBD

Written in a "wrap-around" manner Can be archived automatically to the System Log Data Set (SLDS)

Write Ahead Data Set (WADS):


Contains committed log records not yet written to OLDS
Normally, only full blocks are written

May be used to "close" the OLDS in an emergency


Copyright IBM Corporation 2008

Database Recovery Control (DBRC)


TWO LEVELS OF CONTROL: LOG-CONTROL, controller of IMS log data sets:
Maintains information about OLDS status
e.g. ARCHIVE-NEEDED, AVAILABLE, ARCHIVE-IN-PROGRESS, NEXT-OLDS

2a. SHARE-CONTROL since IMS 6.1 includes RECOVERYCONTROL functions of earlier releases
can assist in database integrity and recovery Database "registration" by database data set Monitors Database Image Copies (ICs), Change Accumulations (CAs), Recoveries (DBRs) Automatic JCL generation of needed job-streams

2b. SHARE-CONTROL enables database sharing:


Access-intent must be registered with a "share-level
Database-level sharing Intra- or inter-processor block-level sharing

There is no DBRC or IMS "parm" that determines Log-Control vs. Share Control Share Control is in effect for individual databases once they are "registered"
Copyright IBM Corporation 2008

"The RECON" for Log-Control (1 of 2)


Recovery Control Data Sets (RECON): Automatic recording of information about:
Online Log Data Set (OLDS) System Log Data Set (SLDS) Recovery Log Data Set (RLDS)

Generation of utility JCL via DBRC command for:


Log Archive Log Recovery

Copyright IBM Corporation 2008

"The RECON" for Log-Control (2 of 2)


OLDS 1
STATUS: ARCHIVE SCHEDULED ARCHIVE JOB: SLDS1 ARC001 RLDS1

//DFSOLP00

RECON OLDS 2 STATUS: IN USE PRIOLD SECOLD PRISLD SECSLD OLDS 3 STATUS: AVAILABLE PRILOG SECLOG

//DFSOLP01

//DFSOLP02

. . .
Copyright IBM Corporation 2008

DBRC Database "Registration" for Share Control


Advantages:
Records recovery-related information in RECON
Example: which OLDS has log data for each database data set (DBDS) registered with DBRC

Controls recovery of databases

Generates JCL for recovery-related utilities


Used to select correct data sets to be used by Recovery and ImageCopy Consolidates changes of log records Saves time Eliminates errors

Register databases with DBRC commands


once a database is registered, Share Control is in effect

Copyright IBM Corporation 2008

Program Isolation
Program "Isolation" (PI) facility is the original IMS Lock manager: Allows multiple online programs to process the same database for update while preserving integrity Dynamic Backout facility: Deadlock Detection:
PROG-A 'GHU' DBR SEGM-A REPL-A 'GHU' DBR SEGM-B

But not the same segment occurrence!

Removes the effects of any programs that abnormally end (ABEND)


Eliminates partial updates; uncommitted updates are backed-out
PROG-B 'GHU' DBR SEGM-B REPL-B 'GHU' DBR SEGM-A

PI selects "loser" transaction for "pseudo"-ABEND and dynamic backout; re-schedules it later...
Copyright IBM Corporation 2008

Checkpoint and Restart (1 of 2)


IMS uses its own CHECKPOINT processing System-wide checkpoint is taken periodically based on
volume of log-records generated

Restart is based on use of a CHECKPOINT which contains


a "snapshot" of system control-blocks to log data set (OLDS)
Restart Type: COLD WARM Checkpoint Selected: CHKPT 0 CHKPT Generated At Previous Shutdown Last CHKPT Written to Log
Copyright IBM Corporation 2008

EMERGENCY

Checkpoint and Restart (2 of 2)


1. 2. 3. 4. z/OS System Failure Stand-alone dump Restart z/OS operating system Emergency Restart IMS:
1. In-flight" transactions re-scheduled 2. Message queue reconstruction 3. Message transmission repositioning

Database backout of "in-flight" transactions

5. Continue processing
z/OS IMS/TM DBRC DLISAS

MESSAGE QUEUE(S)

RECON

DATABASE(S)

Copyright IBM Corporation 2008

IMS Generation (IMSGEN)


IMSGEN MACROS
Macro IMSCTRL IMSCTF MSGQUEUE BUFPOOLS DATABASE APPLCTN TRANSACT COMM TERMINAL NAME Function System-wide parameters z/OS parameters Message Queue definitions Control-block buffer-pools Databases Applications/Programs (PSBs) Transactions Communications defaults Physical Terminals Logical Terminals (LTERMs)

System

Application

Terminal Network

Online Macro changes through Online Change facility


DATABASE APPLCTN TRANSACT MFS format Block

Copyright IBM Corporation 2008

Extended Terminal Option (ETO)


Optional (additional cost) Feature of IMS/TM Terminals may optionally be defined outside of the IMSGEN Process. Fewer IMSGENs Smaller and faster IMSGENs Dynamic control block management Requires user sign on

Copyright IBM Corporation 2008

Database Recovery Facility (DRF)


Separately priced product/tool Introduced at the time of IMS 7.1 as "Online Recovery Service"
follow-on product DRF introduced in June, 2003

Recovery is initiated via IMS Commands Executed in parallel with other online IMS activity A new function of the Control Region Timestamp recovery to allocation boundaries or any prior point in time Recover multiple DL/I database data sets and FP areas in a single pass of the IMS log

Copyright IBM Corporation 2008

Components and Flow


IMS Control Region DBRC Database Recovery Manager

RECON

Fast Path Areas

...

Recovery Data Manager

...
DLI/SAS DL/I DBDS

...
Change Accum

...
Image Copy

...

Log Data Sets

Copyright IBM Corporation 2008

Components
Database Recovery Manager
Driven by the IMS Command Processor to process recovery related commands Creates the Recovery Data Manager address space Establishes communication with the Recovery Data Manager Receives log data from the Recovery Data Manager Applies updates to the database data sets and areas Coordinates recovery termination and Database Recovery Facility participation in IMS shutdown processing Started when the first recovery command is entered Restores image copies, if required, with change accumulation data, if available Reads log data and processes records related to this recovery Merges log data into a recovery stream

Recovery Data Manager

DBRC

Maintains recovery related information All resources required for recovery must be registered to DBRC Validates recovery initiation and results
Copyright IBM Corporation 2008

Recover Command
/RECOVER ADD
Identifies the database data sets and areas Builds a 'recovery list'

/RECOVER REMOVE
Eliminates database data sets and areas from the 'recovery list'

/RECOVER START
Initiates recovery

/RECOVER STOP
Aborts recovery

/RECOVER TERMINATE
Cleans up Recovery Data Manager address space

Copyright IBM Corporation 2008

IMS Related Products


DB2 (External Subsystems DBMS) with IMS/TM CICS with IMS/DBCTL IMS Queue Control Facility (QCF)
Manage IMS Message Queues

Screen Definition Facility II (SDF II)


Help to build MFS control blocks

Automatic code generators:


CSP Cross-System Product supports:
CICS/ESA with IMS/DB IMS/TM to access DL/I DBs and/or DB2 tables

ADF Application Development Facility II

Copyright IBM Corporation 2008

Unit Summary
IMS/TM supports the RAS (Reliability, Availability & Serviceability) characteristics for application transaction processing programs LTERMs isolate messages, message types, queues and program processes from physical terminal characteristics IMSGEN, PSB and MFS control blocks are used in different aspects of TM Master Terminal Operation capabilities and IMS terminal commands are available to control and maintain transaction systems IMS system security, integrity and maintenance functions exist ETO and DRF are additional cost options/tools that extend the capability of IMS

Copyright IBM Corporation 2008

Você também pode gostar