IBM Z and LinuxONE - Software - Group home

Common Logging Facility in IMS (IBM Information Management System)

  
If you purchase any software product that promises data integrity and recoverability, it is an extensive logging system that works underneath the covers to ensure data integrity and recoverability for you. The same holds true for IMS as well. With an extensive logging system in place, IMS is truly renowned for ensuring data integrity and providing recoverability.

It is the IMS Control Region that does the logging in IMS. Any events that happen in IMS are logged. Anything that happens in IMS, for example, transactions coming into IMS, transactions processed by IMS, a program stops, an IMS database gets updated, to name a few, are all examples of events that can occur in IMS. When events occur in IMS, the IMS Control Region will generate log records.

The figure below shows a pictorial representation of the ‘Common Logging Facility’ in IMS that we discuss below.
This image depicts how the Common Logging Facility in IMS works.

Figure. Pictorial representation of the ‘Common Logging Facility’ in IMS.

IMS Control region writes out the log records to what are known as ‘Log Buffers’. The log records keep getting accumulated in the log buffers until those get filled up. The filled-up log buffers are then written to a set of IMS Log Datasets known as OLDS (Online Log Datasets). You can have a minimum of three and maximum of 100 Online Log Datasets which are DASD datasets. IMS starts by logging on the first OLDS called OLDS1. As events continue to occur in IMS and log buffers fill up, IMS writes the filled-up log buffers as log records to the first OLDS dataset.

When OLDS1 fills up, IMS will switch to the next OLDS dataset, OLDS2 and will start writing log records to OLDS2. When OLDS2 fills up, IMS switches to OLDS3 and start writing log records to OLDS3. As each OLDS dataset continues to fill up, you can have the information present on the OLDS dataset archived using a Log Archive utility. As each OLDS dataset fills up, the Log Archive utility simply takes the information present in the OLDS dataset and archives, or, in simple terms, copies the data to what is known in IMS as a System Log Dataset (SLDS). So, IMS takes the information present in the OLDS dataset and copies it out to an SLDS. The SLDS’s can be on DASD or Tape, although it is not unusual if you see IMS shops storing SLDS’s on Tapes because a real busy production IMS system can generate large numbers of SLDS datasets throughout the day.

You also have the option of telling the Log Archive utility to extract out only database related information while copying from OLDS to SLDS. The extracted ‘database only’ information can be put on a separate dataset called the Recovery Log Dataset (RLDS). You would want to do that for database recovery purposes – if, for some reason, the IMS database takes a hit and database recovery process needs to be initiated, it is faster to recover a database using the RLDS’s as opposed to the SLDS’s. That is because the SLDS contains all log records, whereas the RLDS only has database change related log information that are needed for recovering a database.

The logging process that we have discussed above keeps on repeating all day long. As OLDS1 fills up, IMS switches to OLDS2 and in the meantime, OLDS1 gets archived to an SLDS. When OLDS2 fills up, IMS switches to OLDS3 and IMS keeps on doing that until it gets to the last OLDS dataset. And, once the last OLDS dataset fills up, IMS wraps around and reuses the first OLDS dataset, OLDS1. IMS can do that because the information that was present on OLDS1 had already been archived to an SLDS and IMS, therefore, doesn’t lose any log information. This entire process repeats itself all day long – IMS uses the OLDS datasets in a wrap-around fashion and as each OLDS dataset fills up, IMS switches to the next OLDS dataset, takes the information in the filled-up OLDS dataset  and archives that out to an SLDS and/or RLDS dataset(s).

Sometimes, there can be situations when the IMS log buffers are not filled up but for integrity purposes, we need to take the log records that are present in the log buffers and write them out to the DASD device because we don’t want to lose them. IMS doesn’t write out partially filled log buffers to the OLDS dataset. In such scenarios, IMS writes the log records present in the partially filled log buffers to the WADS dataset or Write Ahead Dataset. Thus, WADS is a temporary place where IMS writes out partially filled log buffers for integrity purposes. Once the log buffer fills up, they are written out to the OLDS dataset and the content on the WADS dataset is then no longer needed because all that information has already been recorded on the OLDS dataset.

Thus, at any given point in time, one OLDS dataset is always in use and the other OLDS datasets are either available or filled up and need to be or being archived into an SLDS dataset.