INFRAESTRUCTURA Y EQUIPAMIENTO
EL SISTEMA DE ALCANTARILLADO
This chapterdiscussesoperating theCICSDB2attachmentfacility.Itincludesthe following topics:
v
“StartingtheCICSDB2attachmentfacility”
v “StoppingtheCICSDB2 attachmentfacility”
v “Resolvingindoubtunitsof work(UOWs)”onpage26
v “ManagingtheCICSDB2attachmentfacility”onpage 29
v “EnteringDB2commands”onpage 30
v “PurgingCICSDB2transactions”onpage30
v “StartingSMFforDB2 accounting,statisticsandtuning”onpage31
v “StartingGTFfor DB2accounting,statistics andtuning”onpage31
Starting
the
CICS
DB2
attachment
facility
TheCICSDB2attachmentfacilitycanbestartedautomaticallyat initialization,or manuallyusingthecommandsdescribedin“Manualconnection.”
Automatic
connection
at
CICS
initialization
ConnectionbetweenCICSandDB2can beestablishedautomaticallyat CICS initialization byanyoneofthefollowingmethods:
v SpecifyingDB2CONN=YESintheSIT,orasaSIToverride
v SpecifyingprogramDFHD2CM0aftertheDFHDELIMstatementofyour PLTPI
v Specifyingauser-writtenprogramthatissuesanEXECCICSSETDB2CONN
CONNECTEDcommand,aftertheDFHDELIM statementof yourPLTPI
Manual
connection
ConnectionbetweenCICSandDB2can beestablishedmanuallybyanyoneofthe following methods:
v UsingtheDSNCSTRTcommand.
ForinformationontheDSNCSTRTcommandsee“DSNC STRT”onpage48. v UsingaCEMT SETDB2CONN CONNECTEDcommand.
ForinformationontheSETDB2CONNCONNECTEDcommand,seeCICS SuppliedTransactions.
v Runningauserapplicationthatissues anEXECCICSSETDB2CONN
CONNECTEDcommand.For moreinformationabouttheEXECCICSSET DB2CONNCONNECTEDcommand,seetheCICSSystemProgramming Reference.
Stopping
the
CICS
DB2
attachment
facility
TheCICSDB2attachmentfacility,andhencetheCICS-DB2connection,canbe quiescestoppedor forcestopped.Aquiescestopwaitsfor allCICStransactions currently usingDB2tocomplete.Aforce stopcausesallCICStransactionscurrently usingDB2to beforcepurged.
Automatic
disconnection
at
CICS
termination
Duringstartupof theCICSDB2attachmentfacility,theCICSDB2 task-relateduser exit (TRUE)isenabledwiththeSHUTDOWNoption.ThismeansthatCICS
automatically invokestheTRUEwhenCICSisshutdown,soastoshut downthe CICSDB2connection.WheninvokedduringaquiesceshutdownofCICS,the CICSDB2TRUEinitiatesa quiescestop oftheattachmentfacility.Likewisean immediateshutdown ofCICScausesaforce shutdownoftheattachmentfacilityto beinitiatedbytheTRUE.IfCICSiscancelled,noshutdownoftheattachment facilityisinitiatedbytheTRUE.
Manual
disconnection
Theconnection betweenCICSandDB2canbestoppedordisconnectedbyusing any oneofthefollowingmethods:
v UsingtheDSNCSTOP command.
ForinformationontheDSNCSTOPcommandsee“DSNC STOP”onpage46. v UsingaCEMT SETDB2CONN NOTCONNECTEDcommand.
v RunningtheCICS-supplied CDBQtransactionthatissues anEXECCICSSET
DB2CONNNOTCONNECTEDcommand.
TheCDBQtransactionrunsprogramDFHD2CM2.Thetransactioncanberun directlyfromtheterminalorbyusingtheEXECCICSSTARTcommand.No messagesareoutputto theterminal.TheCICSDB2adapterhoweveroutputs messagesto transientdataaspartofitsshutdownprocedure.
v RunningtheCICSsuppliedCDBFtransactionthatissuesanEXECCICSSET
DB2CONNNOTCONNECTEDFORCE command.
TheCDBFtransaction runsprogramDFHD2CM3.Thetransactioncanberun directlyfromtheterminalorEXECCICSSTARTed.Nomessagesareoutputto theterminal.TheCICSDB2adapter,however,outputsmessages totransient dataaspartofitsshutdownprocedure.
v RunningauserapplicationthatissuesanEXECCICSSETDB2CONN
NOTCONNECTEDcommand.
Resolving
indoubt
units
of
work
(UOWs)
Indoubtunitsofwork(UOWs)canoccurwhenCICS,DB2, orthewholesystem failswhilsta transactioniscarryingoutsyncpointprocessing,thatis,during processing ofanEXECCICSSYNCPOINTor EXECCICSRETURN command. CICSisthecoordinatoroftheUOW,andifmorethanonerecoverable resourceis involvedusesthetwo-phasecommitprotocolwhentryingtocommittheUOW. Between replying“yes”to thephase1 preparecall,andbeforereceivingthecommit or backoutcall atphase2time, DB2isindoubtasto theoutcomeoftheUOW.Ifa failureoccursat thistime,DB2 remainsindoubtabouttheUOW;it hasanindoubt UOWandmustask CICSto resynchronize.
In situationswhereonlyDB2anda singleCICSsystem areinvolvedwiththeunitof work,CICSisalwaysthecoordinator.If furtherpartiesareinvolved—for example, bymeansof aLU6.2communicationlink—itispossiblethatthelocalCICSsystem isnottheoverallcoordinatoroftheunitof work;for example,a remoteCICS system mightbethecoordinatorinstead.In thissituation,itispossiblethatboth DB2 andthelocalCICSsystemareindoubtabouttheoutcomeof theUOW.Ifa failureoccursinthissituation,thelocalCICSsystem mightshunttheunitofwork, dependingonthedefinitionforthetransaction.Theunitofworkisthenconsidered to beshuntedindoubt.
IndoubtUOWsarenormallyresolvedautomaticallywhentheconnectionbetween CICSandDB2isreestablished.CICSandDB2exchangeinformationregardingthe
committed. IfaUOWisshuntedindoubt,thisexchangeof informationisdeferred until theremotecoordinatorhasinformedCICSof theoutcome.However,if youare usinggroupattach,CICSmightreconnectto adifferentDB2subsystem,andbe unableto exchangeinformationabouttheindoubtUOWsheldbythepreviously connectedDB2 subsystem.TheRESYNCMEMBERattributeoftheDB2CONN definitionisused tosolvethisproblem—see“ResolvingindoubtUOWswhenusing group attach.”
Resolving
indoubt
UOWs
when
using
group
attach
See“UsingtheDB2groupattachfacility”onpage 51for anexplanationofhow the DB2 groupattachfacilityworks.If youareusinggroupattachandtheconnection betweenCICSandDB2isbroken,CICSmightnotreconnectto thesameDB2 subsystem—itmightchoosea differentmemberof thedata-sharing groupofDB2 subsystems.This meansthatif indoubtUOWsarebeingheldbythefirstDB2 subsystemtowhich CICSconnected, theycannotberesolved.
Tosolvethisproblem, CICSmaintainsa historyofthelastDB2data-sharing group memberto whichitconnected, whichiscatalogedandmaintainedacrosswarm, emergencyandcold starts(butnotinitialstarts).Duringconnectionorreconnection to DB2,theCICSDB2attachmentfacilitychecksthishistoryto seeifany
outstanding UOWinformationisbeingheldforthelast DB2data-sharinggroup memberto whichitconnected, andactsasfollows:
v IfnooutstandingUOWinformationisbeingheld, groupattachoperatesnormally
andchoosesanyactivememberofthedata-sharinggroupfor theconnection. v Ifoutstanding UOWinformationisbeingheld, thenextactiondependsonthe
settingyouhavechosen fortheRESYNCMEMBERattributeof theDB2CONN definition.
– IfRESYNCMEMBERissettoYES,indicatingthatyourequire
resynchronisationwiththelast recordedDB2data-sharinggroupmember, CICSignoresthegroup attachfacility,andtheCICSDB2attachmentfacility waitsuntilit canreconnectto thatlastconnectedDB2datasharinggroup member,toresolve theindoubtunitsofwork.UOWswhich areshunted indoubtarenotincludedinthis process,becauseCICSitselfisunableto resolvethoseUOWs atthistime. ResynchronizationforthoseUOWswill occurwhenCICShasresynchronizedwithitsremotecoordinator.
– IfRESYNCMEMBERissettoNO,perhapsbecauseyou wantto reconnectas
fastaspossible,CICSmakesoneattemptto reconnectto thelastrecorded DB2data-sharinggroupmember.If thisattemptissuccessful,theindoubt UOWs(withtheexceptionof UOWsthatareshuntedindoubt)can be resolved.If itisunsuccessful,CICSusesgroupattachtoconnect toany activememberoftheDB2data-sharinggroup, andthewarning message DFHDB2064isissued statingthattheremaybeunresolvedindoubtUOWs withthelastrecordedmember.
SeetheCICSResourceDefinitionGuideforinformationonsetting
RESYNCMEMBER.TheRESYNCMEMBERoptioncanalsobesetusinga CEMT/EXEC CICSSETDB2CONNRESYNCMEMBER RESYNC/NORESYNC command—seeCICSSuppliedTransactionsfortheCEMTcommand,andtheCICS SystemProgrammingReferencefor theEXECCICScommand.
Resolving
indoubt
units
of
work
using
DB2
restart-light
CICSsupports theenhancedDB2restart-lightcapabilityprovided inDB2Version8. Restart-lightmodeisintended foracross-system restartintheeventofanMVS system failure,wheretheCICSsystemsareconfiguredto usegroupattach(see # # # # # # # #
“Using theDB2 groupattachfacility”onpage51).InDB2Version7, theDB2 restart-lightcapability alloweda DB2data-sharingmembertorestart witha minimal storagefootprint, freeretainedlocks, andthenterminatenormally.However,this only appliedto in-flightunitsof work,andnotindoubtunitsof work.For DB2 Version8, thiscapabilitywasextendedtoencompassindoubtunitsof work.This enables aCICSsystemto connectto aDB2restart-lightsubsystemfor thepurpose of resynchronizingindoubtunitsof work.This capabilityisespeciallyusefulbecause DB2 doesnotsupportpeerrecovery;thatis,oneDB2subsystemcannot
resynchronize indoubtunitsof workonbehalfofanotherDB2subsystem.
In atypical scenario,if anMVS LPARfails,across-systemrestartcan beinitiated which involvesrestartingthefailedCICSsystemsonanotherLPAR,andbringing upthefailedDB2subsystemonthatLPARinrestart-lightmode.Assumethatthe CICSsystemshave beenconfiguredtousegroupattach,with
RESYNCMEMBER(YES)andSTANDBYMODE(RECONNECT) ontheDB2CONN definition, andthere areindoubtunitsofworkoutstandinginDB2.TheDB2 restart-lightsubsysteminitializes,freesretainedlocksfor anyin-flightUOWs,and then awaitsresynchronizationwithCICSfortheindoubtUOWs.EachCICSsystem initializes,anddetects whetherithasoutstanding unitsof workandwhether
RESYNCMEMBER(YES)has beenspecified.Whereboththeseconditionsaretrue, theCICSsystemignoresgroup attachandreconnects backto thelast DB2
subsystem,whichistheDB2restart-lightsubsystem.TheindoubtUOWsarenow resynchronized,butnonewtransactionsareallowedtoaccessDB2.Whenallthe indoubt UOWshavebeenresolvedintheDB2restart-lightsubsystem,itterminates. Because theCICSsystemsaredefinedwithSTANDBYMODE(RECONNECT), whentheDB2restart-lightsubsystemterminates,they dropintostandbymode and attempta reconnectionto DB2.Now,becausealltheindoubtunitsof workhave been resolved,RESYNCMEMBERdoes notapplyandgroup attachcan beused. TheCICSsystemswillreconnectto anormal,activeDB2subsystem.
Recovery
of
resynchronization
information
for
indoubt
UOWs
CICSmaintainsinformationabout UOWsneededforresynchronizationonits system log.ResynchronizationinformationismaintainedbyCICSacrosswarm, emergency, andcold starts.Resynchronizationinformationislostifaninitial start ofCICSisperformedasthesystemlogis initializedandallinformation is lost,deletingallinformationaboutpreviousunitsofwork.
You shouldrarelyneedto initialstartCICS.Ifyousimply wantto reinstallresources fromtheCSD,acold startshouldbeused,whichallowsanyresynchronization informationto berecovered.In particular,aninitialstartof CICSshouldbeavoided if thepreviouswarmshutdownofCICSissuedmessageDFHRM0131indicating thatresynchronization isoutstanding.
If CICSisinitialstartedwhenDB2resynchronizationwasrequired,whentheCICS DB2 connectionisre-established,messageDFHDB2001isoutputforeach UOW thatfailedto beresynchronized,andtheUOWmust beresynchronized inDB2 usingtheDB2RECOVERINDOUBTcommand.CICSTransactionServerhasno equivalent totheDFH$INDButilitythatwasavailableinCICS/ESAVersion4and earlier,which allowedscanningof thesystem logtoascertaintheoutcomeof the UOW.TheMVSsystem log,andhencealltheUOWinformationonit,hasbeenlost byinitialstartingof CICS.
Managing
the
CICS
DB2
attachment
facility
You canmanagethestatusoftheconnectionbetweenCICSandDB2 usingCEMT commands andcommandsprovidedbytheCICSDB2 attachmentfacility.Thesame function providedbyCEMTisalsoavailableviaEXECCICSINQUIREandSET commands. Belowisa summaryof thefunctionsavailable:
CEMT INQUIREandSETDB2CONN
Theglobalstatusoftheconnection anditsattributesalongwithattributesof pool threadsandcommandthreadscanbeinquireduponandsetusingthese commands. SeeCICSSuppliedTransactions.
CEMT INQUIREandSETDB2ENTRY
TheattributesofaparticularDB2ENTRYdefining threadstobebeused bya specifictransactionor setoftransactionscanbeinquireduponandsetusing thesecommands.SeeCICSSuppliedTransactions.
CEMT INQUIREandSETDB2TRAN
Usethesecommandstofindoutandalterwhichtransaction IDsusewhich DB2ENTRYs. SeeCICSSuppliedTransactions.
DSNC DISC(disconnect)
This CICSDB2attachmentcommandcanbeusedto causecurrently
connectedthreadsto beterminatedassoonastheyarenotbeingused bya transaction. Foractivethreads,thatmeanswhenthetransactionreleasesthe thread,whichistypicallyat syncpointtime.Protectedthreadsarethreadsthat currently arenotbeingusedbyatransactionandnormallyarereleasedifthey have notbeenreusedaftertwoprotectedthread purgecycles.ADSNC DISCONNECTcommandpre-emptsthepurgecyclesandcausesthemto be terminatedimmediately.FormoreinformationontheDSNCDISCONNECT commandsee“DSNC DISCONNECT”onpage36.
DSNC DISP(display)
This CICSDB2attachmentcommandcanbeusedto displaythestatusof activethreadsfor aparticularplan,for aparticulartransaction, orforallplans andtransactions.For moreinformation,see“DSNCDISPLAY”onpage38. TheDSNC DISPcommandalsodisplaysCICSDB2statistics toaCICS terminal.Thesestatisticsareonlya subsetoftheCICSDB2statisticsthatyou canobtainusingtheCICSCOLLECTSTATISTICS andPERFORM
STATISTICS commands.Thesestatistics aresubject tothesameresetting characteristicsasallCICSstatistics.
For moreinformationontheDSNC DISPSTATcommand,see“DISPLAY STATISTICS output”onpage40.FormoreinformationonthefullCICSDB2 statistics available,seetheCICSPerformanceGuide.
DSNC MODI(modify)
This CICSDB2attachmentcommandcanbeusedto modifywhereunsolicited messages aresentandthenumberofthreadsallowedfora DB2ENTRYorfor thepoolor commandthreads.Thisfunction issupersededbytheCEMT commands describedwhich allowtheseattributestobemodifiedandallother attributesofa DB2CONN,DB2ENTRYor DB2TRAN.Formoreinformation,see “DSNC MODIFY”onpage43.
Entering
DB2
commands
OncetheconnectionbetweenCICSandDB2hasbeenestablished,terminalusers authorizedbyCICScanusetheDSNCtransactionto routecommandsto theDB2 subsystem.Thesecommands aredefinedasfollows:
DSNC -DB2command
Thecommandisroutedto DB2forprocessing.DB2checksthattheuseris authorizedto issuethecommandentered.Responsesareroutedbacktothe originatingCICSuser.Thecommandrecognitioncharacter(CRC) of“-”must be used todistinguishDB2commandsfromCICSDB2attachmentfacilitycommands. This commandrecognition characterisnotusedtoidentify theDB2subsystemto which thecommandistobesent.Thecommandissent totheDB2subsystemto which CICSiscurrently connected.Figure5 showstheCICSDB2attachment facilitycommands.TheserequireCICSauthorizationtousetheDSNCtransaction andtheDB2commands. Formoreinformationabout theDSNC -DB2COMMAND, see “Issuingcommandsto DB2usingDSNC” onpage 34.
Purging
CICS
DB2
transactions
When CICSisconnectedto DB2Version5orearlier,CICSapplicationsthataccess DB2 willentera CICSwait,witharesourcetype of“DB2”andaresource nameof “LOT_ECB”, whiletheywaitfortheCICSDB2taskto accessDB2andcomplete therequest.ACICStask inthis waitcannotbepurged,butforcepurgeissupported. However, thereisariskwhenforcepurginga CICStask inthis state,inthatitcan causetheassociatedCICSDB2 tasktobeterminatedduringa “mustcomplete” activityinDB2,whichwouldcauseterminationof theDB2subsystem.
When CICSisconnectedto DB2Version6orlater, CICSapplicationsthataccess DB2 donotenteraCICSwaitstate,becausetheCICSDB2task-related userexit andtherequestintoDB2runonanL8openTCB.Inthis environment,bothpurge andforcepurgeoftheCICStaskaresupported.However,withbothofthesethere isagainariskof terminatingaDB2requestduringa“mustcomplete”activityin DB2. CICS ATTACHMENT DB2 FACILITY DISP DSNC STRT STRT STOP MODI DIS DSNC DIS REC THREAD(*) STA STO TER CICS DB2
ADDRESS SPACE ADDRESS SPACE
DB2 “mustcomplete”activitiesareshort-lived,buttoavoidthisrisk,a saferwayto terminate aCICSDB2applicationisto usetheDB2CANCELTHREADcommand. If theCICSDB2task isactiveinDB2at thetime,thenthethreadisterminated,and “must complete”activityiseitheravoided,orcompletedbefore termination.Ifthe task isnotactive inDB2at thetime ofthecancel,then thecancel isdeferreduntil DB2 isnext accessedusingthatthread.OncetheDB2CANCELTHREAD
commandhasbeenissued, youcansafelyissueaforcepurgeoftheCICS transaction, ifneeded(becausethetask iscurrentlyactiveinCICSratherthanin DB2).
TodeterminewhichDB2threadisassociatedwitha CICStask,usetheDSNC DISPLAYTRANcommand(see“DSNC DISPLAY”onpage38),whichshowsthe CICStask number,transactionid,andthe12–byte DB2correlationidof the associatedDB2threadused bytheCICSDB2task.Thiscorrelationiduniquely identifiesa thread.ADSNC—DISTHD(*),issues aDB2displaythreadcommand