Skip to main content

Display Journal Records Using ^JRNDUMP

Display Journal Records Using ^JRNDUMP

To display the records in the journal file, enter 5 at the Option prompt of the ^JOURNAL menu or run ^JRNDUMP as shown in the following example:

  1. Run the ^JRNDUMP utility from the system manager namespace by entering:

    %SYS>DO ^JRNDUMP
    
       Journal                 Directory & prefix
     
       20231113.001            C:\MyIRIS\Mgr\Journal\
       20231113.002 [JRNSTART] C:\MyIRIS\mgr\journal\
       20231113.003            C:\MyIRIS\mgr\journal\
       20231113.004            C:\MyIRIS\mgr\journal\
       20231114.001            C:\MyIRIS\mgr\journal\
       20231115.001            C:\MyIRIS\mgr\journal\
       20231115.002            C:\MyIRIS\mgr\journal\
       20231115.003            C:\MyIRIS\mgr\journal\
    >  20231115.004            C:\MyIRIS\mgr\journal\
     
    
    
  2. The routine displays a list of journal files. A greater-than sign (>) appears to the left of the currently selected file followed by a prompt:

    Pg(D)n,Pg(U)p,(N)ext,(P)rev,(G)oto,(E)xamine,(Q)uit =>
    
    

    Use these options to navigate to the journal file you wish to locate:

    • If the instance is a mirror member, enter M to limit the list to mirror journal files only. (For information about mirror journal files, see Journal Files and Journal History Log and Mirror Synchronization.)

    • Enter D or U to page through the list of journal files.

    • Enter N or P to move the > to the desired journal file.

    • Enter G to directly enter the full pathname of the journal file to display.

    • Enter E to display the contents of the selected journal file.

    • Enter I to display information about the selected journal file and, optionally, a list of databases from the journal.

    • Enter Q or <Enter> to quit the routine.

  3. When you enter I, when you accept the currently selected journal file or specify a different one, information like the following is displayed:

    Journal: C:\MyIRIS\mgr\journal\20231113.003
    File GUID: 97734819-CA75-4CB1-9C3E-74D294784D23
    Max Size: 1073741824
    Time Created: 2023-11-13 10:44:52
    File Count: 22
    Min Trans: 22,3497948
    Prev File: C:\MyIRIS\mgr\journal\20231113.002
    Prev File GUID: 8C5D3476-F12C-4258-BF6C-7423876653A4
    Prev File End: 0
    Next File: C:\MyIRIS\mgr\journal\20231113.004
    Next File GUID: 4F4D20B1-D38C-473E-8CF0-4D04C6AF90B0
    
    (D)atabases,(Q)uit =>
    

    Min Trans is the file count and offset of the minimal transaction position, that is, any open transaction must have started at or later than that point.

    If the selected file is a mirror journal file, addition information is displayed.

    Entering Q at the prompt at the bottom returns you to the journal file list. Enter D to display database information like the following:

    Journal: C:\MyIRIS\mgr\journal\20231113.003
      sfn  Directory or Mirror DB Name
    ==========================================================================
        0  C:\MyIRIS\mgr\
        1  C:\MyIRIS\mgr\irislib\
        2  C:\MyIRIS\mgr\iristemp\
        3  :mirror:MIR:MIRTEST
        5  C:\MyIRIS\mgr\irislocaldata\
        6  C:\MyIRIS\mgr\user\
     
    (P)rev,(N)ext,(Q)uit =>
    

    Enter Q to return to the journal file information display.

  4. After you enter G or E, the utility displays the journal file name and begins listing the contents of the file by offset address. For example:

    Journal: C:\MyIRIS\mgr\journal\20230330.002
       Address   Proc ID Op Directory        Global & Value
    ===============================================================================
        131088      2980 S  C:\MyIRIS\mgr\  SYS("shdwcli","doctest","remend") = 1+
        131156      2980 S  C:\MyIRIS\mgr\  SYS("shdwcli","doctest","end") = 1013+
        131220      2980 S  C:\MyIRIS\mgr\  SYS("shdwcli","doctest","jrnend") = 1+
    ...
    
    
  5. At the bottom of the current listing page is information about the journal file and another prompt:

    Last record:     573004;   Max size: 1073741824
    (N)ext,(P)rev,(G)oto,(F)ind,(E)xamine,(Q)uit =>
    
    

    Use these options to navigate to the journal record you wish to display:

    • Enter N or P to display the next or previous page of addresses.

    • Enter G to move the display to a particular address.

    • Enter F to search for a particular string within the journal file.

    • Enter E to enter the address of a journal record and display its contents.

    • Enter Q to return to the list of journal files.

  6. After entering E or G, enter an address at the prompt. The E option displays the contents of the journal record at or near the address you entered; the G option displays the page of journal records starting at that location.

    For either option, the utility locates the record that is the closest to the offset address you specify; it does not need to be a valid address of a journal record. Also, you may enter 0 (zero) to go to the beginning of the journal file, or enter -1 to go to the end of the journal file.

  7. You may browse through a display of the journal records using N or P to display the next or previous journal record contents, respectively. When you are finished displaying records, enter Q at the prompt to return to the list of journal records.

There are different types of journal records:

  • The journal header is 8192 bytes long. It appears once at the start of every journal file. The ^JRNDUMP utility does not display the journal header record.

  • Journal data records.

  • Journal markers

The following is a sample journal file data record as displayed by ^JRNDUMP. The example shows how a Set command is recorded. The new value is recorded, but not the old value, because the Set occurred outside a transaction:

Journal: C:\MyIRIS\mgr\journal\20230119.004
 
Address:                 233028
Type:                    Set
In transaction:          No
Process ID:              4836
ECP system ID:           0
Time stamp:              60284,53240
Collation sequence:      5
Prev address:            232984
Next address:            0
 
Global:    ^["^^C:\MyIRIS\mgr\"]ABC
New Value: 2
 
 
(N)ext,(P)rev,(Q)uit =>

In a transaction, the old value is also recorded, to allow transaction rollback, as seen in this second example:

Journal: C:\MyIRIS\mgr\journal\20231115.004
 
Address:                 204292
Type:                    Set
In transaction:          Yes
Process ID:              458772
ECP system ID:           0
Time stamp:              60584,52579 - 11/15/2023 14:36:19
Collation sequence:      5
Prev address:            204224
Next address:            204372 

Global:    ^["^^C:\MyIRIS\mgr\"]ABC
New Value: 5
Old Value: 2
 
 
(N)ext,(P)rev,(Q)uit =>

The following is an example of a journal marker record created by an incremental backup:

Journal: C:\MyIRIS\mgr\journal\20231115.004
 
Address:                 210848
Type:                    JrnMark
Marker ID:               -1
Marker text:             NOV 15 2023;03:14PM;Incremental
Marker seq number:       1
Prev marker address:     0
Time stamp:              60584,52579 - 11/15/2023 14:36:19
Prev address:            210744
Next address:            210940
 
 
 
(N)ext,(P)rev,(Q)uit =>

The following table describes each field in the journal data record.

Journal Data Record Fields Displayed by ^JRNDUMP
Field Description
Address Location of this record in number of bytes from beginning of file. This is the only field where you enter a value to select a record.
Type The type of operation recorded in this journal record entry. See the Journal File Operations table for possible types.
In transaction Whether or not the update occurred in a transaction.
Process ID Process ID number for the process issuing the command.
ECP system ID ECP system ID number (0 if a local process).
Time stamp Creation time of the journal buffer, in $HOROLOG and human-readable format. This is not the time the Set or Kill operation occurs, so it represents the earliest this particular operation could have happened.
Collation sequence Collation sequence of the global being updated.
Prev address Location of previous record (0 indicates this is the first record).
Next address Location of next record (0 indicates this is the last record).
Cluster sequence # Sequencing for globals in cluster-mounted databases. During cluster failover, journal entries from different nodes are updated in order of this cluster time sequencing.
Mirror Database Name If a mirror journal file, the mirror name for the database on which the operation occurred.
Global Extended reference of global being updated.
New Value For a Set operation, the value assigned to the global.
Old Value For a Set or Kill operation in a transaction, the value that was in the global before the operation.

The following table lists and describes the journal operations displayed in the Op column of a ^JRNDUMP journal file display and the Type field of a ^JRNDUMP journal record listing. For example, in the previous example of a journal file display, S in the Op column represents a JRNSET operation, while in the examples of journal record displays, Set appears in the Type field to indicate a JRNSET operation. Note that the Type column of the journal record display in the management portal (see View Journal Files) differs for some operations from the Type field of the ^JRNDUMP listing; for example, a JRNSET operation is indicated by RemoteSET in the portal and by NSet in ^JRNDUMP output. These differences are shown in the table.

The table also shows the codes that can be specified to filter journal records by operation when using the SELECT^JRNDUMP function.

Journal File Operations
Operation Description Op in file listing Type in ^JRNDUMP record listing Type in Management Portal record listing Numeric SELECT code Alpha SELECT code
JRNSET set a node, local S1 Set

SET

6 s

JRNNSET

set a node, remote

S1 NSet

RemoteSET

10 s

JRNMIRSET

internal mirror operation2

S1

Mirror Set

MirrorSET

19

s

JRNBITSET

set a specified bit position in a node

b1

BitSet

BitSET

14

bs

JRNKILL

kill a node, local

K1

KillNode

KILL

7

k

JRNNKILL

kill a node, remote

K1

NKill

RemoteKILL

11

k

JRNKILLDES

kill a descendant node

k1

KillDesc

KILLdes

8

k

JRNMIRKILL

internal mirror operations2

k1

Mirror Kill

MirrorKILL

20

k

JRNZKILL

kill a node without killing subordinate nodes, local

k1

ZKill

ZKILL

9

zk

JRNNZKILL

kill a node without killing subordinate nodes, remote

k1

NZKill

RemoteZKILL

12

zk

JRNBEGTRANS

begin a transaction

BT

BeginTrans

BeginTrans

4

--

JRNTBEGINLEVEL

begin transaction level

BTL

BeginTrans with Level

BeginTrans with level

16

--

JRNCOMMIT

commit a transaction

CT

CommitTrans

CommitTrans

5

--

JRNTCOMMITLEVEL

commit isolated transaction level

CTL

CommitTrans with Level

CommitTrans with level

18

--

JRNTCOMMITPENDLEVEL

commit pending transaction level

PTL

CommitTrans Pending with Level

CommitTrans Pending with level

17

--

JRNMARK

journal marker

M

JrnMark

Marker

13

--

JRNBIGNET

ECP networking

NN

NetReq

netsyn

15

--

JRNTROLEVEL

roll back a transaction

RB

Rollback

Rollback

21

--

1 T is appended when the operation occurs within a transaction, for example ST for a Set operation within a transaction or kT for a ZKill operation within a transaction.

2 Operation is ignored during journal restore.

Select Journal Records to Dump

The function SELECT^JRNDUMP lets you display any or all of the records in the journal file. InterSystems IRIS dumps selected records from the journal file, starting from the beginning of the file, based on the arguments passed to the function.

The syntax to use the SELECT entry point of the ^JRNDUMP utility is as follows:

SELECT^JRNDUMP(%jfile,%pid,%dir,%glo,%gloall,%operation,%remsysid)
Argument Description
%jfile Journal file name. Default is the current journal file. You must specify the fully qualified path of the journal file.
%pid

Process ID in the journal record. Default is any process.

%dir Directory in the journal record. Default is any directory.
%glo Global reference in the journal record. Default is any global.
%gloall Global indicator whether to list entries related to all global nodes containing the name represented by glo: 0 — Exact match of global reference with the name specified in glo, 1 — Partial match; all records with a global reference that contains the name specified in glo. Default is 0.
%operation Operation type of the journal record. Default is any operation. Use the numeric or alphabetic codes listed in the Journal File Operations table.
%remsysid ECP system ID of journal record. Default is any system.1

1 If %pid is specified, then %remsysid defaults to local system (0); otherwise, it defaults to any system, the same as if it is specified as 0. That is, you cannot select journal entries only from the local system.

You may pass the null string for any argument, in which case the routine uses the defaults.

As with other terminal functions, you can use the Device: prompt to direct the output of SELECT^JRNDUMP to a device other than the terminal, or to a file. (See Introduction to I/O for information on user device selection.) If you direct the output to a file, you are prompted for parameters. You must include R and W when writing to a file; if it is an existing file, include A to append output to the existing content rather than overwriting it; if a new file, you must include N. Enter ? at the Parameters? prompt to display all possible choices.

Note:

If the file you are overwriting is longer than the current output, the excess lines from the original file may not be removed from the updated file.

SELECT^JRNDUMP Examples

The following examples show different ways to select specific journal records.

To select all records in a journal file with the process ID 1203 and send the output to a new file called JRNDUMP.OUT:

%SYS>Do SELECT^JRNDUMP("C:\MyIRIS\mgr\journal\120020507.009","1203")

Device: SYS$LOGIN:JRNDUMP.OUT   
Parameters: "RWN"=>

To select all records in the journal file that contain the global reference ^ABC:

DO SELECT^JRNDUMP("C:\MyIRIS\mgr\journal\20050327.001","","","^ABC",1)

To select only records that have an exact match to the global reference ^ABC:

DO SELECT^JRNDUMP("C:\MyIRIS\mgr\journal\20050327.001","","","^ABC",0)

Note:

Records that are not an exact match, such as ^ABC(1) or ^ABC(100), are not selected.

To select only records for local Set operations of global ^ABC:

DO SELECT^JRNDUMP("C:\MyIRIS\mgr\journal\20050327.001","","","^ABC","","6")

To select only records for local and remote Set operations of global ^ABC:

DO SELECT^JRNDUMP("C:\MyIRIS\mgr\journal\20050327.001","","","^ABC","","s")

FeedbackOpens in a new tab