Fundamentals Of Transaction Systems - Part 4: Purity emerges from Impurity (Practical makes perfect)
IMS Fundamentals - Transaction Manager
-
Upload
ibm-ims -
Category
Technology
-
view
700 -
download
3
Transcript of IMS Fundamentals - Transaction Manager
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 Transaction Manager
Unit 5
© Copyright IBM Corporation 2008
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
z/OS
IMS/BATCHAddress Space
Application
DL/I Modules
Data Buffers
IMS/BATCHAddress Space
IMS/BATCHAddress Space
Application
DL/I Modules
Data Buffers
Application
DL/I Modules
Data Buffers
Database
(C)
Database
(A)
System
Log
Database
(B)
System
Log
System
Log
Multiple IMS Batch Address Spaces
© 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
ONLINE LOG DATA SET
CORPORATEDATABASESRECON MSG
QUEUE
z/OS
IMSCTL Control Region
MESSAGESCHEDULING
LOGGING/ RESTART
DBRCRecover
y Control
DLISASDL/I
SubordinateAddress Space
MPRMessageProcessin
gRegion
BMPBatch
MessageProcessin
g
IFP Fast Path
Region
TELECOMMUN- ICATIONS
LOGCTL
DL/I ACTION
MODULES
APPL PGM
APPL PGM
APPL PGM
USERTERMINA LS
IMS/TM makes data available to the end-user...
MASTERTERMINA L
IMS/TM Architecture
© Copyright IBM Corporation 2008
IMS/TM Dependent Regions• Maximum of 4095 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
– Batch Message Processing (BMP) regions:• 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
– Interactive Fast Path (IFP) regions:• Bypass IMS/TM scheduling via Expedited Message Handler (EMH)• For large transaction volumes that require fast response
© Copyright IBM Corporation 2008
IMSCTL (Control Region)DATA COMMUNICATIONS:
MPR(Msg. Processing Region)
LOGICAL TERMINAL
ABC
MESSAGES
APPLICATION PROGRAM
'ANYPGM'
LOGICAL TERMINAL
XYZ
PHYSICAL TERMINAL
1
PHYSICAL TERMINAL
2
PHYSICALTERMINAL 3
Logical Terminal (LTERM) Concept
© Copyright IBM Corporation 2008
• Transactions
– Originate from terminal (most IMS/TM activity)– Can originate from another application-program via "program-switch"
• Message-switches
– Allows terminals to communicate with each other
• Commands
– Mostly entered by MTO– Some commands may be entered from user terminals
/ COMMAND-VERB (PASSWORD) text 1 2 n
LTERMnme (PASSWORD) text1 8 9 18 19 n
TRANcode (PASSWORD) text1 8 9 18 19 n
Message Types
© 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
z/OS
All INPUT and OUTPUT messages are queued...
MESSAGE QUEUE
DATA SET(S)
IMS/TM IMS/MPR1 IMS/MPR2
QUEUEBUFFERS
QUEUEMANAGER
GET FROM
QUEUE
INSERT
TO QUEUE
A P P L
GET FROM QUEUE
INSERTTO QUEUE
A P P L
. . . .
. .. . . . . .
Message Queue (1 of 2)LOGICAL
TERMINAL(LTERM)
© Copyright IBM Corporation 2008
TRAN X
TRAN Y
1. INPUT TRANSACTIONS are QUEUEd by:
MSG1 (LTERMA) X
MSG3 (LTERMX) X
MSG4 (LTERMQ) X
MSG7 (LTERMX) X
MSG2 (LTERMB) Y
MSG5 (LTERMZ) Y
MSG6 (LTERMA) Y
2. OUTPUT MESSAGES are QUEUEd by:
LTERMA
LTERMB
RPL1 (X)RPL3 (X)
RPL2 (Y)
MESSAGE-QUEUE BUFFERS (Control Region)
MSG1 RPL3 RPL2 MSG5 MSG7RPL1 MSG6
MSG2 MSG4 MSG3
MESSAGE QUEUEDATA SET(S)
Message Queue (2 of 2)
© Copyright IBM Corporation 2008
PSBs for IMS Transaction Manager
PCB TYPE=TP
PCB TYPE=DB
PSBGEN...
• TP– Alternate response IOPCB.
• Used to send a message.
• DB– Used to read or update a database - same as IMS db.
© Copyright IBM Corporation 2008
APPLICATION PROGRAM:
MASK
MASK
MASK
(TP-) IO- PCB
ALTIO-PCB
DATABASEPCB
LOGICALTERMINA L
ALTERNATELOGICAL
TERMINAL
CUSTOMER
ADDRESS PAYROLL
LOGICAL DATABASE STRUCTURE
LOGICALTERMINA L
LOGICAL TERMINA
L
Logical Structures
© Copyright IBM Corporation 2008
INVENTORY MENU 100
10
PART-NO: 200
INVPGM
INVENTORY ON-HAND :
100 99
200 789
10 1000
A. DEVICE INPUT FORMAT (DIF)
D. DEVICE OUTPUT FORMAT (DOF)
INVPGM 00100 00200 00010
B. MESSAGE INPUT DESCRIPTOR (MID) (EDITED MESSAGE)
C. MESSAGE OUTPUT DESCRIPTOR (MOD)(EDITED MESSAGE)
100 0099 200 0789 10 1000
APPL PGMISRT
NXT=
MODNAME
MES
SAG
E FO
RMAT
SER
VICE
S (M
FS)
Message Format Service (MFS)
© Copyright IBM Corporation 2008
PAYROLL MENU:NAME:____________SERIAL:___________ADDRESS:_________DEPT:_____________PF1=UPDTPF3=EXIT
/FORMAT PAYMENU
MFS – Formatting a Screen
• FORMATTING A SCREEN:– Using /FORMAT command:
• 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
SF00 MSG TYPE=OUTPUT, SOR=(SFIL00, IGNORE), OPT=2,NXT=SFIN00,FILL=PT
MFLD REPLY, LTH=50,JUST=L MFLD SKILL, LTH=8, JUST=L MFLD NAME,LTH=6, JUST=L MSGEND
Creates MOD...
SFIN00 MSG TYPE=INPUT,SOR=SFIL00,OPT=2, NXT=SF00
MFLD TRANCD,LTH=6,FILL=NULL MFLD TYPESEG,LTH=1,JUST=L, FILL=C' ' MFLD SNE, LTH=18,JUST=L, FILL=C' ' MFLD DEGREE, LTH=1, JUST=L, FILL=C' ' MFLD SUBJECT, LTH=15, JUST=L,FILL=C' ' MFLD CDATE,LTH=4, JUST=L,FILL=C' ' MSGEND
Creates MID...
MFS – Creating Control Blocks
• Creating MFS control blocks://TEST EXEC @MFS//SYSIN DD * PRINT NOGEN
© Copyright IBM Corporation 2008
Creates DIF/DOF...
MFS - Source
SFIL00 FMTSFIL00 DEV TYPE=(3270,2) ,FEAT=IGNORE, PFK=(TRANCD,'CONVA '), 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)TYPESEG DFLD POS=(5,7), LTH=1 DFLD 'SKILL/EMPLOYEE/COURSE',POS=(7,2),ATTR=(NUM,PROT,HI)SNE DFLD POS=(7,24),LTH=18 DFLD 'DEGREE',POS=(9,2),ATTR=(NUM,PROT,HI)DEGREE DFLD POS=(9,9),LTH=1 DFLD 'SUBJECT',POS=(11,2),ATTR=(NUM,PROT,HI)SUBJECT DFLD POS=(9,9),LTH=1 DFLD 'COMPLETION DATE',POS=(13,2),ATTR=( NUM,PROT,HI)CDATE DFLD POS=(13,18),LTH=4 DFLD 'CURRENT SKILL',POS=(15,2),ATTR=(NUM,PROT,HI)SKILL DFLD POS=(15,16),LTH=8 DFLD 'CURRENT NAME',POS=(15,25),ATTR=(NUM,PROT,HI)NAME DFLD POS=(15,39),LTH=6 DFLD 'RESULT',POS=(17,2),ATTR=(NUM,PROT,HI)REPLY DFLD POS=(17,9),LTH=50 DFLD 'USE PF KEY 1 TO BEGIN THE CONVERSATION',POS=(23,2) FMTENDEND/*
© Copyright IBM Corporation 2008
A system resources controller LTERM that is the operational "hub" of IMS/TM...
COMMUNICATIONS
COMMUNICATIONLINES/NODES
PHYSICAL TERMINALS
LOGICALTERMINALS
TRANSACTIONS AND
PROGRAMS
MESSAGE REGIONS
SYSTEMSTATUS
CHECKPOINT/ RESTART
DATABASE DUMP and
RECOVERY
z/OS system console is "back-up" to MTO console...
SCHEDULING INTEGRITY
LOGICALTERMINA L
MASTER TERMINAL
DATABASE(S)
Master Terminal Operator (MTO)
© Copyright IBM Corporation 2008
Terminal CommandsMASTER Terminal: REMOTE Terminal:
/NRESTART "Normal" /ERESTART "Emergency"/CHECKPOINT
/DISPLAY /SIGN ON USERID PAYROLL/ASSIGN /SIGNOFF/CHANGE /IAM LTERM PAYROLL/STOP and /START NODE /LOCK LTERM PAYROLL
DATABASE PROGRAM TRANSACTION REGION
/BROADCAST NODE ALL /HOLDPAYROLL DATABASE UNAVAILABLE /RELEASE CONV 004UNTIL 2:00PM /EXIT
/RMLIST DBRC='DB DBD(DIVNTZ04) DBDS' /FORMAT PAYMENU /TEST
/DBDUMP /EXCLUSIVE/DBRECOVERY /RDISPLAY MASTER
/OPNDST /RCLSDST/CLSDST/MODIFY PREPARE/MODIFY COMMIT
© 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
OLDS5
OLDS4
OLDS3OLDS2
RECON 3
RECON 2
z/OS
IMS/TM
DBRC DLISASContro
l Region
DB Recovery Control
DL/I Subordinate Address Space
SLDS2
SLDS1
RLDS2
RLDS1
SYSTEM LOG DATA SETS
RECOVERY LOG DATA SETS
LOG ARCHIVE UTILITY
WADS
WRITE AHEAD DATA SETS
RECON 1
Buffers Buffers
OLDS1
Common Logging Facility
© 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 RECOVERY-
CONTROL 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
//DFSOLP00
//DFSOLP01
//DFSOLP02
OLDS 1
OLDS 3
STATUS: ARCHIVE SCHEDULED
STATUS: IN USE
STATUS: AVAILABLE
RECON
PRIOLD
SECOLD
PRISLD
SECSLD
PRILOG
SECLOG...
ARCHIVE
JOB:
ARC001SLDS1
RLDS1
OLDS 2
"The RECON" for Log-Control (2 of 2)
© 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 Image-Copy• 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
Restart CheckpointType: Selected:
COLD CHKPT 0
WARM CHKPT Generated At Previous Shutdown
EMERGENCY Last CHKPT Written to Log
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)
© Copyright IBM Corporation 2008
z/OS
IMS/TM DBRC DLISAS
MESSAGEQUEUE(S)
RECON DATABASE(S)
Checkpoint and Restart (2 of 2)
1. z/OS System Failure2. Stand-alone dump3. Restart z/OS operating system4. Emergency Restart IMS:
– Database backout of "in-flight" transactions1. “In-flight" transactions re-scheduled2. Message queue reconstruction3. Message transmission repositioning
5. Continue processing
© Copyright IBM Corporation 2008
System
Application
Terminal Network
IMS Generation (IMSGEN)• IMSGEN MACROS
Macro Function
IMSCTRL System-wide parametersIMSCTF z/OS parametersMSGQUEUE Message Queue definitionsBUFPOOLS Control-block buffer-pools
DATABASE DatabasesAPPLCTN Applications/Programs (PSBs)TRANSACT Transactions
COMM Communications defaultsTERMINAL Physical TerminalsNAME Logical Terminals (LTERMs)
• 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
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