Troubleshooting
Problem
This document provides a method for finding all the journaled files on a system.
Resolving The Problem
To find all the journaled files on a system, you have the following options:
Option 1:
Use DSPFD to create an outfile.
DSPFD FILE(*USRLIBL/*ALL) TYPE(*MBR) OUTPUT(*OUTFILE) OUTFILE(QTEMP/JRNFILE)
Use the following SQL to query the outfile and list all the files that are currently journaled:
SELECT DISTINCT
trim(MBJRLB)||'/'||MBJRNM as Journal,
trim(MBLIB)||'/'||MBFILE as File,
CASE MBFTYP when 'L' then 'Logical'
when 'P' then 'Physical' end as Type_of_File,
MBTXT as Text
FROM QTEMP/JRNFILE
WHERE MBJRNL = 'Y'
trim(MBJRLB)||'/'||MBJRNM as Journal,
trim(MBLIB)||'/'||MBFILE as File,
CASE MBFTYP when 'L' then 'Logical'
when 'P' then 'Physical' end as Type_of_File,
MBTXT as Text
FROM QTEMP/JRNFILE
WHERE MBJRNL = 'Y'
NOTE: The Distinct is needed or you will get a listing for each member, which is not needed because journaling is at the file level.
Option 2:
Use the following SQL to query QSYS2/JOURNALED_OBJECTS view
SELECT JOURNAL_LIBRARY || '/' || JOURNAL_NAME as journal,
OBJECT_LIBRARY || '/' || OBJECT_NAME as file, FILE_TYPE
OBJECT_LIBRARY || '/' || OBJECT_NAME as file, FILE_TYPE
FROM qsys2.journaled_objects
WHERE OBJECT_TYPE = '*FILE'
NOTE: Remove OBJECT_TYPE = '*FILE' to see all objects journaled and not just files.
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CGIAA2","label":"IBM i Db2-\u003EJournal"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
478042046
Was this topic helpful?
Document Information
Modified date:
18 November 2024
UID
nas8N1013878