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

JOURNALING AND COMMITMENT CONTROL

JOURNALING:

The main purpose of journal management is to enable you to recover the changes to a database file that have occurred since the file was last saved.You can also use journal management for:

1) 2) 3) 4) 5)

An Audit trail of actitivtity that occurs for a database file or other objects on the system. Recording activity that has occurred for objects other than database files. Quicker recovery of access paths if your system ends abnormally. Quicker recovery when restoring from save-while-active media. Assistance in testing application programs.

You use a journal to define what files and access paths you want to protect with journal management. you have more than one journal on your system. A journal may define protection for more than one file.

The system keeps a record of changes you make to files that are journal and of other events that occur on the system. These records are called journal entries. They are written to an object called a Journal receiver. Journal receivers are attached to a journal on the create journal (CRTJRN) and change journal (CHGJRN) commands. Journal entries are addes to the attached receivers. Journal receivers that have been attached to a journal and are still to lknown to the system are considered to be associated with that journal. Use the work with journal Attributes (WRKJRNA) command to see a list of receivers associated with the journal. Some journal entries identify acitivity for a specific record (Added , changed , or deleted ) and for a save, open , or close operation for a file. Journal entires can also identify ither events that occur, such as security relevant events on the system or changes made by dynamic performance tunning.

Each journal entry includes additional control information that identifies that source of the activity , including the user , job , program, time , and date. The entiries for changes to database records include the entire image of the databse record, not just the changed information )

The system adds an entry to the attached journal receiver when you change a record in a journal database file member or when an eveny occurs that is journal led. Each entry is sequentially numbered and contains information that identifies. 1) 2) 3) 4) Type of change Records that has been changed Change that has been made to the record. Information about the change (such as the job being run and the time of the change)

When you are jornalling PF and access paths, changed to PF(Whether made directly to the PF ot through a LF) and access paths are added to the journal receiver. The system doesnt journal data that you retrieved but did not change. If the logical file record format does not contain all the field that are in the dependent physical file record format, the journal entry still contains all the fields of the physical file record format. In addition, if you are journaling access paths, entries for those access paths are added to the journal.

STEPS: 1) 2) 3) 4) CRT JRN RCV ( create journal receiver) CRTJRN STRJRNPF (To associate journal with PF) DSPJRN (Press F4 to see the Journal) Parmaters Journal code value R A,B,C,D. Output *Output F10 File to receive Output _abc_____ 5) Runqry *N abc 6) To delete Journal ENDJRNPF F4 COMMITMENT CONTROL Commitment control is a function that allows you to define and process a group of changes to resources , such as database files or tables, as a logical unit of work.

The term logical unit of work (LUW) is used . A Logical unit of work (LUW)is defined as a group of individual changes to objects on the system that a single atomic change to the user. Commitment control ensures that either the entire group of individual changes occur on all systems participating in the LUW or none of the changes occur. An example of changes that can be grouped together is the transfer or funds from a savings to a checking account.To the user, this is a single transaction.However more than one change occurs to the database because both saving and checking accounts are updated. You can use commitment control to design an application so that it can be started again if a job ,an activation group within a job or the system ends abnormally. The application can be started again with assurance that no partial updates are in the database due to incomplete logical units of work from a prior failure. Commitment control is started and ended using the start commitment control (STRCMTCTL) and End Commitment Control (ENDCMTCTL) commands.

Commitment control allows you to: 1) Ensure that all changes within an LUW are completed for all resources affected. 2) Ensure that all changes with an LUW are removed if processing is interrupted. 3) Remove changes made during an LUW when the work station user application determines that an LUW is in error. LUWs can be any of the following : 1) Inquires in which no database file changes occur. 2) Simple transactions in which one database fie is changed each time the Enter key is pressed. 3) Complex transactions in which one or more database files are changed each time the Enter key is pressed. 4) Complex transactions in which each time the enter is pressed one or more database files are changed, but these changes represent only a part of logical group of transactions. 5) Simple or complex transactions that involve databse files at more that one location . The database file can be: On a single remote system On the location system and one or more remote systems. Assigned to more that one journal on the local system .Each journal can be thought of as a local location. 6) Simple or complex transactions on the local system that involve objects other that database files.

Commitment Control Process: 1. STRCMTCTL Command ( The system created a commitment definition or uses an existing one for the job . A commitment boundary is established. 2. Call PGMX 3. Open files F1 and F2 The files become committable resources. The operating system function responsible for changing the files becomes the resource manager. 4. Update file F1 and F2 The changes are called committable changes they are pending. 5. COMMIT The pending commitable changes associated with the commitment deifination are coomitted .A new commitment boundary is established. 6. End PGMX 7. ENDCMTCTL The commitment definition is ended , if it was started by this program.

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