Docstoc

69

Document Sample
69 Powered By Docstoc
					Chapter 14


DMJ
Journal Processor




                    DMJ Journal Processor  539
                DMJ
Purpose:

                The DMJ utility can be used to
                      back out journal images from a database
                      replay journal images against a database
                      reset a journal file
                      list the monitor statistics stored in a journal file
                      list the sync points in a journal file.

                To back out or replay journal images or reset journal files, you must have DBA privilege
                for the specified database. For additional information about database recovery, see
                “Recovery.”

Operating Systems:

                All.

Syntax:

                Windows, UNIX, VMS

                DMJ UID=id UPW=pw DB=database
                      {ACTION=BACKOUT | REPLAY | RESET | STATISTICS | SYNCLIST}
                      {JOURNALs=jfl}
                      {DATE=date}
                      {ENDDATE=date}
                      {ENDTIME=time}
                      {INPUT=infile}
                      {OUTPUT=outfile}
                      {STATFILE=statfile}
                      {SUMMARY=NO | YES}
                      {TIME=time}
                      {VERSION=0:99}
                      {VF=vocfile}

Parameters:

                For instructions about entering parameters on various operating systems, see Tables 1-1
                and 11-1.


540  DMJ Journal Processor
             You can use the DMJ utility to perform several tasks which you specify through the
             ACTION parameter. The action you specify determines which additional DMJ
             parameters you must or may use. No matter which action you select, there is one
             parameter in addition to ACTION that you must specify—JOURNALS—and five that
             you may specify—DATE, INPUT, OUTPUT, TIME, and VF. All other DMJ parameters
             are linked to specific actions. The following table summarizes these dependencies and
             conditions:

             Table 14-1: DMJ actions and parameters


              If you specify   You must also use these      You may also use these
              ACTION=          parameters (Required)        parameters (Optional)

              (any action)     JOURNALS                     DATE, INPUT, OUTPUT,
                                                            TIME, VF

              BACKOUT          DB, UID, UPW                 SUMMARY, VERSION

              REPLAY           DB, UID, UPW                 ENDDATE, ENDTIME,
                                                            SUMMARY, VERSION

              RESET            DB, UID, UPW                 VERSION

              STATISTICS       DB, UID, UPW                 STATFILE

              SYNCLIST                                      DB, UID, UPW


Required Parameters:

             Two of the following parameters—ACTION and JOURNALS—must be specified no
             matter which action of DMJ you wish to use. The other parameters—DB, UID, and
             UPW—are required for ACTION=BACKOUT, REPLAY, RESET, and STATISTICS
             but optional for ACTION=SYNCLIST, as indicated. The parameters are listed
             alphabetically.

             ACTION=BACKOUT | REPLAY | RESET | STATISTICS | SYNCLIST                     (Required)

             The ACTION parameter indicates what task the DMJ utility is to be used for: backing
             out journal images, replaying journal images, etc.




                                                                       DMJ Journal Processor  541
                 BACKOUT      BACKOUT starts with the most recent data and backs out
                              journal images up to a specified date and time.

                              The backout procedure reads back to the synchronization
                              point (a point in time at which no transactions are in progress)
                              nearest to and less than the specified DATE and TIME. If you
                              do not specify a DATE and TIME, the backout procedure
                              reads back to the first synchronization point in the oldest
                              journal. BACKOUT locates end transaction entries and saves
                              the System Transaction Number (STN) and final status.

                              As before image entries are located, they are reversed if the
                              associated transaction was committed. For a backout action to
                              be performed, a journal file must have been defined to contain
                              before images. BACKOUT requires exclusive access to the
                              database and may be performed on a deactivated database.

                 REPLAY       REPLAY reads the journal files from a specified time and
                              applies the committed transactions in sequence. REPLAY
                              first finds the synchronization point nearest to and less than or
                              equal to the specified DATE and TIME, then REPLAY reads
                              forward. If you do not specify the DATE and TIME,
                              REPLAY begins at the first sync point in the oldest journal
                              file. As DMJ finds start transaction entries, it saves the
                              System Transaction Number (STN) and final status. (Up to
                              512 transactions could be active at one time.) If the
                              associated transaction was committed, the after image entries
                              are re-applied.

                              If you specify ENDDATE and ENDTIME, REPLAY
                              continues to the synchronization point nearest to and greater
                              than or equal to the specified ENDTIME. If you do not
                              specify ENDDATE and ENDTIME, REPLAY continues to
                              the last synchronization point in the newest journal. With
                              ENDDATE and ENDTIME, you can perform a “backout” by
                              restoring a saved version of the database and replaying up to
                              the program failure.

                              REPLAY helps you restore a database after a media failure.
                              REPLAY requires exclusive access to the database and may
                              be performed on a deactivated database.




542  DMJ Journal Processor
 RESET                 Resets a journal file to the empty condition after it has been
                       successfully backed up using a host system backup utility.
                       After you back up your journals, you can either use this
                       RESET action to reset your journals or you can delete the old
                       journals and run DMDBA to create new ones. If your journal
                       files fill up, the database is inaccessible until they are reset.
                       Do not reset an empty journal. An empty journal is not
                       modified if it is reset. Only journal files can be reset; you
                       cannot use the RESET action to reset data files.

 STATISTICS            STATISTICS lists the information about database usage
                       gathered in the journal files. For this action to work, you must
                       have had monitoring turned on as the journals for the database
                       were being created, and the DB parameter value must be the
                       name of a Record Database. If you specify DATE and TIME
                       parameters, statistics are listed starting at the time specified to
                       the end. By default, all statistics are displayed. For a
                       description of the statistical information, see the “Statistics
                       Listing File” section below.

 SYNCLIST              SYNCLIST lists the synchronization points in the journal
                       files. Use synchronization points when you are trying to
                       determine the time to replay from or backout to. If you
                       specify DATE and TIME parameters, synchronization points
                       are listed from the time specified to the last synchronization
                       point written. By default, all synchronization points are listed.

DB=database
              (For ACTION=BACKOUT, REPLAY, RESET or STATISTICS, Required)
                                                 (For SYNCLIST, Optional)

See Table 11-2.




                                                           DMJ Journal Processor  543
                JOURNALs=jfl                                                                      (Required)

                A list of journal files to be processed.

                For ACTION=BACKOUT, REPLAY, STATISTICS, or SYNCLIST:
                  jfl       :=     jf | (jf{,jf}0:100) | @fd

                  jf        :=     fd

                  fd        :=     file_descriptor

                For ACTION=RESET:
                  jfl       :=     NONE | * | ALL | jf | (jf{,jf}0:6)

                  jf        :=     A | B | ACOPY | BCOPY | ADDB | BDDB

                The order of the list of journal files is not important; DMJ always processes the journals
                in the right sequence. For BACKOUT, REPLAY, STATISTICS, or SYNCLIST you can
                use the form @fd to specify a file containing journal file descriptors listed one per line. A
                maximum of 100 files can be listed. If the list is greater than 4096 characters, you must
                list the journal file descriptors in a file.

                For the BACKOUT and REPLAY actions, DMJ must have exclusive access to each
                journal file. For RESET, DMJ must have exclusive access to journals for Thesaurus and
                XDDB (definition) databases.

                UID=id        (For ACTION=BACKOUT, REPLAY, RESET, or STATISTICS, Required)
                                                                  (For SYNCLIST, Optional)

                See Table 11-2.

                UPW=pw        (For ACTION=BACKOUT, REPLAY, RESET, or STATISTICS, Required)
                                                                  (For SYNCLIST, Optional)

                See Table 11-2.




544  DMJ Journal Processor
Optional Parameters:

              Five of the following parameters—DATE, INPUT, OUTPUT, TIME, and VF—may be
              specified no matter which action you select. The remaining optional parameters may be
              used only with specific actions, as indicated. Three of these parameters—DB, UID and
              UPW—are optional for ACTION=SYNCLIST but required for ACTION=BACKOUT,
              REPLAY, and STATISTICS, as indicated. The parameters are listed alphabetically.

              DATE=date                                                                     (Optional)

              A date in standard date format. For information about date formats, see Database
              Definition and Development. If the date contains commas, spaces, or slashes, it must be
              enclosed in single quotation marks. See descriptions of each ACTION to learn how this
              date is used. When you specify DATE, you must also specify TIME.

              DB=database                                   (For ACTION=SYNCLIST, Optional)
                                       (Required for BACKOUT, REPLAY, and STATISTICS action)

              See Table 11-2.

              ENDDATE=date                                    (For ACTION=REPLAY only, Optional)

              A date in standard date format. For information about date formats, see Database
              Definition and Development. If the date contains commas, spaces, or slashes, it must be
              enclosed in single quotation marks. See the description of ACTION=REPLAY above to
              learn how this date is used. When you specify ENDDATE, you must also specify
              ENDTIME.

              ENDTIME=time                                    (For ACTION=REPLAY only, Optional)

              A time in the HHMMSS format where HH is the hour in military time, MM is the minute,
              and SS is the second. See the description of ACTION=REPLAY above to learn how this
              time is used. When you specify ENDTIME, you must also specify ENDDATE.

              INPUT=infile                                                                  (Optional)

              See Tables 11-2 and 11-3.

              OUTPUT=outfile                                                                (Optional)

              See Tables 11-2 and 11-3.




                                                                         DMJ Journal Processor  545
                STATFILE=statfile                               (For ACTION=STATISTICS only, Optional)

                Statistics listing file. See below for a description of the statistics file layout.



                         For . . .      the default is . . .

                         NT             dmj.sta

                         UNIX           dmj.sta

                         VMS            DMJ.STA;0

                SUMMARY=NO | YES                     (For ACTION=BACKOUT or REPLAY only, Optional)

                Determines whether a summary listing of elapsed time, CPU time, and images processed
                is generated. The default is NO.

                TIME=time                                                                             (Optional)

                A time in the HHMMSS format where HH is the hour in military time, MM is the minute,
                and SS is the second. See descriptions of each ACTION to learn how the time is used.
                When you specify TIME, you must also specify DATE.

                UID=id                                          (For ACTION=SYNCLIST, Optional)
                                     (Required for BACKOUT, REPLAY, RESET and STATISTICS action)

                See Table 11-2.

                UPW=pw                                          (For ACTION=SYNCLIST, Optional)
                                     (Required for BACKOUT, REPLAY, RESET and STATISTICS action)

                See Table 11-2.

                VERSION=0:99              (For ACTION=BACKOUT, REPLAY or RESET only, Optional)

                See Table 11-2.

                VF=vocfile                                                                            (Optional)

                See Tables 11-2 and 11-3.




546  DMJ Journal Processor
Description:

               Statistics Listing File

               The database journal collects statistics on database use. Using DMJ, you can extract the
               monitored entries from the journal and write them to a standard sequential file for
               processing by a programmer-written program.

               Collecting these statistics is a DMDBA Administrative Task. The task that controls
               journal usage also lets you select whether the monitor should be on or off. Each time the
               Kernel reopens a database, it performs monitoring based on your last selection.

               Monitor records are fixed size 273-character records. Character fields are blank filled
               and left justified. Numeric fields are zero filled and right justified. The monitor entries
               contain the following fields:


                Columns          Type         Contents

                2:9              Number       Start Timestamp Date as YYYYMMDD

                11:16            Number       Start Timestamp Time as HHMMSS

                18:29            Number       Elapsed Time in Ticks (1/10000 of a second)

                                                  0 for finish and abort.

                31:33            Number       Verb Code number

                                              Only the following verbs are included in the

                                              monitor statistics:




                                                                             DMJ Journal Processor  547
                              Verb   BASIS Verb
                              Code

                              1      START

                              2      FINISH

                              3      ABORT

                              6      OPEN

                              7      CLOSE

                              9      ADD

                              10     ASSIGN/FIELD field_ref

                              11     DELETE/FIELD full_field_ref

                              12     DELETE/VIEW

                              13     GET

                              14     OBTAIN by value

                              15     OBTAIN by position

                              16     PUT

                              17     REPLACE

                              18     LOOK

                              22     FIND

                              23     HOLD

                              24     UNHOLD




548  DMJ Journal Processor
Columns   Type        Contents

44:51     Character   Program Name

53:60     Hex         Process ID
          Number

62:69     Number      DM status code

71:78     Hex         Local Transaction Status ID
          Number

80        Character   Wait parameter

                          Y or N

82        Character   Did the user encounter a locked resource?

                          Y or N

84        Character   Did the user fail a privacy test?

                          Y or N

86:87     Character   Position Code (LOOK and OBTAIN by position).


                      Code          Translation

                      blank         not applicable

                      F             FIRST

                      L             LAST

                      N             NEXT

                      P             PRIOR

                      ND            NEXT_DIFFERENT

                      PD            PRIOR_DIFFERENT




                                                     DMJ Journal Processor  549
                 89               Character Reference Code (PUT, REPLACE, DELETE/VIEW,
                                  ASSIGN, DELETE/FIELD, HOLD, UNHOLD, GET)

                                             Code         Translation

                                             blank        not applicable

                                             M            [set,member]

                                             O            [@obtain_cursor]

                                             I            [field=integer_value]

                                             R            [field=real_value]

                                             D            [field=double_value]

                                             C            [field=character_value]

                                             N            [field=numeric_value]

                                             L            [field=logical_value]

                                             H            [field=halfword_integer_value]

                                             Q            [field=quadword_real_value]

                                             X            [field=complex_real_value]

                                             Y            [field=complex_double_value]

                 91:93        Character      Intent Code. Many of these codes are transient or have
                                             not been implemented and might not appear in the
                                             statistics file.




550  DMJ Journal Processor
Code    Common   Translation

blank   *        not applicable

SR      *        Shared Read

SW      *        Shared Write

PW      *        Protected Write

EX      *        Exclusive

REM              Remote

CUR     *        Current

ONE     *        Once (out of transaction read)

REP              Replace

RDD              Read DDB

PR      *        Protected Read (START only)

F1               FIND one

F2               FIND two

DEL              Delete

MAK              Make

QON     *        Queue Read (out of transaction)

QRD     *        Queue Read

EXO     *        Exclusive Open

UH               Unhold

LDD              Read and Lock DDB

RDO     *        Redo (DMJ only)




                          DMJ Journal Processor  551
               95:104         Number           Number of Members in Result Set produced by FIND.

               106:113        Number           Virtual (Logical) I/O Count; 0 for finish and abort.

               115:122        Number           Actual (Physical) I/O Count; 0 for finish and abort.

               124:132        Number           Command Sequence Number Starts at 1. Increment for
                                               each new command. Some commands have multiple
                                               records.

               134:141        Character        Model Name. Blank if not applicable. Filled with
                                               question marks if the model no longer exists.

               143:174        Character        View Name. Blank if not applicable. Filled with
                                               question marks if the view no longer exists.

               176:207        Character        Record Name. Blank if not applicable. Filled with
                                               question marks if the record no longer exists.

               209:240        Character        ADM Field Name. Blank if not applicable. Filled with
                                               question marks if the field no longer exists.

               242:273        Character        User ID


Key Points:
                1.   Many errors are trapped in the User Program Interface (UPI), and the requests never
                     make it to the Kernel. Monitor entries are not written to the journal for these errors.
                2.   DMJ produces a statistics record for every view definition and field referenced by
                     FIND and START commands. All other verbs produce only one statistics record.
                     The Command Sequence Number field lets you determine which statistics records are
                     the result of the same request. Columns 1:114 (except for elapsed time in ticks) and
                     the Command Sequence Number field are identical for statistics records produced for
                     the same request. Always use the Command Sequence Number as the most minor
                     key when sorting the statistics records. Elapsed time in ticks, virtual I/O count,
                     actual I/O count, and result set members are set only for the first record for START
                     and FIND commands (they are zero for the remaining records).




552  DMJ Journal Processor
3.   The START command sets protected read locks on owner records whenever a
     member record is specified on the START intent list. For example, if
     RECA.FIELDA owns RECB.FIELDB and START SHARED=RECB is executed,
     two output records would be produced with the same Command Sequence Number.
     One record would contain RECB with an intent code of SW. The other record would
     contain RECA with an intent code of PR. The model and view names would be
     identical.
4.   You can write a user program to evaluate the data and calculate usage statistics such
     as:


      - Rejects on locks by record definition and by user id

      - Number of gets on members of a result set (by user id)

      - Number of reads, writes, and deletes by record definition, by time of day, by
        program, and by user id

      - Logical I/O to physical I/O access ratio by record type

      - Field usage patterns (non-indexed fields used in FIND commands)

      - Lock conflict frequency and duration

      - Frequency of use of models, records, views, and indexes

      - Frequency of use of each command

5.   DMJ ACTION=RESET can be used to reset Thesaurus journals. Thesaurus
     databases have only ADDB and BDDB journal files.
6.   Any journal files can be reset while the database is deactiviated.




                                                               DMJ Journal Processor  553
                7.   For actions BACKOUT and REPLAY, DMJ warns you when a given journal file is
                     apparently the wrong one in relation to the state of the database. DMJ makes its
                     decision about the journal file based on the comparison of these two items:

                     1. last-update timestamp of the database
                     2. timestamp of the sync point in the journal where the action is to begin

                      For BACKOUT the following warning message is displayed when the journal file is
                     deemed to be the wrong one:

                     The BACKOUT is to commence with updates that ended            at YYYYMMDD HHMMSS
                     but the database was last updated before then --              at YYYYMMDD HHMMSS
                     which means you are likely using the wrong journal            or database back-up.
                     Continuing may cause DMJ to either fail or produce            undesired results.
                     Do you want the BACKOUT to continue? (Yes or No) >

                     For REPLAY the following similar message is displayed:

                     The REPLAY is to commence with updates that started at YYYYMMDD HHMMSS
                     however, the database was last updated after then - at YYYYMMDD HHMMSS
                     which means you are likely using the wrong journal or database back-up.
                     Continuing may cause DMJ to either fail or produce undesired results.
                     Do you want the REPLAY to continue? (Yes or No) >

                     Note YYYYMMDD HHMMSS represents a timestamp where YYYYMMDD is the date and
                     HHMMSS is the time.

                     If you respond no to the warning message, DMJ terminates normally without
                     performing the action. If yes, DMJ goes ahead with the action because yes is valid in
                     unusual cases, e.g., when a journal file is transported from one database to another.

                     When DMJ is run in a batch job, i.e., when no human can respond to the query about
                     incompatible timestamps, the query does not cause DMJ to stop. Rather, DMJ
                     continues as if the reply were yes. Thus, automated DMJ procedures are not affected
                     by such a warning message.




554  DMJ Journal Processor
Examples:
            1.   Run DMJ, using the default parameters, to get a list of synchronization points for
                 Journal A of your Record Database.
                 DMJ
                                     . . .
                 ACTION > SYNC
                 JOURNALs > $BASIS_DB/dm_tour/rja

                 The output file contains the following list of synchronization points, points in time
                 when no transactions were taking place in the TOUR database. However, someone
                 could be using TOUR without transactions being in progress.
                 $BASIS_DB/dm_tour/rja

                 21-Mar-1989 06:58:37
                 21-Mar-1989 07:01:29
                 21-Mar-1989 07:05:08
                 21-Mar-1989 07:13:12
                 21-Mar-1989 07:14:43
                 21-Mar-1989 07:25:30
                 21-Mar-1989 12:49:24
                 21-Mar-1989 12:55:53
                 21-Mar-1989 18:59:06
                 21-Mar-1989 19:00:48
                 21-Mar-1989 19:01:15
                 NORMAL TERMINATION - DMJ
            2.   Suppose at 2:00 P.M., on March 21, a user ran a transaction which incorrectly
                 updated hundreds of records, which were later updated further. You need to backout
                 all changes made by the first user and subsequent users. First, get a listing of the
                 sync points occurring from noon forward on that day.
                 DMJ ACTION=SYNCLIST JOURNALS=$BASIS_DB/dm_tour/rja +
                    DATE=19920321 TIME=120000
                                     . . .
                 $BASIS_DB/dm_tour/rja

                 21-Mar-1989 12:49:24
                 21-Mar-1989 12:55:53
                 21-Mar-1989 18:59:06
                 21-Mar-1989 19:00:48
                 21-Mar-1989 19:01:15
                 NORMAL TERMINATION - DMJ

                 Since there was no sync point between 1:00 p.m. and 6:00 p.m., you can back out
                 changes to 140000 and DMJ will back out to the nearest sync point before 2:00 p.m.
                 This can be done only if your journal files are defined with
                 SAVE_BEFORE_IMAGE=YES.
                 DMJ ACTION=BACKOUT JOURNALS=$BASIS_DB/dm_tour/rja +



                                                                          DMJ Journal Processor  555
                        DATE=19920321 TIME=140000 DB=TOUR UID=id UPW=pw +
                        SUMMARY=YES
                                         . . .
                     All committed images up to the synchronization point at 21-Mar-
                     1992 12:55:53 were backed out from the database.

                     ELAPSED SECONDS:    59.535
                     CPU SECONDS:         1.120
                     IMAGES BACKED OUT    43
                     NORMAL TERMINATION - DMJ

                     If you do not have your journal files defined with SAVE_BEFORE_IMAGES=YES,
                     you need to restore the most recent backup of your RDB and REPLAY the journals
                     up to the sync point at 12:55:53. To do this, you could enter:
                     DMJ ACTION=REPLAY JOURNALS=$BASIS_DB/dm_tour/rja +
                        ENDDATE=19920321 ENDTIME=125000 DB=TOUR UID=id UPW=pw +
                        SUMMARY=YES

                3.   The current copy of your RDB has been damaged. There are two journal files which
                     contain the changes made since your last backup. Restore the backup RDB and these
                     journal files. Replay all the journal files.

                     A file named jf.lst contains the names of the two journal files:
                     $BASIS_DB/dm_tour/rja
                     $BASIS_DB/dm_tour/rjb

                     The following command reads the list of files in the jf.lst file and replays those
                     journals:
                     DMJ ACTION=REPLAY JOURNALS=@jf.lst UID=id UPW=pw DB=TOUR
                                         . . .
                     All committed images up to the end of file
                     $BASIS_DB/dm_tour/rjb
                     were replayed against the database.

                     NORMAL TERMINATION - DMJ
                4.   List the monitor statistics contained in a journal file if monitoring has been activated
                     for the database.
                     DMJ ACTION=STAT JOURNALS=$BASIS_DB/dm_tour/rja +
                        UID=id UPW=pw DB=TOUR
                                         . . .
                     NORMAL TERMINATION - DMJ




556  DMJ Journal Processor
The output from the statistics file follows:
 19890424 072346 000000011300 006         DMFQM    26A00414 00000000
00000000 Y N N      SW 0000000000 00000141 00000018 000000001 ALL

                               USERA
 19890424 072411 000000005000 001          DMFQM    26A00414 00000000
10100046 N N N      SW 0000000000 00000009 00000004 000000002 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072411 000000000000 001          DMFQM    26A00414 00000000
10100046 N N N      SR 0000000000 00000000 00000000 000000002 ALL
  EMPLOYEE                         DEPARTMENT
                               USERA
 19890424 072423 000000033400 022          DMFQM    26A00414 00000000
10100046 Y N N      CUR 0000000010 00000016 00000010 000000003 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072423 000000000000 022          DMFQM    26A00414 00000000
10100046 Y N N      CUR 0000000000 00000000 00000000 000000003
  EMPLOYEE                         DNO
                               USERA
19890424 072432 000000004200 013           DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000004 00000000 000000004 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072432 000000009100 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000000 000000005 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072432 000000010100 013          DMFQM    26A00414 00000000
10100046 N N N M    SR 0000000000 00000003 00000001 000000006 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000000800 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000001 000000007 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000001300 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000000 000000008 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000002100 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000001 000000009 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000002700 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000000 000000010 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000003700 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000001 000000011 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000004700 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000001 000000012 ALL
  EMPLOYEE                         EMPLOYEE
                               USERA
 19890424 072433 000000005200 013          DMFQM    26A00414 00000000
10100046 N N N    M SR 0000000000 00000003 00000000 000000013 ALL
  EMPLOYEE                         EMPLOYEE




                                               DMJ Journal Processor  557
                                                   USERA
                     19890424 072440 000000000000 002          DMFQM    26A00414 00000000
                    10100046 N N N          0000000000 00000000 00000000 000000014

                                                   USERA
                     19890424 072446 000000000200 007          DMFQM    26A00414 00000000
                    00000000 N N N          0000000000 00000001 00000000 000000015 ALL

                                                             USERA


                    The statistics file was listed with a terminal width of 70. Every 4 lines corresponds to
                    one statistics record. The records above correspond to the following FQM session by
                    USERA:
                    OPEN/DB TOUR.ALL
                    START SHARED=EMPLOYEE
                    FIND EMPLOYEE WHERE DNO=101
                    TYPE *
                    FINISH
                    CLOSE/DB TOUR.ALL

                    Notice that there are two records for the START command: one for the EMPLOYEE
                    record, the other for the DEPARTMENT record because it is an owner of the
                    EMPLOYEE record. The FIND command also consists of two records: one for the
                    view selection of EMPLOYEE and the other for the field specification of DNO.

                    Note that values for statfile and outfile vary among operating systems:



                     For . . .             the statfile is . . .     the outfile is . . .

                     NT                    dmj.sta                   $STDOUT

                     UNIX                  dmj.sta                   $STDOUT

                     VMS                   DMJ.STA;0                 SYS$OUTPUT




558  DMJ Journal Processor
UNIX, VMS

   A report directives file using the Report Writer module to print out the user id,
   command, time and date follows (the Report Writer module is not applicable to the
   Windows operating system):
   *
   * Data is in statfile
   *
   DATA_FILE FD='statfile',RECORDTYPE='FIX',+
      CARRIAGE='NO',RECORDLC=240,+
      GET($T2,RDATE:I8,$T11,RTIME:I6,$T31,VCODE:I3,$T35,+
      UID:C8,$T124,COMSEQ:I9)
   *
   * Output to terminal
   *
   LISTING_FILE FD='outfile'
   *
   * Set page for terminal
   *
   PAGE LINES=50,COLUMNS=80
   *
   *   Specify the page heading
   *
   PAGE_HEADING LINE=1 +
      PUT($S2,'Statistic File Listing':<80>,+
      $B,$T33,$YYYYMMDD:<20/DATE1>,+
      $S2,'User ID',$T20,'Verb',$T40,'Date',+
      $T60,'Time',$B,'-------',$T20,'----',$T40,+
      '----',$T60,'----')
   *
   * Detail Line
   *
   STAT: DETAIL IF (PRVSEQ NE COMSEQ)
      PUT(UID:<8<,$T20,VERB(VCODE):<15<,$T40,
      $DATE(RDATE):<15<,$T60,RTIME:<6<)
   *
   DECLARE VERB(24) CHAR(15),+
   INIT('START','FINISH','ABORT',' ','+
      ','OPEN','CLOSE',' ','ADD',+
      'ASSIGN','DELETE/FIELD','DELETE/VIEW','GET',+
      'OBTAIN/VALUE','OBTAIN/POSITION','PUT',+
      'REPLACE','LOOK',' ',' ',' ','FIND',+
      'HOLD','UNHOLD')
   DECLARE PRVSEQ INTEGER,INIT(0)
   *
   * Set values
   *
   SET AFTER ALL DETAILS PRVSEQ=COMSEQ




                                                         DMJ Journal Processor  559
                      The output from RW looks like this:
                      Statistic File Listing
                      May 01, 1989
                      User ID      Verb            Date             Time
                      USERA        OPEN            Apr 24,   1989   72346
                      USERA        START           Apr 24,   1989   72411
                      USERA        FIND            Apr 24,   1989   72423
                      USERA        GET             Apr 24,   1989   72432
                      USERA        GET             Apr 24,   1989   72432
                      USERA        GET             Apr 24,   1989   72432
                      USERA        GET             Apr 24,   1989   72433
                      USERA        GET             Apr 24,   1989   72433
                      USERA        GET             Apr 24,   1989   72433
                      USERA        GET             Apr 24,   1989   72433
                      USERA        GET             Apr 24,   1989   72433
                      USERA        GET             Apr 24,   1989   72433
                      USERA        GET             Apr 24,   1989   72433
                      USERA        FINISH          Apr 24,   1989   72440
                      USERA        CLOSE           Apr 24,   1989   72446

                All

                5.    Reset journal file A.
                      DMJ ACTION=RESET UID=id UPW=pw DB=TOUR JOURNALS=A
                      Journal A reset.
                      NORMAL TERMINATION – DMJ




560  DMJ Journal Processor

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:7
posted:6/12/2011
language:English
pages:22