A few Fridays ago we talked about journaling as the way to recover to the moment of failure instead of just to last night’s save. Today, the natural next step: actually reading what the journal captured.
Most people think of journals purely as a recovery mechanism, something the system uses behind the scenes during an apply. But a journal is also the single best record you have of what actually happened to your data, and you can read it directly with SQL.
SELECT ENTRY_TIMESTAMP, JOURNAL_CODE, JOURNAL_ENTRY_TYPE,
OBJECT_LIBRARY, OBJECT_NAME,
CURRENT_USER, JOB_NAME
FROM TABLE(QSYS2.DISPLAY_JOURNAL(
'YOURLIB', 'YOURJRN',
STARTING_TIMESTAMP => CURRENT TIMESTAMP - 24 HOURS))
ORDER BY ENTRY_TIMESTAMP DESC;
That reads the last 24 hours of a journal and shows you every recorded change, who made it, and from what job.
Think about what that answers. Who deleted those records yesterday? What job updated that file at 3am? When exactly did the bad data first appear? These are questions that turn into hours of detective work without a journal, and into a single query with one. It is the closest thing IBM i has to a security camera pointed at your most important data.
So journaling earns its keep twice. It protects you at recovery time, and it tells you the truth about what happened the rest of the time. If your critical files are journaled, you already own this capability. You just have to know it is there.
Make sure your important files are journaled, get comfortable reading those journals, and you will never again have to shrug when someone asks what happened to the data. Don’t forget to manage the journal receivers, or you will fill up your system.
Have a wonderful weekend.
#IBMi #Backup #DisasterRecovery #PowerSystems
Originally posted on LinkedIn. Join the conversation there.
Leave a Reply