02
Sat, Nov
2 New Articles

High Availability: Designing for iSeries Journaling

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Businesses today face increasing pressures for real-time data availability; data accuracy; and details about who accessed or changed what data and when. These requirements are arising from a number of areas, most commonly these:

  • Regulation and compliance
  • Business process consolidation
  • IT infrastructure
  • Electronic commerce
  • Globalization

Each of these business drivers is forcing application developers and IT managers to investigate and administer new technologies and solutions. The challenge for IT professionals is to solve these issues with a minimum of investment and maximum return. For each of these IT and business issues, IBM's System i5 journaling technology can provide relief to the pain.

What Is Journaling?

System i5 journaling enables you to create a list of activity to physical files, IFS files, data areas, and data queues. The activities that are tracked include what changes and updates are made to existing objects, when the objects are accessed, and when they are closed. The operating system automatically performs this tracking once journaling is activated on these objects. With the new journal-at-birth option availability in OS/400 V5R3, the operating system tracks creation, deletion, and attribute changes.

In order to understand how this is done, you must first understand the core components of journaling. System i5 journaling consists of three main components: a journal receiver, a journal receiver entry, and a journal.

A journal receiver is the object in which the list of activity is recorded. Each activity that is recorded via the use of an entry is appended to the end of the journal receiver. The journal entries include the following information and more:

  • Date and time the activity occurred
  • User performing the activity
  • Job performing the activity
  • Program performing the activity
  • Object being updated or accessed
  • Location of object
  • Type of activity (update, open, close, etc.)
  • Details of the specific activity, such as the data as it looked prior to the update or just after the update

Think of the journal receiver as a box and each entry as a paper receipt. As an activity occurs, the operating system writes down the information on the receipt and places it in the box. At some point, the box (journal receiver) will be filled up and a new box (journal receiver) must be added to collect new paper receipts (journal entries). When this happens, a new journal receiver must be created, the old journal receiver must be detached from the journal, and the new journal receiver must be attached. The good news is that i5/OS automatically detects when a journal receiver becomes full and creates new journal receivers to allow the system to continue to collect the journal entries.

As journal entries collect in the journal receivers, the receivers increase in size and take up disk space on the system. It is important to have a strategy for saving the journal receivers and deleting them from the system once they have been saved. In addition, it is important to set up the journal receiver so i5/OS automatically changes the journal receiver once it reaches a certain size.

A journal is the object that connects the journal entries to the journal receiver. The journal plays a key role because it remains constant even as the journal receivers are changed and deleted. For this reason, when you start or stop journaling on an object, you indicate the name of the journal, not the journal receiver. The journal also contains the configuration information, which provides the operating system with the following information:

  • Whether and when to change the associated journal receivers
  • Whether to automatically delete the associated journal receivers
  • What types of information should be captured (e.g., job, program, etc.)

Creating a Journal

To create a journal, you must first create the journal receiver and then create the journal. When you create the journal, you tell it which journal receiver to use or to "attach."

To create a journal receiver, use the Create Journal Receiver (CRTJRNRCV) command. The following example will create journal receiver TEST001 in library TEST and assign a threshold value of 1000000 KB.

CRTJRNRCV JRNRCV(TEST/TEST001) THRESHOLD(1000000)

To create a journal, use the Create Journal (CRTJRN) command. The following example will create journal TESTJRN in library TSTJRNLIB and attach it to journal receiver TEST001 in library TEST.

CRTJRN JRN(TSTJRNLIB/TESTJRN) JRNRCV(TEST/TEST001) MNGRCV(*SYSTEM) 

DLTRCV(*NO)

The MNGRCV(*SYSTEM) parameter on the CRTJRN command tells the operating system to monitor the threshold size of the journal receiver. When it reaches the size indicated on the journal receiver (in our example, 1000000 KB), the operating system will automatically create a new receiver, detach the current receiver, and attach the new receiver. When the operating system does this process, it creates a new journal receiver named based on the current name plus one. In this example, the new journal receiver name would be TEST002. The next journal receiver would be TEST003, and so on.

The DLTRCV(*NO) parameter on the CRTJRN command tells the operating system not to automatically delete the journal receiver. This means you will need to incorporate into your backup process the saving of these journal receivers and the subsequent deletion of the journal receivers after they have been saved. The journal receiver objects are saved using standard SAV and RST commands. In addition, you can use the Display Journal Receiver (DSPJRNRCV) command to determine if a journal receiver has been saved. If so, delete the journal receiver using the Delete Journal Receiver (DLTJRNRCV) command.

Once you have the journal and journal receiver built, you can tell the operating system you would like to journal a file or an object. This very simple task utilizes one of three commands, depending on what type of object you would like to journal.

Journaling on Database Files

The Start Journal Physical File (STRJRNPF) command starts journaling on a physical file. The following example starts journaling on file TESTPF in library TESTLIB. This file is journaled to journal TESTJRN in library TSTJRNLIB.

STRJRNPF FILE(TESTLIB/TESTPF) JRN(TSTJRNLIB/TESTJRN) IMAGES(*BOTH) 

OMTJRNE(*NONE)

The two additional parameters, IMAGES and OMTJRNE, are important to note.

In this example, we have told the operating system to capture both (*BOTH) images on the IMAGES parameter. This means that when a record is changed, there will be two journal entries written to the journal receiver: The "before" entry includes the record content prior to being changed, along with details about the user, program, date, time, etc. The "after" entry includes the same information, except it details the record content after the change occurred. The other option for this parameter is *AFTER, which would create only the "after" entry.

In addition, we have told the operating system to omit no (*NONE) images on the Omit Journal Entry (OMTJRNE) parameter. This means that whenever the file is opened or closed, a journal entry will be created with details such as the date, time, user, program, etc. In many environments, files are opened and closed often. This can add a large number of journal receiver entries and cause the journal receiver size to quickly increase. The *NONE setting is the correct setting if you want to capture all information about file access. However, unless you plan to use the journal receiver entries to determine who is reading (but not changing) files, set this attribute to *OPNCLO, which will cause the operating system to not create journal receiver entries for open and close activity.

Journaling on Data Areas, Data Queues, and IFS Files

The Start Journal Object (STRJRNOBJ) and Start Journal (STRJRN) commands work much like the STRJRNPF command except that they start journaling on different object types. STRJRNOBJ starts journaling on data areas and data queues. STRJRN starts journaling on IFS commands. The main difference from the functionality detailed above is that STRJRNOBJ does not include the OMTJRNE parameter and functionality. This is because data areas and data queues are not files and thus do not have the concepts of being opened or closed.

You may be wondering, "What about the other objects on my system? How do I journal objects besides physical files, data areas, data queues, and IFS files?" In order to journal these objects, use the QAUDJRN Security Audit Journal, since these objects are only created, deleted, and used—never updated. The topic of setting up and using QAUDJRN and Security Audit Journaling is too large to cover in this article.

Data Accuracy, Compliance, and Availability

Now that you understand how journaling works, we can examine how journaling helps to increase data accuracy, data compliance, data availability, and high availability.

Increasing Data Accuracy

Journaling enables you to increase data accuracy by taking advantage of two advanced database technologies: commitment control and auto-recovery. These features ensure that you always have accurate data in your database even if the system or program crashes while data is being updated.

Commitment Control
This database feature allows an application program to be designed so that a user must complete all changes related to a database transaction before the transaction is permanently reflected in the database. This helps ensure the data integrity of the database in the event of a system failure in the middle of a transaction. It also allows a transaction to be canceled in process if the user feels the transaction is erroneous. There are numerous methods to take advantage of commitment control within i5/OS, including using SQL-based applications, RPG, COBOL, and C development. If you are concerned about data accuracy, it is critical you review your applications to ensure they utilize commitment control for any financial or regulated transaction. In addition, commitment control is recommended for any process that updates more than one file and for long-running batch jobs that don't have batch restart logic.

Auto-Recovery
As mentioned, i5/OS utilizes journaling to track changes to the data as they occur. The journal provides the operating system with the necessary information to recover the database with full integrity if an error (hardware or software) occurs that causes the database "service" to end abnormally. If journaling is active, the database will review the journal information whenever the database starts in order to determine whether the database ended abnormally and to address any database corruption. For example, if a user is in the middle of updating a record when the database abnormally ends, the database will detect the situation when the database is started and either roll-back or roll-forward the change to a point of full data integrity.

Increasing Data Compliance

Journaling is the key to increasing data compliance because it allows the operating system to generate a record of all activity on files. This record can be completely trusted because it includes the following information:

  • The time and date journaling was started on a file
  • The time and date journaling was stopped
  • A complete list of all changes to the file
  • A complete list of all opens or closes of the file

Since journaling can provide exact dates and times as well as identify users, programs, and other critical pieces of information, you can use it to meet compliance or audit obligations. The only caveat is if there is a very large amount of information in the journal receiver; some effort is required to create the reports and audits necessary for auditors and regulators. Numerous applications for the i5 simplify this problem if you need assistance.

Increasing Data Availability

Journaling can also provide increased availability by minimizing some (but not all) of the planned downtime due to tape backups. Instead of having to end your application and all updates to the database to get a usable tape backup of your physical files, data areas, data queues, and IFS files, you can simply back up the journal receivers since they contain a list of the changes to these objects. This does not eliminate the requirement to back up the database and objects, but backing up the journal receivers can reduce the frequency of backups and thus increase data availability. (To truly eliminate planned downtime, you will need a high availability solution.)

To recover from tape, you will need to perform the following process:

  1. Restore the object(s) from tape.
  2. Restore the journal receivers from tape because they contain all changes to the object that occurred after the save that was used to create the tape backup used for the restore in step 1.
  3. Use the Apply Journal Change (APYJRNCHG) command to apply all the journal entries that occurred after the save.

This process is complex, but it can be done successfully if you work at it and test, test, test. The keys to success are having a well-documented, well-planned, and well-tested process and ensuring that your application does not perform any actions not supported by the APYJRNCHG command.

Increasing High Availability

Journaling is the key to i5 high availability. More precisely, remote journaling is the key to an i5 high availability solution because it enables the operating system to maintain a copy of the journal and journal receivers on a second i5 or LPAR. The advanced availability solutions are able to read the remote journal and keep an accurate real-time copy of the database on the target i5 or LPAR.

In addition, the database and application is cluster-enabled, so it can be switched to run on the second i5 or LPAR. The cluster will then detect whether the production "services" are active or not. If the production services are inactive, the cluster will take over and provide database and application services to the users from the second i5 or LPAR. This clustering can be performed by the operating system or via high availability cluster software.

The two database features mentioned above work together or individually to provide availability. For example, consider a database server that has an unplanned outage and needs to be activated on the backup server. The database replication and clustering enables the data to be available on the second server and the database "service" to be active. Likewise, if this is a planned downtime event (hardware upgrade, full backup, etc.), you can again use the second server. However, no recovery will be needed since this is a planned switch. Another example is if the database is not clustered but has some type of planned or unplanned downtime and supports journaling and auto-recovery; then, it will have a much higher chance of recovering with little downtime and data loss.

Don't Delay

As you can see, journaling is a unique and powerful technology that can empower your business and IT operations for a wide variety of needs and enable exciting technologies such as commitment control, remote journaling, and high availability. Evaluate your IT and application environment to see how journaling can help you succeed today and in the future.

Michael Ross is director of product management at Lakeview Technology, a leading provider of high availability, data protection, and data management software solutions to businesses of all sizes. Prior to joining Lakeview, Michael served as the AS/400 specialist for DeVry Inc. and as an operations/project manager with Graward General, Inc. Michael holds many IT industry credentials, is recognized by IBM as a Technical Solutions Expert, and is a Certified Business Continuity Professional. Michael can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

Craig Johnson is director of research and development at Lakeview Technology, a leading provider of high availability, data protection and data management software solutions to business of all sizes. Craig has over 16 years of experience on i5 hardware including 10+ years of experience in high availability for the platform. At Lakeview, Craig has led numerous development efforts. Prior to joining the company, Craig worked as a software engineer at IBM's Rochester lab. Craig can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: