Click here to load reader
View
227
Download
3
Embed Size (px)
ibm.com/redbooks
VSAM Demystified stified
Dave LovelaceRama AyyarAlvaro Sala
Valeria Sokal
Learn the latest VSAM functions and manage VSAM data
Understand, evaluate, and use VSAM properly
Problem determination and recommendations
Front cover
http://www.redbooks.ibm.com/http://www.redbooks.ibm.com/
VSAM Demystified
September 2003
International Technical Support Organization
SG24-6105-01
Copyright International Business Machines Corporation 2001, 2003. All rights reserved.Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADPSchedule Contract with IBM Corp.
Second Edition (September 2003)
This edition applies to Version 1, Release 4 of z/OS (product number 5694-A01) and z/OS V1 DFSMS Transactional VSAM Services (feature number 6330).
Note: Before using this information and the product it supports, read the information in Notices on page xix.
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixTrademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiThe team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiBecome a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiiComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Chapter 1. VSAM basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 A brief description of VSAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 VSAM functions by release level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 What is VSAM? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 VSAM access types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Major VSAM parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4.1 Catalog management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4.2 Record management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 VSAM terminology and concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.5.1 Logical record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.5.2 Key field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.5.3 Ways to identify logical records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.5.4 Physical record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.5.5 Control interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.5.6 Control area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.5.7 Spanned records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.5.8 Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.5.9 Cluster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.5.10 Sphere. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.5.11 Alternate indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.5.12 Splits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.5.13 VSAM buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.6 VSAM data set organizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.6.1 Key-sequenced data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.6.2 Entry sequenced data set (ESDS) . . . . . . . . . . . . . . . . . . . . . . . . . . 191.6.3 Relative record data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211.6.4 Variable relative record data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Copyright IBM Corp. 2001, 2003. All rights reserved. iii
1.6.5 Linear data set (LDS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.7 Comparing VSAM data set organizations . . . . . . . . . . . . . . . . . . . . . . . . . 241.8 Choosing a VSAM data set type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261.9 Extended format data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.10 Extended addressability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291.11 Data striping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301.12 Processing a VSAM cluster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.12.1 Allocating a VSAM cluster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311.12.2 Accessing VSAM cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331.12.3 Unallocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.13 VSAM exploiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381.13.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391.13.2 Hierarchical file system (HFS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391.13.3 zSeries File System (zFS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391.13.4 CICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401.13.5 DFSMShsm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401.13.6 DFSMSrmm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401.13.7 Java Record I/O (JRIO). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Chapter 2. Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.1 Service level agreement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442.2 Transaction performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442.3 Performance management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.3.1 I/O performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462.4 VSAM performance management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472.5 VSAM rule-of-thumb mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.5.1 Invalid rules-of-thumb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.6 Parameters affecting performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.6.1 Allocation units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492.6.2 Guaranteed Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502.6.3 Optimizing control area (CA) size . . . . . . . . . . . . . . . . . . . . . . . . . . . 522.6.4 Partial release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532.6.5 Allocation constraint relief . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542.6.6 Control interval size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542.6.7 FREESPACE definition for KSDS and ESDS . . . . . . . . . . . . . . . . . . 562.6.8 Index options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582.6.9 Key Range and Ordered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582.6.10 Share options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582.6.11 Initial load option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592.6.12 Region size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612.6.13 Buffering options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632.6.14 Buffering techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682.6.15 Data compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
iv VSAM Demystified
2.6.16 VSAM Data striping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1032.7 VSAM performance by scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
2.7.1 Performance scenario using RMF reports . . . . . . . . . . . . . . . . . . . 1152.7.2 Reducing the number of I/Os . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1192.7.3 I/O wait time (IOSQ) for VSAM data sets . . . . . . . . . . . . . . . . . . . . 1252.7.4 I/O service time (connect) for VSAM data sets . . . . . . . . . . . . . . . . 1292.7.5 Decreas