Starting journaling
This topic provides information about how to start journaling for all object types.
After you have created the journal and journal receiver, you can start journaling. When journaling has been started for an object, the system writes journal entries for all changes to the object.
The start journal command must obtain an exclusive lock on the object. However, for database physical files and integrated file system objects, you can start journaling even if an object is open. The recommended procedure for starting journaling is:
- Start journaling the object.
- Save the object. If the object is open for changing, this will be a save-while-active type save.
If you are not using the save-while-active function, it is highly recommended that you update the history for the object when you save it so that processing for applying and removing journaled changes will have the best information for verification. If you saved the object using the SAV command, the default value is to not preserve the update history. Therefore, change the UPDHST value to something other than *NO.
For the other save related commands, the default value is to preserve the update history. When using save-while-active, updating the history for the object is not needed for verification when applying and removing journaled changes. In this case, information is saved on media with the object, and restored when the object is restored. This extra information provides the last save information for applying and removing journaled changes.
Normally, only the definition of a data queue is saved, not its contents. To save the contents of the queue as well, one must specify QDTA(*DTAQ) on the save commands.
The maximum number of objects that can be associated with one journal is either 250 000 or 10 000 000. The option of setting the journal object limit to 10 000 000 simplifies journaling because there are fewer journals to manage, but allows for less parallelism during IPL and disaster recovery. You can also have all objects created within a subdirectory start journaling automatically without having to be broken up when you reach the 250 000 limit. The value *MAX10M can only be specified for the Journal Object Limit (JRNOBJLMT) parameter if the Receiver Size Option (RCVSIZOPT) parameter has one of the *MAXOPT values specified or if RCVSIZOPT is *SYSDFT.
The following links provide instructions to start journaling for each object type:
- Journaling database physical files (tables)
When you start journaling a physical file (table), you specify whether you want after-images saved, or both before-images and after-images.- Journal DB2 Multisystem files
When you successfully start journaling on a distributed file, the system distributes the start journal request to the other servers in the node group.- Journaling integrated file system objects
You can journal integrated file system objects if they are in the "root"(/), QOpenSys, and user-defined file systems.- Journal access paths
After you have started journaling for physical files, you can set up explicit journaling of access paths.- Journaling data areas and data queues
When you start journaling for a data area or a data queue, the system writes journal entries for all changes to the data area or data queue.- Automatically starting journaling
Using a data area named QDFTJRN, you can automatically start journaling when a non-integrated file system object (data area, data queue, or file) is created, moved, or restored into the library, thus, ensuring the very first change to the object will be recorded in the journal and that no lock on the user's part prevents journaling from starting in the library. The QDFTJRN data area must exist in the library where the object is being added.
Parent topic:
Starting and ending journaling and changing journaling attributes