Task 5: Applying journaled changes for user journals
If you need to apply journaled changes from user journals, perform this task.
If you do not need to apply journaled changes, skip to Task 6: Applying journaled changes for the QAOSDIAJRN journal.
- If you have a single receiver chain for the journal
entries that you need to apply and the status of the last receiver
you are using is
SAVED
, perform one of the following tasks:- To apply journaled changes to objects
in a library, type the following command:
APYJRNCHG JRN(library-name/journal-name) OBJ((library-name/*ALL *ALL)) RCVRNG(*LASTSAVE) FROMENT(*LASTSAVE) TOENT(*LAST)
If journal entries exist for the creation of a file, data area, or data queue, those objects are re-created. Use the APYLF parameter to specify whether to apply changes to the logical files that are built over the changed physical files.
To apply entries to all objects in all libraries that are journaled to the journal, type the following command:APYJRNCHG JRN(library-name/journal-name) OBJ((*ALLJRNOBJ)) RCVRNG(*LASTSAVE) FROMENT(*LASTSAVE) TOENT(*LAST)
- For objects in directories, type the following command:
APYJRNCHG JRN(jrnlib/jrnname) OBJPATH('object-path-name') RCVRNG(*LASTSAVE) FROMENT(*LASTSAVE) TOENT(*LAST)
Note: If you want to apply journaled changes to library and directory objects using the same command, you can use both the OBJ and OBJPATH parameters in one Apply Journaled Changes (APYJRNCHG) command invocation. - If you have restored objects with partial transactions,
but you do not have any journal receivers more recent than the receiver
that contains the save entries, you have the option to remove journal
changes to resolve the partial transaction. The following command removes the changes in journal JRN1 from all the members of OBJ1:
Starting with the last save journal entry, only changes for journal entries for any partial transactions are removed, back to the start of the commit transaction.RMVJRNCHG JRN(JRN1) FILE(LIB1/OBJ1) FROMENT(*LASTSAVE) TOENT(*COMMITSTART) RCVRNG(*LASTSAVE)
- If you are unable to complete the previous steps for
objects with partial transactions because the journal receivers are
unavailable, you can use the Change Journaled Object (CHGJRNOBJ) command
to get the object to a usable state. The Partial Transactions (PTLTNS) parameter allows the object to be used, but does not complete the transactions. In the example below, the object, BRKNOBJ, still has changes caused by the partial transactions, but you are able to open the file.Attention: Only use the following command as a last resort. You will lose data if you use this command. You should only use this command for the following reasons:
- You have objects with partial transactions as a result of the terminations of a long-running rollback and you have no saved version to restore.
- You have objects with partial transactions as a result of a save-while-active operation, and the journal receivers required to apply or remove journaled changes have been lost, destroyed, or damaged beyond repair.
CHGJRNOBJ OBJECT(LIB1/BRKNOBJ *FILE) ATR(*PTLTNS) PTLTNS(*ALWUSE)
- To apply journaled changes to objects
in a library, type the following command:
- If you have determined that this journal had
receiver chain breaks, you must decide whether you are actually missing
journal receivers and necessary journal entries or whether the chain
breaks were caused by something else. You should evaluate how applying journaled changes across a chain break might affect the integrity of your data.
If you decide to apply journal entries across chain breaks, you must use a APYJRNCHG command for each chain. Type the APYJRNCHG command and use these values in place of the values shown in step 1.
For the first (earliest) receiver chain, the following parameters apply:
- RCVRNG
- First and last receivers in this chain
- FROMENT
- *LASTSAVE
- TOENT
- *LAST
For each middle receiver chain, the following parameters apply:
- RCVRNG
- First and last receivers in this chain
- FROMENT
- *FIRST
- TOENT
- *LAST
For the last receiver chain, the following parameters apply:
- RCVRNG
- First and last receivers in this chain
- FROMENT
- *FIRST
- TOENT
- *LAST