简体   繁体   中英

How to view Journal data of a Table Green screen DB2

How do you view journal data from a specified table? I want to see what happended to a table in a specified time frame.

I got info on the table by using the following command: DSPFD FILE(P6PRDBDB00/P6OIDPF)

在此输入图像描述

在此输入图像描述

Got the journaled name and library but I dont know how to view it for the object P6OIDPF?

I did go to library #MXJRN and whent to P6 and got the following : 在此输入图像描述

How can I view the object P6OIDPF data? Or a command to view it? Theres a lot of objects in P6.

The command to use is DSPJRN JRN(#MXJRN/P6) FILE((P6PRDBDB00/P6OIDPF))

You can Filter on start and end date time.

Tools / 400中的EXPJRNE实用程序为DSPJRN命令提供了更高级别的接口。

Follow the next sequence:

Get the data file length and use it in the next command

DSPJRN JRN(JRNLIB/JRN)            
   FILE((FILELIB/DATAFILE *FIRST))
   OUTPUT(*OUTFILE)           
   OUTFILFMT(*TYPE2)          
   OUTFILE(OUTFILELIB/OUTFILE)
   ENTDTALEN(datafilelength)   

Once you get the data with wrkqry create a joined table where you get all the outfile fields except the last one JOESD. Instead of JOESD, you get all the data fields.

                        Specify File Selections                  

Type choices, press Enter.  Press F9 to specify an additional       
 file selection.                                                   

File . . . . . . . . .   OUTFILE        Name, F4 for list         
 Library  . . . . . .     *LIBL        Name, *LIBL, F4 for list  
Member . . . . . . . .   *FIRST         Name, *FIRST, F4 for list 
Format . . . . . . . .   *FIRST         Name, *FIRST, F4 for list 
File ID  . . . . . . .   A              A-Z99, *ID                

File . . . . . . . . .   datafile       Name, F4 for list         
 Library  . . . . . .     *LIBL        Name, *LIBL, F4 for list  
Member . . . . . . . .   *FIRST         Name, *FIRST, F4 for list 
Format . . . . . . . .   *FIRST         Name, *FIRST, F4 for list 
File ID  . . . . . . .   B              A-Z99, *ID                

the join is not important

                       Specify How to Join Files                            

Type comparisons to show how file selections are related, press Enter.         
Tests:  EQ, NE, LE, GE, LT, GT                                               

Field             Test     Field                                               
A.JOENTL          EQ       ANYFIELD                                            

Select all the fields but JOESD.

                      Select and Sequence Fields                           

Type sequence number (0-9999) for the names of up to 500 fields to            
appear in the report, press Enter.                                          

Seq   Field             Text                                          Len  Dec
1     A.JOMBR           Name of Member                                 10     
1     A.JOCTRR          Count or relative record number changed        10    0
1     A.JOFLAG          Flag: 1 or 0                                    1     
1     A.JOCCID          Commit cycle identifier                       10    0
1     A.JOUSPF          User Profile                                   10     
1     A.JOSYNM          System Name                                     8     
1     A.JOINCDAT        Incomplete Data: 1 or 0                         1     
1     A.JOMINESD        Minimized ESD: 0, 1, or 2                       1     
1     A.JORES           Not used                                       18     
      A.JOESD           Entry Specific Data - Variable contents       808     
1     B.FIELD1          FIELD1                                          2     
1     B.FIELD2          FIELD2                                          3    0

Then just copy from the outfile to the jrn file with replace and *nochk

CPYF FROMFILE(QTEMP/OUTFILE)  
   TOFILE(QTEMP/JRN)        
   MBROPT(*REPLACE)         
   FMTOPT(*NOCHK)           

And that's it! In JRN you have all the journal data and the data file data formatted as in the original file.

You have system procedure DISPLAY_JOURNAL and DISPLAY_JOURNAL_ENTRY_INFO in last versions of DB2

DISPLAY_JOURNAL doc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM