Вы находитесь на странице: 1из 3

Work with ADVANCED DB2

Day 23
ADVANCED DB2:
Overview:
This module enables the student to understand the concept of Advanced DB2.

Outline:
Topics covered,
a. Data Base Constraints
b. Journaling
c. Commitment Control
d. Triggers
Objective:
By the end of this module, the student should be able to
a. !nderstanding concept of Data Base Constraints
b. !nderstanding concept of Journaling
c. !nderstanding concept of Commitment Control
d. !nderstanding concept of Triggers
" Du#e$tar Technologies %vt. &td.
'(3
No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies
Pvt. Ltd.
Work with ADVANCED DB2
Day 23
Commitment Control
To use commitment control, ou !o the "ollowin#:
!se the C& commands C$T%$N$CV )Create Journal *eceiver+ C$T%$N )Create
Journal+ and &T$%$N'( )Journal %hysical ,ile+ to prepare for using commitment
control, and the C& commands &T$CC)TCT* )$tart Commitment Control+ and
ENDC)TCT* )-nd Commitment Control to notify the system .hen you .ant to
start and end commitment control. $ee the C& *eference for information on these
commands.
$pecify commitment control on the /le0description speci/cations of the /les you
.ant under commitment control.
!se the CO)+T )Commit+ 1peration code to apply a group of changes top /les
under commitment control or use the $O*B, )*oll Bac#+ operation code to
eliminate the pending group of changes top /les under commitment control.
&-eci"in# (iles "or Commitment Control
1n the /le0continuation speci/cations enter a 2 in position 33 and the .ord C145T in
positions 36 through 37. 1n the /le description speci/cations described the /le as having
device D5$2 in positions 68 through 69.
:hen a program speci/es commitment control for a /le the speci/cation applies only to
the input and output operations made by this program for this /le commitment control
does not have apply to operations other than input and output operations. 5t does not
apply to /les that do not have commitment control speci/ed in the program doing the
input output operation.
Commitment Control O-er.tions
The C145T )Commit+ operation tells the system that you have completed a group of
changes to the /les under commitment control. The *1&B2 )*oll Bac#+ operation
eliminates the current group of changes to the /les under commitment control.
5f the system fails it implicitly issues *1&B2 operation, ;ou can chec# the identity of last
successfully completed group of changes using the label you specify in factors of the
C145T operation code, and the notify ob<ect you specify on the $T*C4TCT* command.
At the end of routing step, or .hen you issue the -=DC4TTCT& command the 1$(688
system issues an implicit *1&B2. .hich eliminates any changes since the last *1&B2 or
C145T operation that you issued. To ensure that all your /le operations have e>ect issue
a C145T operation before ending a routing step operation under commitment control.
Commitment Control in the 'ro#r.m Ccle
Commitment Control is intended for full procedural /les, .here the input and output is
under your control. Do not use commitment control .ith primary and secondary /les,
.here input and output is under the control of the *%?(688 program cycle. The follo.ing
are some of the reasons for this recommendation.
;ou cannot issue a C145T operation for the last total output in your program.
5t is di@cult to program .ithin the cycle for recovery from a loc#ed record
condition.
&evel indicators are not reset by the *1&B2 operation.
After A *1&B2 operations processing matching records may produce a seAuence
error.
E/.m-le o" 0sin#1Commitment Control
The follo.ing is an eBample of the speci/cations and C& command for a program
operating under commitment control. To prepare for using commitment control you issue
the follo.ing.
" Du#e$tar Technologies %vt. &td.
2(3
No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies
Pvt. Ltd.
Work with ADVANCED DB2
Day 23
C* comm.n!s
C$T%$N$CV %$N$CV 2$ECE+VE$3
The above command creates a <ournal receiver named *-C-5C-*
C$T%$N %$N 2%O0$NA*3 %$N$CV 2$ECE+VE$3
The above command creates a <ournal named J1!*=A& and attaches the <ournal
receiver named *-C-5C-*.
&T$%$N'( (+*E 2)A&TE$3 %$N 2%O0$NA*3
The above command directs <ournal entries for the /les 4A$T-* to the J1!*=A&.
5n your program you specify C145T for the /le 4A$T-*.
()A&TE$ 0( E , D+&, ,CO)+T
5n the calculation speci/cations, use the C145T operation to complete a group of
operations.
,E4 C5A+N)A&TE$ 67
N67 0'DAT$ECO$D 88
N88 CO)+T
5f an operation .ithin a group fails, use the *1&-* operation to eliminate the
entire group o foperations.
88 $O*B,
E/.m-le o" 0sin# Commitment Control
To operate your program )named *-C5$-+ under commitment control you issue
the commands
&T$C)TCT**C,*V*29A**3
The above command starts commitment control .ith the higher level of loc#ing
CA** $EV+&E
The above command calls your program )named *-C5$-+.
ENDC)TCT*
The above command ends commitment control and causes implicit *oll Bac#
operation.
" Du#e$tar Technologies %vt. &td.
3(3
No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies
Pvt. Ltd.

Вам также может понравиться