Example: Restore libraries after eliminating save-outage time

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

Perform the following steps when restoring libraries LIB1 and LIB2:

  1. Restore the two libraries with the following commands:
    RSTLIB SAVLIB(LIB1) DEV(TAP01)
     
    RSTLIB SAVLIB(LIB2) DEV(TAP01)

    If the journals still exist on the system, they are not restored. That is not a problem.

    If they did not exist, the server will restore the journal objects before the other objects.

    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 libraries were saved. If the journal receivers are in libraries other than LIB1 or LIB2 at the time of the save and they do not currently exist on the server, use the following restore command to restore the receivers:
    RSTOBJ OBJ(attached-receiver-at-save-time) +
           SAVLIB(receiver-library) +
           DEV(TAP01)

    If the attached receivers were in LIB1 or LIB2 when you saved the data and they did not exist prior to the RSTLIB operation, they were restored as part of that RSTLIB operation.

  3. Determine a point in time, or application boundary, in which to bring the objects in LIB1 and LIB2. 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 the following restore command. Multiple restore commands may be necessary for this step:
    RSTOBJ OBJ(other-needed-receivers) +
           SAVLIB(receiver-library) +
           DEV(TAP01)

    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.

    If any objects received changes during the save operation, and they were under commitment control, the commitment boundaries will be preserved on the following APYJRNCHG commands. If you do not want the commitment control boundaries preserved, then you specify CMTBDY(*NO) on the following APYJRNCHG commands:

    1. Use the commands below to apply the journaled changes to the objects if the following is true:
      • The journaled objects for which changes are to be applied were saved in V5R3.
      • You did not restore the journal (which is not a problem) because the objects were being restored to the system from where they were saved.
      • 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) +
                OBJ((LIB1/*ALL)) +
                TOENT(seq#-for-application-boundary)
       
      APYJRNCHG JRN(jrnlib/jrnname) +
                OBJ((LIB2/*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. Note that the TOENT sequence number is very likely different for each journal in LIB1 and LIB2, but they all identify a common 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) +
      			  OBJ((LIB1/*ALL)) +
                RCVRNG(rcv-attached-at-save-time +
                       ending-rcv) +
                TOENT(seq#-for-application-boundary)
       
      APYJRNCHG JRN(jrnlib/jrnname) +
                OBJ((LIB2/*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. Note that the attached receiver at the time that the libraries were saved is the specified starting journal receiver.

      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. Note that the TOENT sequence number is very likely different for each journal in LIB1 and LIB2, but they all identify a common application boundary. 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.

    3. If your objects were saved prior to V5R3 and the save-while-active media used does not represent the most recent save of the objects specifying UPDHST(*YES), do the following commands.
      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) +
                OBJ((filelib/filename filembr)) +
                RCVRNG(rcv-attached-at-save-time +
                       ending-rcv) +
                FROMENT(seq#-for-start-of-save-entry) +
                TOENT(seq#-for-application-boundary)

      If you are prior to V5R3 and the most recent save of the objects are not being used, FROMENT(*LASTSAVE) cannot be specified on the APYJRNCHG commands. An individual sequence number must be specified for each of the objects in libraries LIB1 and LIB2.

      Some of the APYJRNCHG commands could specify multiple objects if there is a continuous series of start-of-save entries in the journal. The members identified by the continuous series of start-of-save journal entries could be applied to with a single APYJRNCHG command by specifying the earliest sequence number of all the 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.