Vous êtes sur la page 1sur 14

Overview of

I.T.TRAININGS

CICS and DB2


Interface

Course designed and Conducted


by
Sunderrajan Iyer
sunderrajan@vsnl.net

Jul 17, 2009 Overview of CICS and DB2 1


Interface
CICS attachment facility
• A CICS attachment facility is provided with CICS
that allows you to operate DB2 with CICS.
– The connection between CICS and DB2 can be created or
terminated at any time, and CICS and DB2 can be started
I.T.TRAININGS

and stopped independently.


– You also have the option of CICS automatically
connecting and reconnecting to DB2.
– The DB2 system can be shared by several CICS systems
• But each CICS system can be connected to only one DB2
subsystem at any one time.

Jul 17, 2009 Overview of CICS and DB2 2


Interface
Attachment Commands
• Attachment commands display and control the
status of the attachment facility and are issued
using the supplied CICS transaction DSNC.
DSNC
• The attachment commands are:
I.T.TRAININGS

– STRT - start the connection to DB2


– STOP - stop the connection to DB2
– DISP - display the status of the connection to DB2
– MODI - modify characteristics of the connection to DB2
– DISC - disconnect threads

Jul 17, 2009 Overview of CICS and DB2 3


Interface
More on Attachment Facility
• The CICS DB2 attachment facility provides a
multithread connection to DB2
– There is a thread for each active CICS transaction
accessing DB2
I.T.TRAININGS

– Threads allow each CICS application transaction and DB2


command to access DB2 resources
• Application Plan
– Each thread, used by a CICS transaction, or by a command,
runs under its own subtask task control block (TCB).
– A thread is defined based on the specifications in RDO when a
transaction issues the first SQL statement
– If a existing thread is available, it is used before creating a new
thread

Jul 17, 2009 Overview of CICS and DB2 4


Interface
Types of Threads
• Command Threads
– These are reserved to be used by the DSNC transaction
• Entry Threads
I.T.TRAININGS

– They are intended to be used by transactions


• If defined as protected, they are not terminated when no
CICS transaction is using them
• If defined as unprotected, they are terminated if no CICS
transaction is using them
• Pool Threads
– They are used for all transactions not using Entry or
Command thread
– They are intended for low volume transactions, and as a
overflow from command and entry threads

Jul 17, 2009 Overview of CICS and DB2 5


Interface
How CICS interacts with DB2
• The CICS DB2 attachment facility provides CICS
applications to access DB2 database while
operating in the CICS environment
– The application can access both CICS and DB2 data at the
I.T.TRAININGS

same time
• CICS co-ordinates recovery of both DB2 and CICS
data when a failure occurs

Jul 17, 2009 Overview of CICS and DB2 6


Interface
How CICS interacts with DB2
I.T.TRAININGS

Jul 17, 2009 Overview of CICS and DB2 7


Interface
Address Spaces in DB2
• DSN1MSTR: System Service Component
• DSN1DBM1: Database Service Component
• DSN1DIST : Distributed Service Component
I.T.TRAININGS

• IRLMPROC : Resource Lock Manager


• DSN1SPAC: For DB2 stored procedures

Jul 17, 2009 Overview of CICS and DB2 8


Interface
How a CICS Task works with DB2
• When an application program issues its first SQL
request the CICS resource manager interface (RMI)
processes the request and passes control to the
attachment facility's task related user exit (TRUE).
I.T.TRAININGS

• A transaction thread is scheduled by the CICS


attachment facility, and at this stage DB2 checks
authorization, creates control blocks and allocates
the application plan.
• When the SQL request completes DB2 passes data
back to the CICS attachment facility, and the CICS
task regains control until the CICS transaction
issues another SQL request.
• Finally, the CICS attachment facility returns control
to the CICS application program.

Jul 17, 2009 Overview of CICS and DB2 9


Interface
How a CICS Task works with DB2
I.T.TRAININGS

Jul 17, 2009 Overview of CICS and DB2 10


Interface
Resource Control Table
• In releases of CICS prior to Transaction Server for
OS/390 V1 R2, the connection between CICS and
DB2 was done using resource control table
• The resource control table contains relationship
I.T.TRAININGS

between CICS transactions and the resources it


requires
– Application Plans
• It is generated using DSNCRCT macro provided by
CICS attachment facility

Jul 17, 2009 Overview of CICS and DB2 11


Interface
Resource Definition Online
• CICS TS R3, no longer supports RCT entries
defined using DSNCRCT macro
• You have to use Resource Definition Online facility
of CICS TS R3
I.T.TRAININGS

• Using RDO following objects can be created


– DB2CONN: Defines the global attributes of the CICS DB2
interface and defines the attributes of pool threads and
command threads
– DB2ENTRY: Defines entry threads to be used by a specific
transaction or group of transactions
– DB2TRAN: Defines additional transactions to be
associated with a particular DB2ENTRY

Jul 17, 2009 Overview of CICS and DB2 12


Interface
Main activities in SQL processing
• You should select the thread type to use for a
given set of transactions together with the BIND
parameters for the corresponding plan.
• This is because the BIND parameters determine
I.T.TRAININGS

whether a number of activities are related to the


thread or to the transactions.
• The main DB2 activities involved in processing
CICS transactions with SQL calls are
– Create a thread or reuse an existing thread.
– Process the SQL statements.
– Perform commit processing.
– Terminate the thread or keep it.

Jul 17, 2009 Overview of CICS and DB2 13


Interface
Main activities in SQL processing
• These main activities are performed for each
transaction.
• The most important options are:
I.T.TRAININGS

– DB2CONN and DB2ENTRY specifications


• Use of protected entry threads
• Use of unprotected entry or pool threads
• Authorization strategy
– BIND options
• ACQUIRE
• RELEASE
• VALIDATE
– Use of PACKAGES

Jul 17, 2009 Overview of CICS and DB2 14


Interface

Vous aimerez peut-être aussi