Deleting a journal

In some situations, you must delete a journal as part of your recovery.

For example, the journal might be damaged, or a journal in a basic auxiliary storage pool (ASP) might have overflowed into the system ASP. You cannot delete a journal while objects are being journaled to it.

You use the Delete Journal (DLTJRN) command to delete a journal. Before deleting a journal, try to do the following steps. You might not be able to perform these steps successfully if the journal is damaged.

  1. Type
    WRKJRNA JRN(library-name/journal-name)
    OUTPUT(*PRINT)

    and press the Enter key. You receive a listing that shows all the objects that are currently being journaled.

  2. End journaling for all the access paths assigned to the journal by typing the following command:
    ENDJRNAP FILE(*ALL)
    JRN(library-name/journal-name)
  3. End journaling for all the physical files assigned to the journal by typing the following command:
    ENDJRNPF FILE(*ALL)
    JRN(library-name/journal-name)
  4. End journaling for all the integrated file system objects assigned to the journal by typing the following command:
    ENDJRN OBJ(*ALL)
    JRN(/QSYS.LIB/library-name.LIB/journal-name.JRN)
  5. Save the inheritance rules associated with all libraries assigned to the journal by using the following command:
    DSPLIBD  LIB(library-name) OUTPUT(*PRINT)
  6. End journaling for all the libraries assigned to the journal by typing the following command:
    ENDJRNLIB  LIB(*ALL) JRN(library-name/journal-name)
  7. End journaling for all other object types assigned to the journal by typing the following command:
    ENDJRNOBJ OBJ(*ALL) OBJTYPE(*ALL)
    JRN(library-name/journal-name)
  8. Deactivate any remote journals that are associated with the journal by using the Change Journal State (QjoChangeJournalState) API or the Change Remote Journal (CHGRMTJRN) command.

When you try to delete the journal, you might receive message CPF7021 indicating that the journal is being used for commitment control. If this occurs, end the jobs that are using commitment control and then try to delete the journal again. To see the commitment control uses of the journal use the Work with Journal Atrributes (WRKJRNA) command, function key 19 (F19=Display journaled objects), and option 6 (6=Commitment Definitions). You can use the End Job (ENDJOB) command or you can use the End option from the Work with Active Jobs (WRKACTJOB) display.

After you restore the journal or create it again, you must start journaling again for each object. Use the following commands to begin journaling for each object type listed below:

  • Database physical files — STRJRNPF
  • Access paths — STRJRNAP
  • Integrated file system objects — STRJRN
  • Libraries — STRJRNLIB (Use the inheritance rules that you obtained earlier with the DSPLIBD command.)
  • All other object types — STRJRNOBJ

You should save the objects after you start journaling, in case the system assigned a new journal identifier (JID) to an object. If you previously had any remote journals associated with the journal, add them again by using the Add Remote Journal (ADDRMTJRN) command or the Add Remote Journal (QjoAddRemoteJournal) API. If you added any remote journals, you should save the journal in order to preserve that information.