Skip to content

IBM i high availability: replication, backups and recovery testing

B2Bnetwork team · · 6 min

IBM i, RPG and mainframe

In brief

High availability on IBM i has three layers: backups (GO SAVE, BRMS), replication to a second system (logical replication through journals, or PowerHA with an independent auxiliary storage pool, IASP) and regular switchover and recovery tests. You choose the solution based on two numbers: how much data the business can lose (RPO) and how long the system can be down (RTO). Replication protects against a server failure, but a faulty batch run or deleted data reaches the copy within seconds, so backups always stay.

RPO and RTO: what drives the choice

RPO (Recovery Point Objective) is the maximum amount of data the business can lose, expressed in time. RTO (Recovery Time Objective) is the time within which the system must be running again. A wholesaler that takes orders all day may find an RPO of 24 hours unacceptable, because a nightly backup means losing a whole day of orders. A reporting system loaded once a day can live with the same RPO without trouble.

The business sets the numbers, not the IT department, because the business knows the cost of downtime and lost transactions. The technical team shows what each level of protection costs. How to tie these decisions to a business continuity plan is described in the article Business continuity: BCP and DRP for critical systems.

Backups: the foundation of every plan

The GO SAVE menu has three main options: 21 saves the entire system, 22 saves system data only, and 23 saves all user data. According to IBM documentation, option 21 is the basis for all save strategies. Options 21 and 22 always require a restricted state, which means nothing else runs on the system during the save, and option 23 puts the system into that state when you run it without prompting for commands.

So daily backups are not done with the full option 21. A typical setup is:

  • a full system save in a maintenance window, for example once a month and before major changes;
  • a daily save of data libraries and IFS directories with the save-while-active function (the SAVACT parameter), which lets you save objects that applications are using;
  • saving journal receivers between full saves, so you can restore changes up to a chosen point in time.

BRMS (Backup, Recovery and Media Services), an IBM program, manages the schedule, media and retention, and besides the saves themselves it produces a recovery report: the list of steps and media needed to rebuild the system. Backups must leave the site where the server stands. Rules for keeping backups off site are discussed in the article Cloud backups: the 3-2-1 rule and restore testing.

Logical replication through journals

IBM i writes changes to database files to journals, provided the file is journaled. The remote journal function sends the entries to a second system, and a logical replication tool applies them there to a copy of the files. This setup has several characteristics:

  • the second system is active and can be read from, for example for reports or backups;
  • the systems do not need the same disk storage;
  • every object must be journaled or replicated by a separate mechanism, and missed objects only surface at switchover;
  • at switchover you must check that all entries have been applied, because a remote journal in asynchronous mode can lag a few seconds behind the source.

Journals are useful beyond high availability too: change data capture (CDC) for feeding other systems uses the same entries, as described in the article Change Data Capture: database changes without loading the system.

PowerHA SystemMirror for i and IASPs

PowerHA SystemMirror for i is an extension of IBM i for building high availability and disaster recovery clusters. Application data is kept in an independent auxiliary storage pool (IASP), which is replicated or switched between cluster nodes. IBM documentation lists several replication technologies:

TechnologyHow it worksWhat to watch
Geographic MirroringSystem-based replication, synchronous or asynchronous, independent of the disk typeBandwidth of the link between sites
Metro MirrorSynchronous copy in external storageDistance between sites limits synchronous mode
Global MirrorAsynchronous copy in external storageSmall data loss in a failure
LUN switchingThe same IASP is switched between systemsProtects against server failure, not storage failure
FlashCopyPoint-in-time copy in storageBackups from the copy without stopping production

The biggest effort with PowerHA is moving application data into the IASP and checking what stays in the system disk pool: user profiles, system values, job descriptions. The cluster administrative domain synchronizes these objects, but you need to define the list and test it.

Switchover and recovery testing

A plan nobody has tested is just a document. A test covers two things separately: switching over to the second system and restoring from backup.

  1. Planned switchover. Swap the roles of the systems in a maintenance window, run on the second system for a set time and switch back. Measure the time and check that nightly jobs, printing and connections to other systems work.
  2. Restore from backup. Rebuild the system or selected libraries on a separate partition following the recovery report. Measure the time and compare the data with production.
  3. Data error scenario. Restore the state from before a faulty batch run using backups and journals, which is the case replication does not protect against.
  4. Record the results. Timing, deviations from the plan and corrections to the procedure.

In banks and payment institutions, resilience testing is a regulatory obligation, as we explain in the article Digital operational resilience testing under DORA. The project on a DORA compliance program shows an example of a compliance program that includes such tests.

Questions and answers

What is the difference between high availability and disaster recovery?

High availability (HA) keeps the system running during a server failure or planned outage, usually by switching over to a second system in the same or a nearby site. Disaster recovery (DR) deals with losing the whole site and assumes restoring operations in another location. On IBM i, the same replication often serves both needs, but with different RPO and RTO targets.

Does replication replace backups on IBM i?

No. Replication carries every change to the second system, including the wrong ones: a deleted library or a batch run that overwrote data shows up on the copy immediately. A backup together with journals lets you return to the state before the error. That is why backups are taken daily and kept off site even with two systems in a cluster.

How often should switchover to the second system be tested?

At least once a year, and preferably after every major infrastructure or application change, for example after a system upgrade or adding a new data library. Companies that switch over regularly, for example every quarter, find missing objects and dependencies before a real failure happens. Every test ends with a record of the timing and a list of fixes.

What has to move into the IASP when implementing PowerHA?

Application data and programs, meaning the libraries and IFS directories that users and jobs work with. User profiles, system values, subsystem descriptions and job descriptions stay in the system disk pool and have to be synchronized with the cluster administrative domain. Before the rollout, take an inventory of objects and run a test on a copy, because applications with hardcoded library names sometimes need fixes.

What it looks like in a project

Developing a system on IBM i or mainframe? Talk to an RPG engineer.

Let's talk

Read more: IBM i, RPG and mainframe