CL Command Reference - STRJRN
CL Command List > STRJRN Reference
Description:
The Start Journal (STRJRN) command is used to start journaling changes (made to an object or list of objects) to a specific journal. The object types which are supported through this interface are Data Areas (*DTAARA), Data Queues (*DTAQ), Byte Stream Files (*STMF), Directories (*DIR), and Symbolic Links (*SYMLNK). Only objects of type *STMF, *DIR or *SYMLNK that are in the ¡åroot¡å (/), QOpenSys, and user-defined file systems are supported.
The user can specify that only the after image or both the before and the after images of an object of type *DTAARA be journaled. Before images are necessary to remove journaled changes using the Remove Journaled Changes (RMVJRNCHG) command.
After journaling begins for the object, the user should save the journaled object to preserve its journal attribute information. Also, the object must be saved because, for example, journaled changes cannot be applied to a version of the object that was saved before journaling was in effect.
For other ways to start journaling see the following commands:
. Access Paths - Start Journal Access Path (STRJRNAP)
. Physical Files - Start Journal Physical File (STRJRNPF)
. Other Objects - Start Journal Object (STRJRNOBJ)
Restrictions:
. The object must not be journaling changes to another journal.
. The maximum number of objects that can be associated with one journal is either 250,000 or 10,000,000. To get 10,000,000, the value of *MAX10M must have been specified for the JRNOBJLMT parameter on either the Create Journal (CRTJRN) command or on the Change Journal (CHGJRN) command. If the number of objects is larger than this maximum, journaling does not start.
. The specified journal must be a local journal. Although all object types which can be journaled to a local journal can also have their changes sent to a remote journal, this is accomplished by a two step process. First start journaling to the local journal. Then connect the local journal to a remote instance. To initiate such a connection, use the Add Remote Journal (ADDRMTJRN) command or the Add Remote Journal (QjoAddRemoteJournal) API.
. The specified journal and object must reside in the same Auxiliary Storage Pool (ASP).
. Byte stream files that are currently memory mapped, are virtual volume files, or are being used as IXS network storage spaces cannot be journaled.
. Objects that are internally marked as not eligible for journaling cannot be journaled. The system may mark system working directories that are created inside of user directories as not eligible for journaling.
. For data areas, only local external data area objects may be journaled. The special data areas (*LDA, *GDA, *PDA) and DDM data areas cannot be journaled.
. For data queues, only local data queues are supported. DDM data queues cannot be journaled.
. At least one of parameter OBJ or OBJFID must be specified.
Examples:
Example 1: Start Journaling with Omit of Directory
STRJRN OBJ((¡¯/mypath¡¯ *INCLUDE) (¡¯/mypath/myobject¡¯ *OMIT))
JRN(¡¯/QSYS.LIB/MYLIB.LIB/JRNLA.JRN¡¯)
This command journals all changes to all objects supported by this command within the first-level of directory ¡¯/mypath¡¯ except ¡¯/mypath/myobject¡¯ to journal ¡¯/QSYS.LIB/MYLIB.LIB/JRNA.JRN¡¯. None of the objects within the subdirectories of ¡¯/mypath¡¯ will be journaled.
Example 2: Start Journaling with Pattern Matching
STRJRN OBJ((¡¯/mypath¡¯ *INCLUDE) (¡¯/mypath/myobject.txt¡¯ *OMIT))
JRN(¡¯/QSYS.LIB/MYLIB.LIB/JRNLA.JRN¡¯) SUBTREE(*ALL)
PATTERN((¡¯*.TXT¡¯ *INCLUDE)) OMTJRNE(*OPNCLOSYN)
This command journals changes to all objects that match pattern ¡¯*.txt¡¯ in directory ¡¯/mypath¡¯ except object ¡¯/mypath/myobject.txt¡¯. The open, close and force entries are not journaled.
Example 3: Start Journaling with Omit by Pattern
STRJRN OBJ((¡¯/mypath/my*¡¯ *INCLUDE)) JRN(¡¯/QSYS.LIB/MYLIB.LIB/JRNLA.JRN¡¯)
PATTERN((¡¯*.DTA*¡¯ *OMIT))
This command journals changes to all objects within the first-level directories that match the pattern for path ¡¯/mypath/my*¡¯ and will omit all objects that match pattern ¡¯*.DTA*¡¯ (objects of type *DTAARA and *DTAQ).
Only the after images of updated records are written to the journal.
Example 4: Start Journaling using File Identifiers
STRJRN OBJFID(00000000000000007E09BDB000000009 00000000000000009E09BDB00000000A)
JRN(¡¯/QSYS.LIB/MYLIB.LIB/JRNLA.JRN¡¯)
This command journals all changes to the objects represented by the specified file identifiers to journal ¡¯/QSYS.LIB/MYLIB.LIB/JRNLA.JRN¡¯.
Example 5: Start Journaling on a Set of Data Queues
STRJRN OBJ((¡¯/QSYS.LIB/MYLIB.LIB/MYDATA*.DTAQ¡¯))
JRN(¡¯/QSYS.LIB/MYLIB.LIB/MYJRN.JRN¡¯)
This command starts the journaling of all changes to the objects of type *DTAQ in library MYLIB that begin with the characters ¡¯MYDATA¡¯.