Restoring journaled objects

This section describes options for restoring journaled objects (for example, libraries, data areas, data queues, database files, and integrated file system objects), and using journaling options in the QDFTJRN data area.

You can journal the following types of objects:

  • Access paths
  • Data areas
  • Database files
  • Data queues
  • Libraries
  • Materialized query tables
  • Stream files
  • Directories
  • Symbolic links

If the journal exists on the system before the journaled objects are restored, all objects that were saved while being journaled are journaled again if one of the following situations is true:

  • The objects are not on the system at restore time.
  • The objects are on the system and journaling was not ended for the objects.

Start of changeIf the journal is not on the system when a journaled object is restored, the restore operation for the object sends a warning message and journaling is not resumed. This warning message causes an escape message to be sent at the end of the restore operation. If you specify a value for the Defer ID (DFRID) parameter on the restore command, you can use the Restore Deferred Objects (RSTDFROBJ) command when the journal is available to start journaling for the objects.End of change

Start of changeIf you do not want to start journaling for the restored objects, specify *NO for the Start journaling (STRJRN) parameter on the restore command.End of change

Journaled libraries

You can journal libraries like any other object. Journaling can start automatically for objects such as database files, data areas, and data queues that are created, moved into, or restored into a journaled library. The library's inheritance rules determine which objects to start journaling automatically and with what journaling attributes. The inheritance rules are saved and restored with the library. When you restore a library that does not already exist on the system, you also restore the inheritance rules for that library.

You can replay changes to libraries by using the Apply Journaled Changes (APYJRNCHG) command. To start journaling for a library, use the Start Journal Library (STRJRNLIB) command.

When you restore an object in a library that was being journaled at the time of the save operation, an entry is written to the journal used during save time to indicate that the object was restored. When you restore a new library, journaling information also is restored. After all objects in the library are restored, journaling is started for the library.

There are a few considerations to keep in mind when saving and restoring journaled libraries:
  • You can save and restore journaling information for libraries, as well as other object types.
    • If the library is restored over an existing library, the journaling state and attributes of the library do not change.
    • If the library is restored to a different name and the library was journaled when it was saved, the system starts journaling the library to the same journal when it is restored.
    • If the library was not journaled when it was saved, any past journaling information is also restored.
    • Libraries are restored first, but do not start journaling until after all objects have been restored into the library.
  • You can save and restore inheritance rules for libraries.
  • If you save a library to IBM® i V5R4, or earlier, the library's journaling information is not saved.

Journaling options in the QDFTJRN data area

The following information that describes using the QDFTJRN data area also applies to using a journaled library. You can define the inheritance rules that are associated with the journaled library to start journaling an object when it is restored. Alternatively, you can define the inheritance rules to use the *RSTOVRJRN keyword and journal the restored object to the library's journal rather than the object's save-time journal.

You also can use the Start Journal Library (STRJRNLIB) command to specify inheritance rules that can be associated with a journaled library. If a library is journaled and also contains the QDFTJRN data area, the QDFTJRN data area options take precedence and the journaled library inheritance rules are ignored.

The QDFTJRN data area provides more options for journaling during the restore operation. You can define the information in the QDFTJRN data area to start journaling automatically. Thus, even if an object was not journaled during save time, the operating system automatically records the restore operation to the journal specified in the QDFTJRN data area and journals the object to that journal. However, if the object was journaled at save time and that journal still exists on the system, the journal specified in the QDFTJRN data area is ignored. In this case, the operating system still records the restore operation to the journal used during save time.

You can use the *RSTOVRJRN keyword to override the journal used during save time. After you specify the *RSTOVRJRN keyword in the QDFTJRN data area, the operating system records the restore operation to the journal that is specified in the QDFTJRN data area. In this case, the journal used during save time is ignored.

Note that when you use the Restore Library (RSTLIB) command to restore a library that contains the QDFTJRN data area, the objects in the library that were not journaled when saved are not journaled when restored. This situation remains true even if you have the *RSTOVRJRN keyword in the QDFTJRN data area specified for the library.

After you changed the journal of your object using the *RSTOVRJRN keyword, save your object as soon as possible to enable future recovery operations with the Apply Journaled Changes (APYJRNCHG), Apply Journaled Changes Extend (APYJRNCHGX), and Remove Journaled Changes (RMVJRNCHG) commands. The save operation lists the journal receiver for the new journal as the journal receiver to use for recovering your object from the point of its last save. The save operation also updates the last saved date of your object.

Note: The QDFTJRN data area object indication that journaling should be automatically started is only intended for objects in a library that can be journaled. It is not intended for integrated file system objects.