In the first installment of this series on journaling, we discussed the basics of journals and journaling. We discussed...
how to set up journals and journal receivers, then how to start journaling a file. Once the system starts journaling a file, it starts writing journal entries to the associated journal receiver. Eventually, journal receivers fill up. What do you do then? Let's take a look.
Good news, you can change journal receivers on the fly
Going back to our notebook analogy in Part I, eventually the pages get filled up with journal entries. The same is true with journal receivers -- eventually they will get too large. (You can set a size threshold when you create a journal receiver that, when reached, will cause the system to send you a message.) When the journal notebook is full, the filled pages can be removed and new pages can be put in. When a journal receiver is full, you can detach it from the journal and attach a new journal receiver to the journal. That can be done while the file is in use and even when the file is under commitment control.
You use the Change Journal (CHGJRN) command to attach a new journal receiver to a journal. The currently attached receiver is automatically detached at that point. Once a journal receiver has been detached, you can save it to tape (or other backup media).
System-managed journal receivers
You can also configure a journal so that the system manages the receivers. That is, when the attached receiver becomes full, the system will create a new receiver and attach it (thus, detaching the full receiver). You can also trigger this process manually before the receiver becomes full by using the following command:
CHGJRN JRN(lib/journal) JRNRCV(*GEN) MNGRCV(*SYSTEM) DLTRCV(*NO)
The trick to using system-managed journal receivers is to already have a journal receiver attached to the journal. You must create this receiver and manually attach it. The system then uses this receiver as the blueprint for creating new receivers. That is, when the system generates a receiver, the currently attached receiver is used to set the attributes (e.g., the threshold [size], authority, ASP, etc.) of the new receiver. So, you must prime the process by creating and attaching an initial receiver.
You can think of this as "journal mirroring." Each journal can have a maximum of two attached journal receivers at any given time. When two receivers are attached, the system records identical entries to both. That gives you maximum protection if one of the receivers should get damaged. However, since the system is writing out twice as many entries, this feature requires more overhead.
To attach dual receivers, use the CHGJRN command before and simply specify two journal receiver names in the provided spots. For example:
CHGJRN JRN(lib/journal) JRNRCV(RCVA RCVB)
Note: IBM removed internal support for dual receivers in V4R5. You can still attach two receivers to a journal, but the second one is ignored. I have never seen any explanation as to why IBM did this.
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.