vsam performance tuning
Post on 30-May-2018
229 Views
Preview:
TRANSCRIPT
-
8/9/2019 VSAM Performance Tuning
1/50
-
8/9/2019 VSAM Performance Tuning
2/50
WAVV 2007, Green Bay, WI
AcknowledgementAcknowledgement
With grateful thanks to DanWith grateful thanks to Dan
JandaJanda, The Swami of VSAM,, The Swami of VSAM,from whom most of thisfrom whom most of this
presentation was stolenpresentation was stolen
-
8/9/2019 VSAM Performance Tuning
3/50
WAVV 2007, Green Bay, WI
AbstractAbstract
This presentation gives an overview of VSAM & its components.This presentation gives an overview of VSAM & its components.
We take a look at what a VSAM file really looks like and how toWe take a look at what a VSAM file really looks like and how to
soup up its performance.soup up its performance.
We also look at some common mistakes and how to avoid them.We also look at some common mistakes and how to avoid them. This presentation and its materials are copyrighted andThis presentation and its materials are copyrighted and
developed by John Mycroft from a presentation originallydeveloped by John Mycroft from a presentation originally
copyrighted by Dancopyrighted by Dan JandaJanda. Permission is granted for WAVV to. Permission is granted for WAVV to
reproduce this presentation for distribution to its members at nreproduce this presentation for distribution to its members at noo
charge.charge.
Trademarks:Trademarks:
IBM, VSE, VSE/ESA,IBM, VSE, VSE/ESA, zVSEzVSE, CICS & DL/I are trademarks or registered, CICS & DL/I are trademarks or registered
trademarks of the IBM Corporationtrademarks of the IBM Corporation The Swami of VSAM is a trademark of DanThe Swami of VSAM is a trademark of Dan JandaJanda..
-
8/9/2019 VSAM Performance Tuning
4/50
WAVV 2007, Green Bay, WI
VSE/VSAM OverviewVSE/VSAM Overview
Virtual Storage Access MethodVirtual Storage Access Method For disk filesFor disk files
SequentialSequential Entry Sequence Dataset or ESDSEntry Sequence Dataset or ESDS
Begin at the beginning, go onBegin at the beginning, go on tiltil you get to the end andyou get to the end and
then stopthen stop IndexedIndexed Keyed Sequence Dataset or KSDSKeyed Sequence Dataset or KSDS
Process by key or sequentially or a mixtureProcess by key or sequentially or a mixture
DirectDirect Relative Record Dataset or RRDS (fixed) orRelative Record Dataset or RRDS (fixed) or
VRDS (variable)VRDS (variable) Calculate a records location in the file to access itCalculate a records location in the file to access it
Alternate index (AIX)Alternate index (AIX) gives an alternative route to agives an alternative route to aKSDSKSDS
Allows unique & nonAllows unique & non--unique keysunique keys
-
8/9/2019 VSAM Performance Tuning
5/50
WAVV 2007, Green Bay, WI
unc onaunc onaareasareas
CatalogCatalog Volume & file informationVolume & file information
Usage statisticsUsage statistics Disk space managementDisk space management
Space allocation including secondarySpace allocation including secondaryallocationsallocations
VSAM and VSAM/SAM filesVSAM and VSAM/SAM files
System filesSystem files
LibrariesLibraries
-
8/9/2019 VSAM Performance Tuning
6/50
WAVV 2007, Green Bay, WI
VSE/VSAM Functional areasVSE/VSAM Functional areas
IntegrityIntegrity
PerformancePerformance Data transfer sizeData transfer size
BufferingBuffering
Backup / restoreBackup / restore File sharing between jobs andFile sharing between jobs and
systemssystems
-
8/9/2019 VSAM Performance Tuning
7/50
WAVV 2007, Green Bay, WI
Processing a VSAM fileProcessing a VSAM file Sequentially (ESDS)Sequentially (ESDS)
Forward or backwardForward or backward
Keyed access (KSDS)Keyed access (KSDS) Direct by full or partial (generic) keyDirect by full or partial (generic) key
Sequentially, forward or backwardSequentially, forward or backward
Skip sequential, forward or backwardSkip sequential, forward or backward
Addressed access (RRDS, VRDS)Addressed access (RRDS, VRDS)
Direct, by record addressDirect, by record address Sequential & skip sequentialSequential & skip sequential
Alternate Index AccessAlternate Index Access Same as keyed accessSame as keyed access
--
-
8/9/2019 VSAM Performance Tuning
8/50
WAVV 2007, Green Bay, WI
How VSAM stores dataHow VSAM stores data
Were going to look atWere going to look at How VSAM stores records logically on diskHow VSAM stores records logically on disk
Performance considerationsPerformance considerations How VSAM physically stores data on diskHow VSAM physically stores data on disk
Disk space usage calculationsDisk space usage calculations
Optimizing disk capacityOptimizing disk capacity
Performance considerationsPerformance considerations VSAM jargonVSAM jargon
Control IntervalControl Interval
Control AreaControl Area
CI & CA splitsCI & CA splits FreespaceFreespace
RDF, CIDFRDF, CIDF
-
8/9/2019 VSAM Performance Tuning
9/50
WAVV 2007, Green Bay, WI
VSAM JargonVSAM Jargon
Control Interval (CI)Control Interval (CI)Smallest unit of data transfer between main &Smallest unit of data transfer between main &
disk storagedisk storage In other words, when you read a record, VSAM readsIn other words, when you read a record, VSAM reads
the whole CI that contains that recordthe whole CI that contains that record
Think of it as the same as a block of records in aThink of it as the same as a block of records in asequential file if you like (though its laid outsequential file if you like (though its laid out
differently)differently) A CI can initially contain 1 or more recordsA CI can initially contain 1 or more records
More can be insertedMore can be inserted
Some or all can be deletedSome or all can be deleted
When you try to add a new record to a CI with noWhen you try to add a new record to a CI with noroom, a CI split takes placeroom, a CI split takes place more about that latermore about that later
-
8/9/2019 VSAM Performance Tuning
10/50
WAVV 2007, Green Bay, WI
Layout of a control intervalLayout of a control interval
ALL VSAM FILES ARE VARIABLE LENGTHALL VSAM FILES ARE VARIABLE LENGTH Even if all the records are the same sizeEven if all the records are the same size
RecRec 11 RecRec nn 1 to n logical records of any length1 to n logical records of any length FreespaceFreespace Unused space in CI for insertingUnused space in CI for inserting
recordsrecords or making existing records longeror making existing records longer
RDFsRDFs 3 byte record descriptor field3 byte record descriptor field
ESDS/KSDSESDS/KSDS one per record length, one for allone per record length, one for allconsecutive records of same lengthconsecutive records of same length
RRDSRRDS one per numbered record slotone per numbered record slot
CIDFCIDF 4 byte Control Interval Descriptor Field4 byte Control Interval Descriptor Field
RecRec 11 RecRec 22 RecRec 33 RecRec FreespaceFreespace RDFsRDFs CIDFCIDF
-
8/9/2019 VSAM Performance Tuning
11/50
WAVV 2007, Green Bay, WI
Control Area (CA)Control Area (CA)
A CA is a group of CIs. In a KSDS, all the data CIsin a CA are indexed by one index CI
CI 0CI 0 CI 1CI 1 CI 2CI 2 CI 3CI 3 CI 4CI 4 CI 5CI 5 CI 6CI 6 CI 7CI 7 CI 8CI 8 CI 9CI 9
CI10CI10 CI11CI11 CI12CI12 CI13CI13 CI14CI14 CI15CI15 CI16CI16 CI17CI17 CI18CI18 CI19CI19
CI20CI20 CI21CI21 CI22CI22 CI23CI23 CI24CI24 CI25CI25 CI26CI26 CI27CI27 CI28CI28 CI29CI29
CA size is the smallest of :CA size is the smallest of :One cylinder orOne cylinder or
The size of the primary allocationThe size of the primary allocation
The size of the secondary allocationThe size of the secondary allocationThe number ofThe number ofCIsCIs per CA depends on the device and the CIper CA depends on the device and the CIand CA sizesand CA sizes
It is generally a good idea to go for the biggest CA possibleIt is generally a good idea to go for the biggest CA possible
-
8/9/2019 VSAM Performance Tuning
12/50
WAVV 2007, Green Bay, WI
Index Control Interval (Index CI)Index Control Interval (Index CI)
A CI in an index containing pointers toThe next level in the index or
The Data CI in the CA this is referredto as a Sequence Set CI
CI 0CI 0 CI 1CI 1 CI 2CI 2 CI 3CI 3 CI 4CI 4 CI 5CI 5 CI 6CI 6 CI 7CI 7 CI 8CI 8 CI 9CI 9
CI10CI10 CI11CI11 CI12CI12 CI13CI13 CI14CI14 CI15CI15 CI16CI16 CI17CI17 CI18CI18 CI19CI19
CI20CI20 CI21CI21 CI22CI22 CI23CI23 CI24CI24 CI25CI25 CI26CI26 CI27CI27 CI28CI28 CI29CI29
Index CIIndex CI
-
8/9/2019 VSAM Performance Tuning
13/50
WAVV 2007, Green Bay, WI
Index and data structureIndex and data structure
Balanced treeBalanced tree
Sparse indexSparse index Always just 1 highAlways just 1 high--level index CIlevel index CI
There can be 0 to many intermediateThere can be 0 to many intermediate
level indexlevel index CIsCIs
There can be one or more lowThere can be one or more low--levellevel
(sequence set) index(sequence set) index CIsCIs.. If there is only 1 sequence set CI, itIf there is only 1 sequence set CI, it
is also the highis also the high--level index CIlevel index CI
-
8/9/2019 VSAM Performance Tuning
14/50
WAVV 2007, Green Bay, WI
And now the bit youve allAnd now the bit youve all
been waiting forbeen waiting for
-
8/9/2019 VSAM Performance Tuning
15/50
WAVV 2007, Green Bay, WI
Performance rules of thumbPerformance rules of thumb
Use largest data CI possible,Use largest data CI possible,
especially for sequential workespecially for sequential work Use as small an index CI as youUse as small an index CI as you
can (but not too small!)can (but not too small!)
Use large data CAUse large data CA allocateallocate
primary and secondary as atprimary and secondary as at
least 1 cylinderleast 1 cylinder Avoid too many extents /Avoid too many extents /
allocationsallocations
-
8/9/2019 VSAM Performance Tuning
16/50
WAVV 2007, Green Bay, WI
Allocation calculationsAllocation calculations
CICI freespacefreespace ==
CI Size *CI Size * FreespaceFreespace %% Number of records per CINumber of records per CI
Fixed length:Fixed length:
(CI Size(CI Size --1010 FreespaceFreespace) / LRECL) / LRECL
Variable length:Variable length:
(CI Size(CI Size --77 FreespaceFreespace) / (Average) / (AverageLRECL +3)LRECL +3)
-
8/9/2019 VSAM Performance Tuning
17/50
WAVV 2007, Green Bay, WI
Allocation calculationsAllocation calculations
CalculateCalculate FreespaceFreespace in each CAin each CA
Get number ofGet number ofCIsCIs per CA fromper CA fromLISTCAT or device characteristicsLISTCAT or device characteristics
(3390, 12 x 4K(3390, 12 x 4K CIsCIs/track, 180/cyl)/track, 180/cyl)
CACA freespacefreespace = No of= No ofCIsCIs per CA *per CA *CACA FreespaceFreespace %, rounded up%, rounded up
Number ofNumber ofCIsCIs loaded per CA =loaded per CA =
CIsCIs per CAper CA CACA freespacefreespace
Number of records loaded per CA =Number of records loaded per CA =
LoadedLoaded CIsCIs in CA * No ofin CA * No ofrecsrecs in CIin CI
-
8/9/2019 VSAM Performance Tuning
18/50
WAVV 2007, Green Bay, WI
VSAM CatalogsVSAM Catalogs
Exactly one master catalogExactly one master catalog
Assigned at IPL with DEF CAT orAssigned at IPL with DEF CAT or DEFINE MCAT IDCAMS commandDEFINE MCAT IDCAMS command
User catalogsUser catalogs 0 to many0 to many
No more than 1 per volumeNo more than 1 per volume
Catalog can own multiple spacesCatalog can own multiple spaces
on a volumeon a volume Many catalogs can own space on aMany catalogs can own space on a
volumevolume
-
8/9/2019 VSAM Performance Tuning
19/50
WAVV 2007, Green Bay, WI
VSAM CatalogsVSAM Catalogs
Catalog contains :Catalog contains :--
SelfSelf--describing recordsdescribing records User catalog pointersUser catalog pointers
Volume definitionsVolume definitions
Space definitionsSpace definitions
Cluster (file) definitionsCluster (file) definitions
Component (data, index) definitionsComponent (data, index) definitions AIX & Path definitionsAIX & Path definitions
-
8/9/2019 VSAM Performance Tuning
20/50
WAVV 2007, Green Bay, WI
Catalog recommendationsCatalog recommendations
Use naming conventionsUse naming conventions Name Cluster, Data and Index componentsName Cluster, Data and Index components
explicitlyexplicitly Use partition / system independent namesUse partition / system independent names
where applicablewhere applicable
SeparateSeparate Files seldom defined or deletedFiles seldom defined or deleted
Files often defined or deletedFiles often defined or deleted
Online critical filesOnline critical files Batch filesBatch files
Multiple basketsMultiple baskets all the eggs wontall the eggs wont
get brokenget broken
-
8/9/2019 VSAM Performance Tuning
21/50
WAVV 2007, Green Bay, WI
More recommendationsMore recommendations
Dont use recoverable catalogsDont use recoverable catalogs
Hangover from 2314 / 3330Hangover from 2314 / 3330 Backup is vastly betterBackup is vastly better
IDCAMS,IDCAMS, FaverFaver,, MaxbackMaxback, Dr D,, Dr D,
useruser--written written
-
8/9/2019 VSAM Performance Tuning
22/50
WAVV 2007, Green Bay, WI
CI & CA splits andCI & CA splits and freespacefreespace
You try to insert a record in a CIYou try to insert a record in a CI
or extend a record already thereor extend a record already there
If there is enough free space inIf there is enough free space in
the CI, everyone moves up,the CI, everyone moves up,
record is inserted and CIrecord is inserted and CIrewrittenrewritten
BUT what if there isnt enoughBUT what if there isnt enoughfree space????free space????
-
8/9/2019 VSAM Performance Tuning
23/50
WAVV 2007, Green Bay, WI
CI & CA splitsCI & CA splits
CI splitCI split 4 physical4 physical IOsIOs
Set Split in progress, write CISet Split in progress, write CI Move half of records to new CI &Move half of records to new CI &
write itwrite it
Update sequence set, write indexUpdate sequence set, write indexCICI
Erase moved records from old CI,Erase moved records from old CI,turn off Split in progress,turn off Split in progress, witewite
old CIold CI
BUT..BUT..
-
8/9/2019 VSAM Performance Tuning
24/50
WAVV 2007, Green Bay, WI
Failure in CI splitFailure in CI split
System failureSystem failure
Corrected next time CI is updatedCorrected next time CI is updated No free CI in the CANo free CI in the CA
CA split is neededCA split is needed
RememberRemember 1 physical IO =1 physical IO =
30,00030,000 40,000 CPU40,000 CPUinstructionsinstructions
-
8/9/2019 VSAM Performance Tuning
25/50
WAVV 2007, Green Bay, WI
CA SplitCA Split
MANY physical reads and writesMANY physical reads and writes Set Split in progress, write sequenceSet Split in progress, write sequence
set CIset CI Maybe get new extentMaybe get new extent
Format new CA at HURBA positionFormat new CA at HURBA position
Read / write half ofRead / write half ofCIsCIs to new CAto new CA
Write new sequence set CI for new CAWrite new sequence set CI for new CA
Update higher level indexUpdate higher level index CIsCIs Erase movedErase moved CIsCIs from old CA, writefrom old CA, write
emptyempty CIsCIs
Write updated original sequence set CIWrite updated original sequence set CI
-
8/9/2019 VSAM Performance Tuning
26/50
WAVV 2007, Green Bay, WI
RecommendationsRecommendations
Dont worry about CI splitsDont worry about CI splits
Avoid excessive CA splits byAvoid excessive CA splits bydefining CAdefining CA freespacefreespace
Dont do aDont do a reorgreorgjust becausejust because
you have done n CI / CA splitsyou have done n CI / CA splits
-
8/9/2019 VSAM Performance Tuning
27/50
WAVV 2007, Green Bay, WI
ToTo reorgreorg or not toor not to reorgreorg??
Weve done 1000 CA splitsWeve done 1000 CA splits
betterbetter reorgreorg!!
Inserts tend to be clusteredInserts tend to be clustered
CI / CA split createsCI / CA split creates freespacefreespace
where it is needed, allows fasterwhere it is needed, allows faster
insertsinserts
ReorgReorg gets rid ofgets rid offreespacefreespace,,causing more CI / CA splitscausing more CI / CA splits
-
8/9/2019 VSAM Performance Tuning
28/50
WAVV 2007, Green Bay, WI
RecommendationsRecommendations
Avoid frequentAvoid frequent reorgsreorgs
Once a split has occurred, theOnce a split has occurred, theprocessing cost has been paidprocessing cost has been paid
Understand your applicationUnderstand your application
1 hot spot1 hot spot
Little distributedLittle distributed freespacefreespace let it splitlet it split
Many hot spotsMany hot spots Little distributedLittle distributed freespacefreespace let it splitlet it split
Even distributionEven distribution no hot spotsno hot spots
Use distributedUse distributed freespacefreespace
-
8/9/2019 VSAM Performance Tuning
29/50
WAVV 2007, Green Bay, WI
FreespaceFreespace
3% of each CI is empty
5% of CIs in each CA are empty
3% of 2048 = 61 bytes = 0records (or, at most, 1)
5% of 315 CIs per CA = 16 CIs
-
8/9/2019 VSAM Performance Tuning
30/50
WAVV 2007, Green Bay, WI
FreespaceFreespace
3% CI freespace where CISZ=2048
and average LRECL=120No room in this CI for an averagelength record
lAlt i ff
-
8/9/2019 VSAM Performance Tuning
31/50
WAVV 2007, Green Bay, WI
AlteringAltering freespacefreespace
InitialInitial freespacefreespace set via DEFINEset via DEFINE
egeg 10% of CI and 5% of CA10% of CI and 5% of CA
If inserts are clustered, considerIf inserts are clustered, consider
DEFINE with 0%DEFINE with 0% freespacefreespace, then, then
Load the file thenLoad the file then
ALTERALTER freespacefreespace to nonto non--zerozero
S iSt i
-
8/9/2019 VSAM Performance Tuning
32/50
WAVV 2007, Green Bay, WI
StringsStrings
VSAM allows multiple concurrentVSAM allows multiple concurrent
processing e.g.processing e.g.
CICS transactionsCICS transactions
BrowsingBrowsing
UpdatingUpdating
Placeholders (strings) hold filePlaceholders (strings) hold file
location infolocation info
Sh d / h d
-
8/9/2019 VSAM Performance Tuning
33/50
WAVV 2007, Green Bay, WI
Shared / nonShared / non--shared resourcesshared resources
NonNon--shared resources (NSR)shared resources (NSR)
Each string has its own buffersEach string has its own buffers
Multiple copies of a CI may be inMultiple copies of a CI may be in
memorymemory
Works well for batchWorks well for batch
Local Shared Resources (LSR)Local Shared Resources (LSR)
Many strings share a pool of buffersMany strings share a pool of buffers Only 1 copy of a CI in the poolOnly 1 copy of a CI in the pool
Ideal for onlineIdeal for online
R d tiR d ti NSRNSR
-
8/9/2019 VSAM Performance Tuning
34/50
WAVV 2007, Green Bay, WI
RecommendationsRecommendations -- NSRNSR
NonNon--shared resourcesshared resources
Each string must have enough indexEach string must have enough index
buffersbuffers
BadBad 1 buffer (old default)1 buffer (old default)
OKOK 1 buffer per index level (new default)1 buffer per index level (new default)GoodGood enough buffers for all high levelenough buffers for all high level
indexes + 1 moreindexes + 1 more
BestBest enough buffers to hold entire indexenough buffers to hold entire index
R d tiR d ti LSRLSR
-
8/9/2019 VSAM Performance Tuning
35/50
WAVV 2007, Green Bay, WI
RecommendationsRecommendations -- LSRLSR
Local Shared Resource buffersLocal Shared Resource buffers
Same index buffer needs as NSRSame index buffer needs as NSR
(buffers are per pool, not per(buffers are per pool, not per
string)string)
Monitor VSAM LSR stats to makeMonitor VSAM LSR stats to makesure BUFNI keeps up with indexsure BUFNI keeps up with index
growthgrowth
Monitor data buffers for high hitMonitor data buffers for high hitratesrates
IO ith NSRIO with NSR
-
8/9/2019 VSAM Performance Tuning
36/50
WAVV 2007, Green Bay, WI
IO with NSRIO with NSR
VSAM uses chained IO to readVSAM uses chained IO to read
ahead and write behindahead and write behind
Better to read manyBetter to read many CIsCIs in one IOin one IO
Block bigBlock big
Large CI sizesLarge CI sizes Be aware that VSAM will splitBe aware that VSAM will split CIsCIs intointo
smaller blocks to save spacesmaller blocks to save space
EgEg 3390 with 32K CI gets written as 2 x3390 with 32K CI gets written as 2 x16K blocks giving 1.516K blocks giving 1.5 CIsCIs = 48K/track= 48K/track
Buffer bigBuffer big
to 1 to 1 cylcyl of BUFND to minimize IOof BUFND to minimize IO
IO ith LSRIO with LSR
-
8/9/2019 VSAM Performance Tuning
37/50
WAVV 2007, Green Bay, WI
IO with LSRIO with LSR
VSAM reads 1 CI at a time, evenVSAM reads 1 CI at a time, even
for sequential processingfor sequential processing
Monitor your statsMonitor your stats
-
8/9/2019 VSAM Performance Tuning
38/50
WAVV 2007, Green Bay, WI
Monitor your statsMonitor your stats
LISTCAT before and after critical jobLISTCAT before and after critical job
Data & IndexData & Index EXCPsEXCPs the fewer the better.the fewer the better.
IndexIndex EXCPsEXCPs should be close to number ofshould be close to number ofindexindex CIsCIs..
Job Accounting dataJob Accounting data
IO count by deviceIO count by device OveralOveral CPU & IO activityCPU & IO activity
CICS statsCICS stats
Shows logical / physical IO counts by fileShows logical / physical IO counts by file LSR pool hits and missesLSR pool hits and misses
VSAM buffer statsVSAM buffer stats in VSE/ESA examples docin VSE/ESA examples doc
LSR is in 31 bitLSR is in 31 bit use LOTS but dont pageuse LOTS but dont page
Sharing VSAM datasetsSharing VSAM datasets
-
8/9/2019 VSAM Performance Tuning
39/50
WAVV 2007, Green Bay, WI
Sharing VSAM datasetsSharing VSAM datasets
VSAM can share files among partitionsVSAM can share files among partitions
And among VSE systemsAnd among VSE systemsBUTBUT
TANSTAAFL (Robert Heinlein)TANSTAAFL (Robert Heinlein)Sharing is not a performanceSharing is not a performance
option (Danoption (Dan JandaJanda))Its your gun and your footIts your gun and your foot
(Steve Huggins)(Steve Huggins)
Sharing VSAM datasetsSharing VSAM datasets
-
8/9/2019 VSAM Performance Tuning
40/50
WAVV 2007, Green Bay, WI
Sharing VSAM datasetsSharing VSAM datasets
Sharing is based onSharing is based on
The type of sharing you ask forThe type of sharing you ask for
(SHAREOPTIONS)(SHAREOPTIONS)
VSE Lock Table within a single VSEVSE Lock Table within a single VSE
systemsystem VSE Lock File when sharing across VSEVSE Lock File when sharing across VSE
systemssystems
VSE sharing mechanism is notVSE sharing mechanism is not
compatible withcompatible with zOSzOS oror zVMzVM
Sharing VSAM datasetsSharing VSAM datasets
-
8/9/2019 VSAM Performance Tuning
41/50
WAVV 2007, Green Bay, WI
Sharing VSAM datasetsSharing VSAM datasets
Sharing at OPEN / CLOSE timeSharing at OPEN / CLOSE time
Entries checked and placed in / removedEntries checked and placed in / removed
from lock tablefrom lock table
If DASD volume is added as shared (ADDIf DASD volume is added as shared (ADD
cuu,SHRcuu,SHR), it is added to lock file), it is added to lock file VSE & VSAM allow concurrentVSE & VSAM allow concurrent
processing to protect againstprocessing to protect againstconcurrent updates messing up the fileconcurrent updates messing up the file
Sharing VSAM datasetsSharing VSAM datasets
-
8/9/2019 VSAM Performance Tuning
42/50
WAVV 2007, Green Bay, WI
Sharing VSAM datasetsSharing VSAM datasets
Integrity classesIntegrity classes your choiceyour choice NO INTEGRITYNO INTEGRITY VSE & VSAM provide no dataVSE & VSAM provide no data
protection: its all up to you. Your data can beprotection: its all up to you. Your data can bemessed up.messed up.
WRITE INTEGRITYWRITE INTEGRITY VSE & VSAM protect againstVSE & VSAM protect againstconcurrent updatesconcurrent updates
READ INTEGRITYREAD INTEGRITY VSE & VSAM make sure yourVSE & VSAM make sure yourprograms always see the latest version of aprograms always see the latest version of arecordrecord
The priceThe price Higher levels & broader scopes of integrity leadHigher levels & broader scopes of integrity lead
to more CPU and IO activityto more CPU and IO activity
SHAREOPTIONSSHAREOPTIONS
-
8/9/2019 VSAM Performance Tuning
43/50
WAVV 2007, Green Bay, WI
SHAREOPTIONSSHAREOPTIONS
ReadyReady FireFire AimAim
Set in DEFINE CLUSTERSet in DEFINE CLUSTER Get it wrong & be prepared to sufferGet it wrong & be prepared to suffer
If a disk drive isnt shared betweenIf a disk drive isnt shared between
VSEsVSEs, dont ADD it with SHR as this, dont ADD it with SHR as this
causes lock file IOcauses lock file IO
SHAREOPTIONS & LockingSHAREOPTIONS & Locking
-
8/9/2019 VSAM Performance Tuning
44/50
WAVV 2007, Green Bay, WI
SHAREOPTIONS & LockingSHAREOPTIONS & Locking
SHR(1) 1 output OR many inputSHR(1) 1 output OR many input External lock at OPEN, unlock at CLOSEExternal lock at OPEN, unlock at CLOSE
SHR(2) 1 output AND many inputSHR(2) 1 output AND many input External lock at OPEN, unlock at CLOSEExternal lock at OPEN, unlock at CLOSE
SHR(3) No checking or lockingSHR(3) No checking or locking
Prepare for garbage dataPrepare for garbage data SHR(4) Many output in one VSE & manySHR(4) Many output in one VSE & many
inputinput OPENsOPENs across allacross all VSEsVSEs
External lock at OPEN, unlock at CLOSEExternal lock at OPEN, unlock at CLOSE
External lock at access, unlock at releaseExternal lock at access, unlock at release
SHR(4 4) Many outputSHR(4 4) Many output OPENsOPENs across allacross allVSEsVSEs + many input+ many input OPENsOPENs Locks same as SHR(4)Locks same as SHR(4)
Alternate indexes (AIX)Alternate indexes (AIX)
-
8/9/2019 VSAM Performance Tuning
45/50
WAVV 2007, Green Bay, WI
Alternate indexes (AIX)Alternate indexes (AIX)
An AIX is a VSAM KSDS, acting asAn AIX is a VSAM KSDS, acting as
a pointer file for another filea pointer file for another file
Target file (Base Cluster) can beTarget file (Base Cluster) can be
KSDSKSDS pointers are KSDS key valuespointers are KSDS key values
ESDSESDS pointers are Relative Bytepointers are Relative Byte AddrsAddrs Great for multiple or nonGreat for multiple or non--unique keysunique keys
BUTBUT
Processing via an AIX needs IO to bothProcessing via an AIX needs IO to both
the AIX and to the base clusterthe AIX and to the base cluster
Setting up an AIXSetting up an AIX
-
8/9/2019 VSAM Performance Tuning
46/50
WAVV 2007, Green Bay, WI
Setting up an AIXSetting up an AIX
DEFINE CLUSTER for base clusterDEFINE CLUSTER for base cluster
DEFINE AIX for the alternate indexDEFINE AIX for the alternate index
Give base clusters name & alternate keyGive base clusters name & alternate key
Data & Index CI sizesData & Index CI sizes
DEFINE PATHDEFINE PATH Allows specifying of NOUPGRADE pathsAllows specifying of NOUPGRADE paths
BLDINDEXBLDINDEX
Reads primary & alternate key info from baseReads primary & alternate key info from baseclustercluster
Sorts into alternate key sequenceSorts into alternate key sequence
Loads alternate indexLoads alternate index
AIX recommendationsAIX recommendations
-
8/9/2019 VSAM Performance Tuning
47/50
WAVV 2007, Green Bay, WI
AIX recommendationsAIX recommendations
To process the base cluster in AIXTo process the base cluster in AIX
order, it is better to sort it and useorder, it is better to sort it and use
the SORTOUT filethe SORTOUT file
Remember VSAM processes baseRemember VSAM processes base
clusters directly based on AIX valuesclusters directly based on AIX values Base cluster will need lots of indexBase cluster will need lots of index
buffers for batch processing. Givebuffers for batch processing. GiveBase cluster large BUFFERSPACE onBase cluster large BUFFERSPACE on
DEFINE or ALTERDEFINE or ALTER
AIX and CICSAIX and CICS
-
8/9/2019 VSAM Performance Tuning
48/50
WAVV 2007, Green Bay, WI
AIX and CICSAIX and CICS
SPHERESPHERE a base cluster and all itsa base cluster and all itsAIXsAIXs related to itrelated to it
RequirementsRequirements Each sphere must be wholly within oneEach sphere must be wholly within one
LSR poolLSR pool
Use Dataset Name SharingUse Dataset Name Sharing In CICS 2.3, add BASE= to FCT entry forIn CICS 2.3, add BASE= to FCT entry for
Base cluster file entryBase cluster file entry
Each related path file entryEach related path file entry
This is automatic in CICS TSThis is automatic in CICS TS
SHR(2) is usually bestSHR(2) is usually best
Make sure your CICS and VSAM serviceMake sure your CICS and VSAM service
is current!is current!
Contacting the presenterContacting the presenter
-
8/9/2019 VSAM Performance Tuning
49/50
WAVV 2007, Green Bay, WI
Contacting the presenterContacting the presenter
You can contact me by email atYou can contact me by email at
johnm@ejohnm@e--vse.comvse.com
DanDan JandasJandas website has much ofwebsite has much of
this infothis info http://business.epix.net/~theswamihttp://business.epix.net/~theswami
And, if you want to find me thisAnd, if you want to find me thiseveningevening
Youll find me hereYoull find me here
mailto:johnm@e-vse.commailto:johnm@e-vse.commailto:johnm@e-vse.commailto:johnm@e-vse.commailto:johnm@e-vse.commailto:johnm@e-vse.comhttp://business.epix.net/~theswamihttp://business.epix.net/~theswamihttp://business.epix.net/~theswamimailto:johnm@e-vse.com -
8/9/2019 VSAM Performance Tuning
50/50
WAVV 2007, Green Bay, WI
You ll find me hereYou ll find me here
top related