Consistent Db2 Copies from Inconsistent Image Copies

Why this is actually more difficult in many z/OS environments than it sounds at first:
Image Copies are part of everyday operations in Db2 for z/OS. But anyone who wants to quickly create a reliable test, audit, or analysis environment from existing backups often runs into limitations. That’s because, in practice, there’s a significant difference between “we have backups” and “we can provide a consistent state at a defined point in time.” This is exactly where things get interesting.

Backups in place. Problem solved? Unfortunately, often not.

On paper, backup coverage is solid in many mainframe environments. Image Copies are created regularly, and recovery processes are well established. For their intended purpose – restoring the original objects in the event of a failure or disaster – these backups can do exactly what they were designed to do.

However, this does not automatically mean that the same backups can also be used to easily build a separate test, audit, or analysis environment. A backup must first and foremost enable recovery. Being able to use it as a standalone, consistent, immediately usable copy is an additional benefit, but not necessarily part of its original purpose.

This is where a common misconception arises:
An existing Image Copy is not automatically equivalent to a functionally usable, transactionally consistent copy. Anyone who wants not only to restore data, but also to move it into a separate target environment, needs more than a collection of technical backup artifacts. What is needed is a state that is logically consistent, can be reliably tied to a specific point in time, and can be used outside the original production context.

The key distinction is therefore not whether a backup strategy is “good” or “bad”. It may be entirely adequate for recovering the original and still require additional steps when backups are used for other purposes.
The requirements for a recoverable backup are not automatically the same as those for a standalone test, audit, or analysis copy.

The actual problem: `SHRLEVEL CHANGE` is practical – but not automatically consistent

In production Db2 environments, Image Copies are often created using `SHRLEVEL CHANGE`. This makes operational sense because applications can continue running and the availability of the source objects does not need to be restricted. In near-24/7 operating models, this is often the only realistic option.

Such Image Copies do not necessarily represent a consistent data state on their own. That is not automatically a shortcoming for the intended recovery process:
Db2 can evaluate Image Copies together with the corresponding log information to enable recovery. The backup is therefore not necessarily designed to be a complete, independently usable snapshot.

Other use cases, however, have additional requirements. This applies, for example, to multiple related objects when different tablespaces or indexspaces are backed up at different times. Even a single large Image Copy may contain a backup state that should not be treated as a consistent point in time without the appropriate recovery processing. For example, changes may occur while the copy is being created and can only be interpreted correctly in conjunction with the logs.

Therefore, when the goal is to create a new, separately usable environment from backups, it is not enough to treat the Image Copies as ready-made copies. The task is no longer just to restore the original objects, but to carefully reconstruct a consistent point-in-time state.

Why this matters so much for audits, forensics, and test data

The business relevance of this problem often becomes clear only when a specific requirement arises. An audit calls for a verifiable view of production at a particular point in time. After a security incident, changes between two points in time need to be analyzed. A test system needs realistic data that is not only complete, but also logically consistent. Or an incident makes it necessary to reconstruct an earlier situation exactly.

In all these cases, an “approximately right” copy is not enough. The important thing is to provide tables, dependent objects, and indexes in a state that is transactionally consistent.

This is no small matter, especially in mature environments with many related objects. What can still be handled with manual workarounds in small setups quickly becomes a risk to effort, traceability, and operational reliability in larger environments.

This shifts the question for IT decision-makers – For recovery, the question is:
“Can we restore the original objects?”

For additional use cases, there is another question:
“Can we use the backups to create a reliable data state for exactly the point in time we need?”

Where traditional methods reach their limits

Db2 provides a mechanism called Redirected Recovery for applying Image Copies and log information to different target objects. Technically, this is a valid approach. In practice, however, it is often much more involved than it first sounds.

For one thing, the target objects must already exist. Tables, tablespaces, indexes, and other required structures therefore have to be created and prepared in advance. For another, this approach works only within the same Db2 subsystem or the same Data Sharing environment. For many typical use cases – such as providing a consistent production copy in a separate test or analysis subsystem – this is a significant limitation.

There is also a considerable amount of manual work:
Every object involved must be explicitly listed with its source and target names. Names cannot be derived automatically, and follow-up tasks such as `REPAIR CATALOG` or rebuilding missing indexes are also left to the DBA. This is manageable for individual objects. For larger sets with many tablespaces and indexes, it can quickly turn into a fragile one-off process rather than a sustainable operating model.

The more important shift in perspective: don’t just copy – establish consistency

This is where it becomes clear whether a copying method is genuinely useful in day-to-day operations. The real challenge is not simply moving data from A to B somehow. The crucial question is how to turn potentially inconsistent or time-shifted sources into a transactionally sound overall state.

BCV5 Inflight Copy addresses precisely this challenge. In Inflight scenarios, BCV5 can copy the source objects’ VSAM clusters directly, or use Image Copies of those objects. It then evaluates the relevant Db2 log information to bring the target data set to a common consistency point. Changes from uncommitted transactions are rolled back, resulting in a consistent target state.

That is the crucial difference:
The result is not merely a technical copy of existing backups, but an environment that is logically consistent. This is especially important for `SHRLEVEL CHANGE` Image Copies, which can be used for recovery but are not necessarily suitable as a directly usable target environment.

What BCV5 does in practice

As a copy tool for Db2 for z/OS, BCV5 is designed to copy tablespaces and indexspaces at the VSAM level while automatically making the necessary internal adjustments so that the target environment accepts the copied objects. This significantly reduces the effort compared with traditional `UNLOAD/LOAD` methods and is much faster in many scenarios.

Above all, the degree of automation matters. BCV5 automatically generates DDL, JCL, and control logic, checks the compatibility of existing target objects, can create missing structures, and selects the appropriate processing path for each scenario. Objects are selected based on rules through Selection Rules, and renamed through Mapping Rules. This makes it possible to manage even large numbers of objects without lengthy individual lists.

One limitation is important for Inflight Copy tasks:
There is no fallback to `UNLOAD/LOAD`. The source and target must be structurally compatible, or BCV5 must create the target objects. This is technically necessary because Log Apply works only when the physical structures of the source and target objects are identical.

Which Image Copies are supported – and which are not

For Image Copies used as input, BCV5 supports various types, including full and incremental Image Copies, sequential Image Copies created by `COPY`, `MERGECOPY`, or `COPYTOCOPY`, as well as FlashCopy-consistent Image Copies. Image Copies on tape can also be processed; BCV5 takes into account which data sets can be accessed in parallel and which can only be accessed sequentially.

Inline Image Copies from `LOAD` or `REORG` are not supported. Full System Backups are also not usable as input sources in this context.

If index Image Copies are available, they can be included as well. If some or all are missing, BCV5 automatically initiates the necessary rebuild of the affected target indexes. This is particularly useful in day-to-day operations because it incorporates into the overall process a step that might otherwise be overlooked or handled manually afterward.

Why this is more than just a convenience for operating models

At first glance, this might seem to be mainly about convenience. In fact, the difference is more fundamental. At many companies, copying processes have historically consisted of utility chains, custom scripts, and special cases that work only because certain people know exactly how all the pieces fit together.

However, as soon as repeatability, traceability, and speed become necessary, such setups become a burden. A method that automatically creates target objects, uses rules instead of individual lists, actively establishes consistency, and properly handles missing index copies does more than provide technical benefits. It also reduces operational risk.

This is a crucial difference for IT decision-makers. Under pressure, it matters not only whether a process is theoretically possible, but also whether it works reliably in day-to-day operations without unnecessary special handling.

The real point of contention: Is “backup available” still reassuring enough?

This is probably the discussion many teams should be having. In practice, the existence of backups is often confused with the ability to actually act. As long as backups are running, the issue is considered resolved. Only when someone asks for a reliable historical data state, an audit copy, or a forensically sound reconstruction does it become clear whether the process really holds up.

This is not a fringe issue. In regulated, highly integrated, or especially availability-critical environments, the ability to provide a consistent state at a precise point in time can be operationally and regulatorily critical. Simply pointing to the existence of Image Copies answers the wrong question.

The right question is:

How reliably can existing backups be used to create a genuinely usable, consistent data state?

Conclusion

Image Copies are a central part of any Db2 backup strategy. However, they are not automatically equivalent to a consistent, immediately usable target environment. Especially with `SHRLEVEL CHANGE`, different backup times, and large numbers of objects, it becomes clear how quickly an issue that seemed resolved can turn into an operational risk.

BCV5 addresses this gap by not only reading Image Copies, but also using the Db2 log in Inflight scenarios to bring them to a common, transactionally consistent point-in-time state. It also automates DDL, JCL, object selection, compatibility checks, and index handling. Unlike Redirected Recovery, this keeps the process manageable even in larger, separate environments.

Anyone who needs to provide data states for audits, testing, forensics, or analysis today should therefore focus less on the mere existence of backups – and more on how to turn them into reliable states.

CURRENT POSTS

XDM - Data Orchestration Platform

Visit the XDM product page for a complete overview of its great features!