Example: Restore a directory after eliminating save-outage time

This example shows a typical restore procedure after you eliminate save-outage time in a directory. Your exact use of the function may differ, based on your specific application requirements.

Perform the following steps when restoring directory MyDirectory:

  1. Restore the directory with the following command:
    RST DEV('/QSYS.LIB/TAP01.DEVD') +
      OBJ('/MyDirectory') 

    At the completion of these restore commands, the objects exist on the server, but they will not be in a consistent state in relationship to each other.

  2. Restore the necessary journal receivers that were attached at the time the directory was. Use, a command such as the following to restore the receivers:
    RST DEV('/QSYS.LIB/TAP01.DEVD') +
      OBJ('receiver-path') 
  3. Determine a point in time, or application boundary, in which to bring the objects in MyDirectory. This way all of the objects are in a consistent state in relationship to each other. After determining the desired application boundary, you might need to restore additional journal receivers. If you need to restore additional journal receivers, but the receivers are not online, restore them with a restore command such as the following. Multiple restore commands may be necessary for this step:
    RST  DEV('/QSYS.LIB/TAP01.DEVD') +
      OBJ('receiver-path') 

    The Work with Journal Attributes (WRKJRNA) and Display Journal (DSPJRN) commands can be helpful in finding the application boundary.

    You can use the WRKJRNA command to determine the appropriate range of receivers you need for the ensuing Apply Journaled Changes (APYJRNCHG) operations. You can use the DSPJRN command to locate the exact sequence number that identifies the desired application boundary. If multiple journals are involved, you must locate the same application boundary (most likely identified by the timestamp) in each journal. You must also note the appropriate journal sequence number.

  4. Bring the objects forward to a specific application boundary with one of the following Apply Journaled Changes (APYJRNCHG) commands. Different variations of the APYJRNCHG command may be appropriate based on the given criteria.
    1. Use the commands below to apply the journaled changes to the objects if the following is true:
      • The objects were saved prior to V5R3.
      • You did not restore the journal.
      • The media used represent the most recent save of the objects
      • You saved the objects specifying UPDHST(*YES) on the save command.
      • If the above conditions are not met but you are using V5R3.
      APYJRNCHG JRN(jrnlib/jrnname) +
                OBJPATH(/MyDirectory) +
                SUBTREE(*ALL)+
                TOENT(seq#-for-application-boundary)

      If multiple journals are involved, then repeat these commands for each journal specifying the correct sequence number (TOENT parameter) that identifies the desired application boundary.

    2. Use the commands below to apply the journaled changes to the objects if the following is true
      • The objects were saved prior to V5R3.
      • You restored the journal.
      • The media used represent the most recent save of the objects.
      • You saved the objects specifying UPDHST(*YES) on the save command.
      APYJRNCHG JRN(jrnlib/jrnname) +
                OBJPATH(/MyDirectory) +
                SUBTREE(*ALL)+
                RCVRNG(rcv-attached-at-save-time +
                       ending-rcv) +
                TOENT(seq#-for-application-boundary)+
                

      In the situation where the journal is restored, and the journaled objects for which changes are going to be applied were saved prior to V5R3, the server cannot determine the correct receiver range. Therefore, the correct range of receivers must be specified on the RCVRNG parameter. The attached receiver at the time that the directory was saved is the specified starting journal receiver. If the journaled objects for which changes are going to be applied were saved in V5R3 or later, then the server can determine the correct receiver range when the default of RCVRNG(*LASTSAVE) is used. In this situation, the apply command from step a works correctly.

      If multiple journals are involved, then repeat these commands for each journal specifying the correct sequence number (TOENT parameter) that identifies the desired application boundary.

    3. If you are not using V5R3, do the following commands if the save-while-active media used does not represent the most recent save of the objects specifying UPDHST(*YES).
      1. Use the DSPJRN command to determine the sequence number of the start of save journal entry for each object.
      2. Issue an individual APYJRNCHG command for each of the objects.
      The following example demonstrates such an APYJRNCHG command:
      APYJRNCHG JRN(jrnlib/jrnname) +
                OBJPATH(/MyDirectory) +
                RCVRNG(rcv-attached-at-save-time +
                       ending-rcv) +
                FROMENT(seq#-for-save or start-of-save-entry) +
                TOENT(seq#-for-application-boundary)

      Because the most recent save of the objects is not being used, you cannot specify FROMENT(*LASTSAVE) on the APYJRNCHG command. You must specify an individual sequence number for directory MyDirectory

      Some of the APYJRNCHG commands could specify multiple objects if there is a continuous series of save or start-of-save entries in the journal. The objects identified by the continuous series of save or start-of-save journal entries could be applied to with a single APYJRNCHG command by specifying the earliest sequence number of all the save or start-of-save entries in the continuous series for the FROMENT parameter. If you are using V5R3, use the *LASTSAVE value in the FROMENT parameter.