db2 systems programming tools of the trade na07b03

77
1 May 7, 2007 1:40 p.m. – 2:40 p.m. Platform: z/OS Mainframe DB2 Systems Programming Tools of the Trade Linda Hagedorn Performance and Tuning Experts Session: B03

Upload: linda-hagedorn

Post on 12-Apr-2017

174 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: DB2 Systems Programming Tools of the Trade NA07B03

1

May 7, 2007 1:40 p.m. – 2:40 p.m.

Platform: z/OS Mainframe

DB2 Systems ProgrammingTools of the Trade

Linda HagedornPerformance and Tuning Experts

Session: B03

Page 2: DB2 Systems Programming Tools of the Trade NA07B03

2

2

Linda HagedornPerformance & Tuning [email protected]

Session: B03DB2 Systems ProgrammingTools of the Trade

Page 3: DB2 Systems Programming Tools of the Trade NA07B03

3

3

Introduction• DB2 Systems Programming requires knowledge

across products and platforms. This presentation includes the tools you need to understand, manage, and control mainframe z/OS interaction with UDB DB2.

• This presentation is operationally based – how things are done, and why.

Page 4: DB2 Systems Programming Tools of the Trade NA07B03

4

4

Questions and Notes• Ask questions as we go along. • I’ll repeat the questions for clarity. • If you need answers further explained, say so. • An interactive audience is welcome• All examples in the presentation have links to

manuals on the notes pages. • MVS, os/390, and z/OS are used interchangeably. • ‘Systems programmer’ is abbreviated as sysprog.

Page 5: DB2 Systems Programming Tools of the Trade NA07B03

5

5

DB2’s Connections in z/OS• IPLINFO to

SYS1.PARMLIB• SYS1.PARMLIB

• APFxx• SCHEDxx• IEFSSNxx• PROGxx

• SSVT – Subsystem Vector Table

• PPT – Program Properties Table

• Console Dump Information• SLIPS• SYS1l.LOGREC• DFSMS Storage Mgmt

• ACS routines• SMF

• Live access – MANx• Archive access

• IFCID and SMF Mapping

Page 6: DB2 Systems Programming Tools of the Trade NA07B03

6

6

IPLINFO to SYS1.PARMLIB• SYS1.PARMLIB is the generic name of the PDS containing

parameters that bring up the controls for z/OS.• DB2 UDB’s connections are recorded in SYS1.PARMLIB or

another concatenated PARMLIB. • At IPL (Initial Program Load), the parameters are loaded

and the system brought up,. • Often the path is through SYS1.PARMLIB(*00) members,

but you cannot be sure. • How can the path be determined?

Page 7: DB2 Systems Programming Tools of the Trade NA07B03

7

7

Decoding the Path - IPLINFO• From the console, /D IPLINFO

IEASYM LIST refers to the suffix of IEASYMxx members in SYS1.PARMLIB. This IPL will use SYS1.PARMLIB(IEASYMD0).

IEASYS LIST likewise refers to suffixes, this time of IEASYSxx members. We have two here, concatenated: SYS1.PARMLIB(IEASYSD0) AND (IEASYSOP).

Note the 5th line. This is where IPL starts. SYS0 IPLPARM(LOADD0) on unit

Page 8: DB2 Systems Programming Tools of the Trade NA07B03

8

8

Decoding the Path – IPLPARM UNIT• =3.4 to find the PDS SYS0.IPLPARM • Often the dataset is uncataloged; if so, then locate

the volume, and then =3.4.

The book containing z/OS commands is found here: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/CCONTENTS?SHELF=iea2bk70&DN=SA22-7627-14&DT=20060616012438

The z/OS V1R8.0 MVS Bookshelf is here: http://publib.boulder.ibm.com/cgi-bin/bookmgr/Shelves/iea2bk70

Page 9: DB2 Systems Programming Tools of the Trade NA07B03

9

9

Decoding the path – LOADxx contents

IODF gives the external name of the IO Definition file: SYS1.IODF01 01 is the suffix.

SYSCAT contains the name of the Master Catalog. Col 1-6 SYSCAT10-15 Vol ser containing the master cat16 ‘1’ unless SYS% to SYS1 conversion is active, then it is a ‘2’17 Alias level of qualification (default 1) 18-19 CAS service task lower limit, default x’3C’

The next three are suffixes of members in SYS1.PARMLIB.

The PARMLIB are the concatenated PARMLIBs in use by MVS.

Page 10: DB2 Systems Programming Tools of the Trade NA07B03

10

10

Decoding the path - IEASYSxx• IEASYSxx contains a list of suffixes, pointing to

other SYS1.PARMLIB members. DB2 UDB information is stored in several of these members. • IEFSSNxx contains the entries for subsystems. • PROGxx contains APF (Authorized Program

Facilities) and LNKLST (Linklist) entries. • SCHEDxx contains overrides to the PPT. • IEAAPFxx (APF entries) • LNKLSTxx (Linklist)

• LOGREC= is the name of the logrec file.

DB2 information is shipped in z/OS’s PPT (Program Properties Table). The SCHED entry would override the PPT. This is for informational purposes only.The PPT shipped with z/OS does not need an override.

IEAAPFxx and LNKLSTxx are still operational, but entries can be made to the PROGxx member instead. PROGxx is being used instead of IEAAPFxx andLNKLSTxx in many, if not most, shops.

Page 11: DB2 Systems Programming Tools of the Trade NA07B03

11

11

Updates to SYS1.PARMLIB• z/OS commands can be used to add subsystems and

libraries on the fly, enabling work to move forward instead of waiting for an IPL. • IEFSSNxx – use z/OS command: SETSSI• PROGxx – use z/OS command: SETPROG for

APF and LNKLST• SCHEDxx – use z/OS command: SET SCH

• Update SYS1.PARMLIB separately. • Syntax for the commands is found in the ‘z/OS MVS

Systems Command Manual.’

The book containing z/OS commands is found here: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/CCONTENTS?SHELF=iea2bk70&DN=SA22-7627-14&DT=20060616012438

The z/OS V1R8.0 MVS Bookshelf is here: http://publib.boulder.ibm.com/cgi-bin/bookmgr/Shelves/iea2bk70

Page 12: DB2 Systems Programming Tools of the Trade NA07B03

12

12

IEFSSNxx – SETSSI Command• SETSSI {ADD,{SUBNAME|SUB|S}=subname

[,{CONSNAME|C}=consname] [,{INITRTN|I}=initrtn[,{INITPARM|P}=initparm]]}{DEACTIVATE|DEACT},{SUBNAME|SUB|S}=subname}{ACTIVATE|ACT},{SUBNAME|SUB|S}=subname }

• To add a DB2 subsystem from the console: SETSSI ADD,SUBNAME=ssname,I=DSN3INI,P='DSN3EPX,-DBP1,S,DBP0’

DBP0'Example of SETSSI command syntax from z/OS MVS Systems Commands Manual V1R8.0http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/4.49.1?SHELF=iea2bk70&DT=20060616012438&CASE=

Example of IEFSSNxx entry from DB2 UDB R810 Install Manualhttp://publib.boulder.ibm.com/cgibin/bookmgr/BOOKS/DSNIGJ13/2.6.1.1?SHELF=dsnshja2&DT=20050324144101&CASE=•SUBSYS SUBNAME(ssname) INITRTN(DSN3INI) INITPARM('DSN3EPX,prefix<,scope<,group-attach>> '

Page 13: DB2 Systems Programming Tools of the Trade NA07B03

13

13

PROGxx – SETPROG APF LNKLST

• SETPROG APF{,FORMAT={DYNAMIC|STATIC}}{,{ADD|DELETE},DSNAME|LIBRARY=libname,{SMS

|VOLUME=volume} }• To add a SMS-managed SDSNLOAD to the APF

authorized list from the console:

SETPROG APF,ADD,DSNAME=DSN810.SDSNLOAD,SMS

Setprog command is found in the MVS System Commands http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/4.44?SHELF=iea2bk70&DT=20060616012438

Page 14: DB2 Systems Programming Tools of the Trade NA07B03

14

14

Display APF and LNKLST• The APF authorized, and linklisted libraries can be

displayed from the console.

• To display APF• D PROG,APF

• To display LNKLST• D PROG,LNKLST

D PROG, APF command is found: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/4.10.41?SHELF=iea2bk70&DT=20060616012438#HDRD3PROG

D PROG,LNKLST command is found: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/4.10.43?SHELF=iea2bk70&DT=20060616012438

Page 15: DB2 Systems Programming Tools of the Trade NA07B03

15

15

Display PARMLIB• /D PARMLIB to display the order of the parmlibs

Page 16: DB2 Systems Programming Tools of the Trade NA07B03

16

16

SSVT – Subsystem Vector Table• IRLM should not be forced due to the operation of the SSVT.• NIP (Nucleus Initialization Program) executes SDSNLINK

ERLY code at IPL to create entries in the SSVT.• If IRLM is MVS FORCEd down, SSVT is not cleaned up, and

there is no way to manually clean it up. • If DB2 tries to come up, it thinks that IRLM is still running and

will not start.• The only way to reestablish the SSVT entry for the forced IRLM

is to IPL.• Alternatively, by defining a 2nd IRLM, change ZPARMs and the

IRLM startup proc to point to the new name, DB2 can be brought up with the alternate IRLM.

• MVS CANCEL can be used on IRLM, but not FORCE.

F DBxxIRLM,STATUS to determine the status of IRLM

If MVS FORCE is used, and an alternate IRLM is connected in zparm, the original IRLM cannot be used until an IPL is done to clean up the SSVT.

Page 17: DB2 Systems Programming Tools of the Trade NA07B03

17

17

IRLM shutdown, MVS commands• Normal sequence:

• Shutdown of DB2 usually stops IRLM. • /STOP irlmproc• /MODIFY irlmproc,ABEND or

/F irlmproc,ABEND,DUMP • /CANCEL irlmproc

• Avoid if at all possible. If entered, this command requires an IPL to clean up SSVT• /FORCE irlmproc

Page 18: DB2 Systems Programming Tools of the Trade NA07B03

18

18

PPT Program Properties Tables• z/OS is shipped with the PPT populated. • The PPT contains among other things, the Protect

Key – a memory protection mechanism. • Lower numbers can write in higher number areas.

Higher numbers cannot write in lower number areas. • The operating system runs in key 0. • Access method services runs in key 5. • CICS and DB2 run in key 7. • Applications run in 8.

The populated PPT is documented in the z/OS V1R8.0 MVS Initialization and Tuning Reference found here:

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/iea2e270/68.7?ACTION=MATCHES&REQUEST=ppt&TYPE=FUZZY&SHELF=iea2bk70&DT=20060710234538&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

Page 19: DB2 Systems Programming Tools of the Trade NA07B03

19

19

Synonym Meaning SCHEDxx keywordNC Non-cancelable NOCANCELNS Non-swappable NOSWAPPR Privileged PRIVST System task SYSTND No data set integrity NODSIBP Bypass password protection NOPASSKey PSW key for this program KEY(x)Proc Affinity Processors eligible AFF(y)2P Second level preferred storage SPREF1P First level preferred storage LPREFNP No preferred storage NOPREF

Page 20: DB2 Systems Programming Tools of the Trade NA07B03

20

20

Protect Key and the PSW• In a PSW (Program Status Word), the third

position is the protect key:

PSW 077D0000 A242B10A Protect key 7 (DB2)PSW 078D0000 80A7328C Protect key 8 (problem program)

Problem program (application code) runs with the least protection.

If this message is displayed, the application has been dropped fromit’s key to key 8, or lost other PPT attributes:

IEF188I PROBLEM PROGRAM ATTRIBUTES ASSIGNED

The Program Properties Table in DB2 UDB R810 is found here:

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2E270/68.7?SHELF=iea2bk70&DT=20060710234538

Page 21: DB2 Systems Programming Tools of the Trade NA07B03

21

21

PSW Protect Keys and APF• Programs listed in the PPT will run in the assigned key,

unless something with a higher key is included in their execution libraries on steplib or joblib, or if the required library is not APF-authorized.

• Including a higher key library will cause all libraries in the concatenation ot be assigned to the highest number.

• Programs requiring a lower number will likely have problems executing – S0C4, S047, etc.

• To easily identify the source of the problem, know that DB2 PSW is key 7. If the error PSW is 078, you know something is wrong with the execution libraries.

Page 22: DB2 Systems Programming Tools of the Trade NA07B03

22

22

Questions• We covered IPLPARMs, SYS1.PARMLIB, APF,

SCHED, LNKLST, SSVT, PPT, PSW and protect keys.

• Any questions?

Page 23: DB2 Systems Programming Tools of the Trade NA07B03

23

23

Console Dump Info – SYS1.DAE• Systems dump occasionally – slipped, on their

own, or forced. • SYS1.DAE is the dump suppression mechanism

shipped with MVS to save the overhead of duplicate dumping.

• When a product dumps, a symptom string is built and SYS1.DAE is checked to see if it’s already dumped. If the symptom string matches, the dump is suppressed.

Page 24: DB2 Systems Programming Tools of the Trade NA07B03

24

24

Console Dump Info – SYS1.DAE• If the symptom string isn’t present, the dump is

taken and the string added to SYS1.DAE. • If SYS1.DAE is suppressing a dump you need, edit

it and delete the line containing the symptom string.

Page 25: DB2 Systems Programming Tools of the Trade NA07B03

25

25

Dumps – Slip management• Slips cause a dump to be taken when certain

criteria is set.

• Slips are set from the console.

• They can be enabled, set to run multiple times, disabled, and deleted from the system.

Page 26: DB2 Systems Programming Tools of the Trade NA07B03

26

26

Setting Slips• The syntax is –

• SLIP SET,[options],END• This example will set a slip, name it MA01, looking for

a system abend 0C7, in job MA01B55, abend type SVC.

• SLIP SET,ID=MA01,C=0C7,J=MA01B55,A=SVCD,E

• The ‘E’ terminates the slip command. Matchlim is the number of times it will fire, and if not specified, will default to once.

Page 27: DB2 Systems Programming Tools of the Trade NA07B03

27

27

Setting Slips• This example names the slip QA01, gives us an

SVC dump for a system abend 04E on a specific DB2 reason code, matchlim is 3 (will fire 3 times), and an E to end.

• SET,ID=QA01,A=SVCD,C=04E,REASON=00C90301,ML=3,E

Page 28: DB2 Systems Programming Tools of the Trade NA07B03

28

28

Setting slips – parameters• SET,ID=QA01,A=SVCD,C=04E,REASON=00C90301,ML=3,E

• System abends are coded C=xxxx.

• User abends are coded C=Uxxxx.

• Matchlim (abbreviated ML) is useful if you have to take multiple dumps of a reoccurring problem, usually because you’re working with MVS increasing the dump dataset size.

Page 29: DB2 Systems Programming Tools of the Trade NA07B03

29

29

Slips - Displaying• Display all slips

• /D SLIP

ID STATE ID STATEZA14 ENABLED XB37 ENABLEDU775 ENABLED MA01 ENABLED

• Display the characteristics of a named slip • /D SLIP=MA01

Page 30: DB2 Systems Programming Tools of the Trade NA07B03

30

30

Slips – Enable, Disable, Delete• Enable a previously disabled (or fired) slip

SLIP MOD,ID=xxxx,EN

• Disable a previously enabled slipSLIP MOD,ID=xxxx,D

• Delete a slipSLIP DEL,ID=xxxx

Slip commands are found in the z/OS Systems Commands http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/4.52?SHELF=iea2bk70&DT=20060616012438

Syntax diagram is here:http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G170/4.52.5.3?SHELF=iea2bk70&DT=20060616012438#HDRSIACT

Page 31: DB2 Systems Programming Tools of the Trade NA07B03

31

31

Console Dump InfoIEA611I COMPLETE DUMP ON N848S1.SYSA.D060214.T034543.DB2YDIST.S00005IEE854I 03.47.27 SYS1.DUMP ERRDATA 393SYS1.DUMP DATA SETS AVAILABLE=000 AND FULL=000CAPTURED DUMPS=0000, SPACE USED=00000000M, SPACE FREE=00002500MMSDUMP.SYSD.D060214.T034543.DTADDIST.S00005 TITLE=DTAD,ABND=04E-00E70005,U=N99999 ,C=XYR00.710.LOCN=199.99.999.9,LOC=DSNXGRDS.DSNXGTRE:M120DUMP TAKEN TIME=03.46.08 DATE=02/14/2007ERRORID=SEQ63621 CPU0042 ASID00B9 TIME=03.45.40SYSTEM ABEND CODE=04E REASON CODE=00E70005MODULE=DSNXGRDS CSECT=DSNXGTREPSW AT TIME OF ERROR=477C1000 A998AA2E ILC=2 INT=0DTRANSLATION EXCEPTION ADDR=00584000ABENDING PROGRAM ADDR=******** RECOVERY ROUTINE=DSNTFRCVGPR 0-3 00000004 0004E000 00000015 6512373FGPR 4-7 506147E0 00000015 1A7EB418 60557950GPR 8-11 00000008 00000002 65123728 A998A450GPR12-15 2998B44F 65123500 A998AA20 00E70005

Page 32: DB2 Systems Programming Tools of the Trade NA07B03

32

32

Console Dump Info – IEAx11

• On the console, look for the message to determineif the dump was complete or not.

• IEA911 if the dump goes to SYS1.DUMPxx datasets

• IEA622 if the dump goes to dynamically allocated datasets.

• Incomplete dumps are seldom useful for problemdiagnosis. Another dump may be needed.

Page 33: DB2 Systems Programming Tools of the Trade NA07B03

33

33

Console Dump Info – IEAx11

• The dump message will also tell you if the dumpdataset is too small.

• MVS Systems Programmers will reallocate thedump datasets large enough to hold the dump.

Page 34: DB2 Systems Programming Tools of the Trade NA07B03

34

34

Dump Info – SDSF DUMPSRV

• There are several ways to determine if the system is dumping, besides it being slow.

• SDSF - DUMPSRV will be running when the system is dumping.

• In SDSF, PRE DUMPSRV* and look for the running address space.

• Dumps move from DUMPSRV to the SYS1.DUMPxx or dynamically allocated datasets, then to a final location and name.

Page 35: DB2 Systems Programming Tools of the Trade NA07B03

35

35

Dump Info – D D,ERRDATAD D,ERRDATA

IEE854I 15.36.37 SYS1.DUMP ERRDATA 665SYS1.DUMP DATA SETS AVAILABLE=004 AND FULL=001CAPTURED DUMPS=0000, SPACE USED=00000000M, SPACEFREE=00001000M

DUMP02 TITLE=#1 OF 4 SPXRCM97DUMP TAKEN TIME=14.49.54 DATE=01/16/06

NO DUMP DATA AVAILABLE FOR THE FOLLOWING EMPTYSYS1.DUMP DATA SETS:01,03-05

Very, very useful command for determining the ability of DUMPSRV to handle adump, if it’s busy, how much space is available, and if dumps are in process to rollover to their destination.

Page 36: DB2 Systems Programming Tools of the Trade NA07B03

36

36

Dump Info – D D,ERRDATA

• This tells us we have one dump in the SYS1.DUMPxx datasets that has not yet been written to the dump manager datasets.SYS1.DUMP DATA SETS AVAILABLE=004 AND FULL=001

• This tells us that space used is 0, meaning the DUMPSRV has room to take another dump. The full dump in the SYS1.DUMPxx dataset does not count against the DUMPSRV available space.CAPTURED DUMPS=0000, SPACE USED=00000000M, SPACE FREE=00001000M

Page 37: DB2 Systems Programming Tools of the Trade NA07B03

37

37

Dump Info – D D,ERRDATA• This is the title of the dump that’s waiting to move

from the SYS1.DUMPxx dataset to disk, and the list of empty SYS1.DUMPxx datasets.

DUMP02 TITLE=#1 OF 4 SPXRCM97DUMP TAKEN TIME=14.49.54 DATE=01/16/96

NO DUMP DATA AVAILABLE FOR THEFOLLOWING EMPTYSYS1.DUMP DATA SETS:

01,03-05

Page 38: DB2 Systems Programming Tools of the Trade NA07B03

38

38

Dump command, D D,T• /D D,T will display the dumps and titles.

IEE853I 13.59.47 SYS1.DUMP TITLES SYS1.DUMP DATA SETS AVAILABLE=000 AND FULL=000CAPTURED DUMPS=0000, SPACE USED=00000000M, SPACE

FREE=00000500MSYS1.DUMP.D070303.T192346.L06RS005.S00001 TITLE=ENF ABENDERRORMOD=IEFENFNMDUMP TAKEN TIME=15.23.50 DATE=03/03/07NO DUMP DATA AVAILABLE FOR 004 AUTOMATICALLY ALLOCATED

DUMP DATA SETS

Page 39: DB2 Systems Programming Tools of the Trade NA07B03

39

39

Questions – Dump Info• Any questions before we leave dumps?

Page 40: DB2 Systems Programming Tools of the Trade NA07B03

40

40

SYS1.LOGREC• Logrec is a z/OS central repository for error, informational,

and statistical records from software and hardware.• Most it not all products write to logrec. • Dumps write corresponding records to SYS1.LOGREC as

the software percolates through the dump process.• The DUMP ERRORID can be found in it’s matching

LOGRECS.• Logrecs are written to default SYS1.LOGREC, but the

destination can be tailored. Often it’s tailored as SYS1.<lpar>.LOGREC.

• Logrecs roll over to daily, weekly, monthly files driven either by time or as SYS1.LOGREC is filled.

EREP bookshelf: http://publib.boulder.ibm.com/cgibin/bookmgr/Shelves/ifc5bk04

Page 41: DB2 Systems Programming Tools of the Trade NA07B03

41

41

SYS1.LOGREC• EREP (Environmental Record Editing and Printing

Program) reports can be run off the live files, an extract, or from the historical files.

• SYS1.LOGREC is a time-based collection of rows.• The extract program is IFCOFFLD.• The report program is IFCEREP1.• EREP is executed with control cards to filter and

extract records to a dataset for shipping to IBM, or printing to the spool.

Page 42: DB2 Systems Programming Tools of the Trade NA07B03

42

42

SYS1.LOGREC – Extract and zero//P390OFFL JOB (),'SYS1.LOGREC OFFLOAD',CLASS=A,MSGCLASS=X,// NOTIFY=&SYSUID,TIME=1440,REGION=48M//STEP1 EXEC PGM=IFCOFFLD//SERLOG DD DSN=SYS1.LOGREC,DISP=OLD//ACCDEV DD DSN=P390.LOGREC1,DISP=(NEW,CATLG,CATLG),// SPACE=(TRK,(100,100),RLSE),UNIT=3390,// DCB=(RECFM=VB,BLKSIZE=6144),VOL=SER=OS39M1//TOURIST DD SYSOUT=* ,DCB=BLKSIZE=133//EREPPT DD SYSOUT=* ,DCB=BLKSIZE=133//SYSIN DD DUMMY

WARNING:

• SYSIN is defaulting to ACC=Y and ZERO=Y to dump the ACC file and zero out SYS1.LOGREC.

Note: This job will EMPTY SYS1.LOGREC. The logrecs will be moved to the ACCDEV DD.

DDs for the HISTORICAL Extract are found here: http://publib.boulder.ibm.com/cgibin/bookmgr/BOOKS/IFC5G101/4.2?SHELF=ifc5bk04&DT=19990120114558

Page 43: DB2 Systems Programming Tools of the Trade NA07B03

43

43

SYS1.LOGREC – Report JCL//S0 EXEC PGM=IFCEREP1,REGION=1024K,// PARM='CARD'//SERLOG DD DISP=(OLD,KEEP),DSN=SYS1.LOGREC//ACCDEV DD DISP=(MOD,CATLG,CATLG),DSN=SYS1.LOGREC.HIST,// UNIT=SYSDA,SPACE=(CYL,(2,2)),// DCB=(RECFM=VB,BLKSIZE=6144)//DIRECTWK DD DISP=(NEW,DELETE),UNIT=SYSDA,SPACE=(CYL,2,,CONTIG)//EREPPT DD SYSOUT=*,DCB=BLKSIZE=133//TOURIST DD SYSOUT=*,DCB=BLKSIZE=133//SYSIN DD *ACC=N <-Copy SYS1.LOGREC?DATE=(06135),TIME=(1600-1630)PRINT=ALZERO=N <-Zero out SYS1.LOGREC?

Report parameters are found here:http://publib.boulder.ibm.com/cgibin/bookmgr/BOOKS/ifc5g101/2.3.1?SHELF=ifc5bk04&DT=19990120114558

Page 44: DB2 Systems Programming Tools of the Trade NA07B03

44

44

Replace with newer version. #2

This shows the LOGREC header – the ERRORID will match dump info from the console, if a dump was produced. The search argument string, failing load moduleand csect, abend code, reason code, etc.There may be many LOGRECs for a given failure as each component percolates through the dump process.

Page 45: DB2 Systems Programming Tools of the Trade NA07B03

45

45

Replace to correspond with 42. #3.

Page 46: DB2 Systems Programming Tools of the Trade NA07B03

46

46

SYS1.LOGRECs correlate to the DB2 Diagnosis Guide• DB2 Logrecs contain the SDWA (System

Diagnostic Work Area).• SDWA is formatted by EREP. • The codes and fields in SDWA are documented in

the DB2 UDB Diagnosis Guide. In version 8, they start on page 207.

Page 47: DB2 Systems Programming Tools of the Trade NA07B03

47

47

All the keys on a DB2 LOGREC formatted SDWAVRA are documented in the DB2 UDB Diagnosis Guide.

x’06’ is the abend reason codex’CA’ is the subsystem namex’3A’ are address space idsEtc.

Page 48: DB2 Systems Programming Tools of the Trade NA07B03

48

48

Page 49: DB2 Systems Programming Tools of the Trade NA07B03

49

49

Questions – SYS1.LOGREC• Questions before we leave LOGREC?

Page 50: DB2 Systems Programming Tools of the Trade NA07B03

50

50

DFSMS Storgroups• Many shops are now SMS Managed. • DASD are organized into STORGROUPS. This is

different than DB2’s STOGROUP, but works functionally similar.

• SMS writes ACS routines (Automatic Class Selection) routines to route datasets to certain STORGROUPS.

• DB2 Stogroups can point to individual DASD, or ‘*’meaning SMS-managed.

z/OS V1R8.0 DFSMS Bookshelf http://publib.boulder.ibm.com/cgi-bin/bookmgr/Shelves/dgt2bk60

z/OS V1R8.0 DFSMS Storage Administration Management http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/DGT2S250/CCONTENTS?SHELF=dgt2bk60&DN=SC26-7402-06&DT=20060616125145

Page 51: DB2 Systems Programming Tools of the Trade NA07B03

51

51

ACS Routines• ACS routines are usually managed through ISMF

(Interactive Storage Manage Facility). Similar to ISPF panels.

• The routines are translated into a SCDS (Source Control Data Set).

• SCDS is a VSAM linear dataset.

ACS management is found in the z/OS V1R8.0 DFSMS Storage Administration Reference chapter 10.

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/DGT2S250/CCONTENTS?SHELF=dgt2bk60&DN=SC26-7402-06&DT=20060616125145

Page 52: DB2 Systems Programming Tools of the Trade NA07B03

52

52

ACS management is found in the z/OS V1R8.0 DFSMS Storage Administration Reference chapter 10.

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/DGT2S250/CCONTENTS?SHELF=dgt2bk60&DN=SC26-7402-06&DT=20060616125145

Page 53: DB2 Systems Programming Tools of the Trade NA07B03

53

53

DFSMS – Lay of the Land• Sometimes SMS usage raises issues in DB2: dynamic

allocation failure, severe SMS catalog errors. • DASD containing DB2 datasets can be on-line and

available, but missing from the SMS catalog. • DB2’s call for a dataset is handed to SMS, but because

the DASD is not in the STORGROUP, a severe SMS catalog error is reported to DB2.

• These are the commands to see how the STORGROUPs are laid out – their names, contents (DASD volumes), and if the DASD appears in more than one STORGROUP.

Recently a SMS change caused problems in DB2. Production user application partitions were unavailable;

This message was reported in the DB2MSTR log: DSNB207I Dynamic allocation of dataset failed. Reason=97040000 DSNAME=xxxx.

According to the Authorized Assembler Services Guide, 9704 is a class 7 Severe SMS Catalog service error.

OS/390 210 Authorized Assembler Services Guide http://publib.boulder.ibm.com/cgibin/bookmgr/BOOKS/IEA1A842/CCONTENTS?DT=20011024153852

Search for 9704, or 17zz. zz is what they use to substitutes characters in this book.

In the case of the 9704, the datasets or partitions were not found in the SMS catalog, although the volumes were

on-line, enabled, and the problem datasets could be found via ISPF 3.4.

Page 54: DB2 Systems Programming Tools of the Trade NA07B03

54

54

DFSMS – Display STORGROUP• D SMS,SG(ALL) will list all the

stogroups in the system.

• D SMS,SG(xxxxxx),LISTVOL will list all the volumes in a stogroup.

• D SMS,VOL(volser) will list all the stogroup(s) the vol appears in.

These three commands will allow you to map DFSMS on your system.

Page 55: DB2 Systems Programming Tools of the Trade NA07B03

55

55

D SMS,SG(ALL) D SMS,SG(ALL)IGD002I 14:50:27 DISPLAY SMS 302STORGRP TYPE SYSTEM= 1SGDBEL90 POOL +SGDBE90 POOL +SGDB2L90 POOL +SGDB2X90 POOL + SGDB2Z90 POOL +SGDB290 POOL +SGDUMMY DUMMY .SGEPRD90 POOL +SGETON90 POOL +SGETST90 POOL +

Page 56: DB2 Systems Programming Tools of the Trade NA07B03

56

56

D SMS,SG(ALL) - ContinuedUPSCPM POOL +UPSSUPP POOL +UPSTSO POOL +***************************** LEGEND *****************************. THE STORAGE GROUP OR VOLUME IS NOT DEFINED TO THE SYSTEM+ THE STORAGE GROUP OR VOLUME IS ENABLED- THE STORAGE GROUP OR VOLUME IS DISABLED* THE STORAGE GROUP OR VOLUME IS QUIESCEDD THE STORAGE GROUP OR VOLUME IS DISABLED FOR NEW ALLOCATIONS ONLYQ THE STORAGE GROUP OR VOLUME IS QUIESCED FOR NEW ALLOCATIONS ONLY> THE VOLSER IN UCB IS DIFFERENT FROM THE VOLSER IN CONFIGURATIONSYSTEM 1 = MVS1

The list of Storgroups is displayed followed by a character, and the legend is displayed at the end of the message.

Page 57: DB2 Systems Programming Tools of the Trade NA07B03

57

57

D SMS,SG(SGDB2L90),LISTVOLIGD002I 14:53:58 DISPLAY SMS 207STORGRP TYPE SYSTEM= 1SGDB2L90 POOL +VOLUME UNIT SYSTEM= 1 STORGRP NAMEDB2L20 + SGDB2L90

<snip>DB2L30 + SGDB2L90DB2L31 + SGDB2L90DB2L32 + SGDB2L90DB2L33 + SGDB2L90DB2L34 + SGDB2L90DB2L35 + SGDB2L90DB2L36 + SGDB2L90DB2L37 + SGDB2L90DB2L38 + SGDB2L90***************************** LEGEND *****************************. THE STORAGE GROUP OR VOLUME IS NOT DEFINED TO THE SYSTEM+ THE STORAGE GROUP OR VOLUME IS ENABLED- THE STORAGE GROUP OR VOLUME IS DISABLED> THE VOLSER IN UCB IS DIFFERENT FROM THE VOLSER IN CONFIGURATIONSYSTEM 1 = MVS1

Page 58: DB2 Systems Programming Tools of the Trade NA07B03

58

58

D SMS,VOL(volser)

IGD002I 14:54:50 DISPLAY SMS 284VOLUME UNIT SYSTEM= 1 STORGRP NAMEDB2L25 + SGDB2L90*********************** LEGEND ***********************. THE STORAGE GROUP OR VOLUME IS NOT DEFINED TO THE SYSTEM+ THE STORAGE GROUP OR VOLUME IS ENABLED- THE STORAGE GROUP OR VOLUME IS DISABLED* THE STORAGE GROUP OR VOLUME IS QUIESCED

Page 59: DB2 Systems Programming Tools of the Trade NA07B03

59

59

Questions - DFSMS• Any questions before leaving DFSMS?

Page 60: DB2 Systems Programming Tools of the Trade NA07B03

60

60

SMF – System Management Facilities

• SMF is a record collection mechanism in MVS. • SMF data is used for billing users, analyzing

configuration, reporting DASD usage, etc. The information contained in SMF is extensive.

• IBM products are assigned a SMF record number in which they can write their SMF data.

• DB2 is assigned numbers 100, 101, and 102. • DB2’s IFCIDs are written into these SMF records.

SMF Manuals are in the z/OS Shelf: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G270/CCONTENTS?SHELF=iea2bk70&DN=SA22-7630-13&DT=20060626104432

Page 61: DB2 Systems Programming Tools of the Trade NA07B03

61

61

Reference: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IEA2G270/13.0?SHELF=iea2bk70&DT=20060626104432

z/OS 1.8

Page 62: DB2 Systems Programming Tools of the Trade NA07B03

62

62

SMF – DB2’s IFCIDs• DB2 control blocks are dumped to IFCIDs periodically.• The IFCIDs chosen for writing are controlled by the

trace command. • Several IFCIDs will be written to a single SMF record;

as many as will fit on one page. • The SMF record has the standard SMF header

pointing to the self-defining section, the IFCIDs, and the self-defining section. The header is x’1C’ in length.

• Only one type of IFCID will be on a single SMF record.

Page 63: DB2 Systems Programming Tools of the Trade NA07B03

63

63

SMF – MANx files• SMF writes into SYS.MANx files. • The files roll to daily, weekly, and monthly files, depending

on how the MVS sysprogs set it up. • The live files can be accessed, as well as the historical.• Caution is called for when accessing the files live – if they

are emptied, critical system information is lost. • Some of the basic examples in the book demonstrate how

to empty the files, and as this has been done inadvertently in some shops, naturally MVS is concerned over any live access to the MANx files.

Page 64: DB2 Systems Programming Tools of the Trade NA07B03

64

64

SMF – Display MANx Status• D SMF[,S|,O][,L={a|name|name-a}]

COMMAND INPUT ===> /D SMFRESPONSE=DVLPIEE974I 15.53.37 SMF DATA SETS

NAME VOLSER SIZE(BLKS) %FULL STATUSP-SYS1.MAN1.DVLP DVMAN1 37080 70 ACTIVES-SYS1.MAN2.DVLP DVMAN1 37080 0 ALTERNATES-SYS1.MAN3.DVLP DVMAN1 37080 0 ALTERNATES-SYS1.MAN4.DVLP DVMAN1 37080 0 ALTERNATES-SYS1.MAN5.DVLP DVMAN2 37080 0 ALTERNATES-SYS1.MAN6.DVLP DVMAN2 37080 0 ALTERNATE

http://publib.boulder.ibm.com/cgibin/bookmgr/BOOKS/IEA2G160/4.10.47?SHELF=iea2bk60&DT=20050714212238S = dataset statusO = SMF OptionsL = Display area or console name for the display. Defaults to the console log.

Page 65: DB2 Systems Programming Tools of the Trade NA07B03

65

65

SMF – Live access and extract• This will extract DB2 IFCIDs from an active MANx file.

//SMFEXTR EXEC PGM=IFASMFDP//SYSPRINT DD SYSOUT=*//INDD DD DSN=SYS1.MAN1.DVLP,DISP=SHR//OUTDD DD DSN=EXT1LH.DVLP.SMF.EXTRACT,DISP=(,CATLG),// DCB=(LRECL=32756,RECFM=VBS,BLKSIZE=0,DSORG=PS),// UNIT=SYSDA,SPACE=(CYL,(5,5))//SYSIN DD *DATE(2007039,2007039)START(0900)END(1036)INDD(INDD,OPTIONS(DUMP))OUTDD(OUTDD,TYPE(100,101,102))/*

The example does not purge or otherwise affect SMF. It runs an extract only.

Page 66: DB2 Systems Programming Tools of the Trade NA07B03

66

66

SMF – Historical access• From the extract above, you can run dumps of the

IFCIDs. • Alternatively, when the MANx files rollover, they

will be in the historical files set up by MVS – daily, weekly, etc.

• IDCAMS can be used to dump the records. • These are raw, so you can see the actual SMF

record header, the self-defining area, and the IFCIDs.

Page 67: DB2 Systems Programming Tools of the Trade NA07B03

67

67

SMF – Dumping the records• IDCAMS or DFSERA10 can be used to dump the

extract

//IDCAMS EXEC PGM=IDCAMS//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=EXT1LH.DVLP.SMF.EXTRACT,// DISP=SHR//SYSIN DD *PRINT IFILE(SYSUT1) DUMP

Page 68: DB2 Systems Programming Tools of the Trade NA07B03

68

68

SMF – Dumping the records//S010 EXEC PGM=DFSERA10//STEPLIB DD DSN=SLP41.APF.RESLIB,DISP=SHR//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=EXT1LH.DVLP.SMF.EXTRACT,DISP=SHR//SYSIN DD *OPTION PRINTEND

• If SMF contains more than one DB2’s records, this print option will strip out the SMF records for the rows with the value at offset 19 (the subsystem name), DVLP in this example:

OPTION PRINT OFFSET=19,FLDTYP=C,VALUE=DVLP,FLDLEN=4

Page 69: DB2 Systems Programming Tools of the Trade NA07B03

69

69

SMF – ‘REVIEW’ – CBT Tape• On the CBT tape is a tool to read and format raw

SMF data. It’s called ‘REVIEW’. • If your shop permits the CBT tools, download and

install from www.cbttape.org. The instructions are on the site.

• =3.4 to list the extract file, and in the command column, type ‘REVIEW’.

Page 70: DB2 Systems Programming Tools of the Trade NA07B03

70

70

SMF – REVIEW – CBT Tape

Page 71: DB2 Systems Programming Tools of the Trade NA07B03

71

71

SMF – FORMAT SMF• Type SMF on the command line and REVIEW will convert the raw

data to readable data. It’s still SMF, so there’s no reporting or formatting, but you can see it.

Page 72: DB2 Systems Programming Tools of the Trade NA07B03

72

72

Mapping IFCIDs to SMF• Mapping introduction is found in

ADSNMACS(DSNWMSGS). • In DB2 UDB R810, it’s been moved to

ADSNIVPD(DSNWMSGS).• This member also contains the cross reference

between trace classes and ifcids – very valuable if you are looking for a specific IFCID and have to find the trace that writes it.

Page 73: DB2 Systems Programming Tools of the Trade NA07B03

73

73

Mapping cross-reference

These are the modules containing the maps to the IFCIDs. For example, 337 inR710 is for migration zparm PKGLDTOL (package load toleration). It would bemapped in DSNDQW04.

Page 74: DB2 Systems Programming Tools of the Trade NA07B03

74

74

Trace type to SMF xref - DSNWMSGS

Page 75: DB2 Systems Programming Tools of the Trade NA07B03

75

75

RecapDB2’s Connections in z/OS

• IPLINFO toSYS1.PARMLIB

• SYS1.PARMLIB• APFxx• SCHEDxx• IEFSSNxx• PROGxx

• SSVT – Subsystem Vector Table

• PPT – Program Properties Table

• Console Dump Information• SLIPS• SYS1l.LOGREC• DFSMS Storage Mgmt

• ACS routines• SMF

• Live access – MANx• Archive access

• IFCID and SMF Mapping

Page 76: DB2 Systems Programming Tools of the Trade NA07B03

76

76

Thank you!

If you’re interested in other DB2Systems Programming sessions,

let IDUG know.Write it on the session review

form.

Page 77: DB2 Systems Programming Tools of the Trade NA07B03

77

77

Session B03DB2 Systems Programming – Tools of the Trade

Linda Hagedorn Performance & Tuning [email protected]