IBM Support

Start Journaling a Physical File

Troubleshooting


Problem

This document reviews why you may need to start journaling your physical files, how to turn this on, and considerations you should think about.

Resolving The Problem

Why you would need to start journaling your files
1. Disaster/Recovery

With journaling on and if undamaged, you would be able to restore a file to a known state and use CL command APYJRNCHG to read the journal receiver and reduce the transactions.
2. Auditing purposes

You would be able to see all changes made to a file. This includes the date, job, and user that made the change.
3.
 
Commitment control

If your applications require a commitment control or isolation level of anything other than *NONE, you would need to journal the file.
4. To run RGZPFM using the ALWCANCEL(*YES) parm.

Considerations of turning on journal for a file
1. Will the journal be user-managed?

User-managed means you will be managing attaching new journal receivers as they get full and deleting them when no longer needed. If this is not managed correctly and a journal receiver reaches the maximum size, jobs will halt as they can not deposit the journal data to the journal. Also note that some receivers can grow rapidly and take up space. You will want to get a process of deleting receivers when they are no longer needed.
2. Will the journal be system-managed?

System-managed means you set a threshold and, when the receiver gets around that size, the system will attach a new one. With certain settings, the system may also attach a new receiver with every IPL.

With system-managed, you can also have the system delete the old receiver. This is not a good setting if the journal is needed for disaster/recovery purposes or auditing purposes. The system does not save the journal before deleting.
3. Is the overhead of the journal being considered? Refer to Rochester Support Center knowledgebase document N1013074, When is Control Given Back to the Application When Using Journal Caching or Soft Commits: . You may want to look at purchasing and using journal caching to reduce the impact of journals.

How do you turn journaling on for a file
1. Create a journal receiver.

To create a journal receiver, on the IBM operating system command line type the following:

CRTJRNRCV JRNRCV(ANYLIB/MYRCV0001) THRESHOLD(15000000)

Note: For system-managed receivers, specify the threshold you want.

Press the Enter key.
2. Create a journal and supply the name of the receiver you created in Step 1. The journal is the "funnel" that writes information to the receiver.

CRTJRN JRN(ANYLIB/MYJRN) JRNRCV(ANYLIB/MYRCV0001) MNGRCV(*SYSTEM)

Press the Enter key.

Note: If you want user-managed, change the above to MNGRCV(*USER)
3. Start journaling your database file:

STRJRNPF FILE(MYLIB/MYDBF) JRN(ANYLIB/MYJRN)

Press the Enter key.

Notes:
1. If you want to see both the before and after images as the example below shows you need to set IMAGES(*BOTH) .
2. If you want to decrease the entries put into the journal you can remove the open and closes of a file by using OMTJRNE(*OPNCLO)
To view the data in the journal, you would use CL command DSPJRN. There are many filters you can use: Show data only for a certain file, a certain job, a certain time frame, or a specific change.

For example, if you want to see all UPDATES that JoeUser made to the CUSTOMER file after 9:30, you should use the following command:

DSPJRN JRN(MYLIB/MYJRN) FILE((CUSTOMER)) FROMTIME('10/11/05' '9:30') JRNCDE((R)) +
ENTTYP(UP UB) USRPRF(JOEUSER)

You can also send DSPJRN to an outfile.
You can also use the SQL Service DISPLAY_JOURNAL to view journal receiver information.

To see subtypes, refer to journal code finder in the Backup and Recovery guide. Also, search for Journal Coder Finder on the online Information Center.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHeAAM","label":"IBM i Db2"},{"code":"a8m0z0000000CGIAA2","label":"IBM i Db2-\u003EJournal"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

392921256

Document Information

Modified date:
26 November 2024

UID

nas8N1019067