Tip

The ins and outs of journaling -- Part II

Managing journal receivers


Ron Turull

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.

More Information

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.

Dual receivers
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.


This was first published in March 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.