Where allowed to run: All environments (*ALL) Threadsafe: Yes |
Parameters Examples Error messages |
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), Stream Files (*STMF), Directories (*DIR), and Symbolic Links (*SYMLNK). Only objects of type *STMF, *DIR or *SYMLNK that are in the "root" (/), QOpenSys, and permanent user-defined file systems are supported. For more information about the possible journal entries which can be sent, see the Journal management topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. Search for "journal entry finder".
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:
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
OBJ | Objects | Values (up to 300 repetitions): Element list | Optional |
Element 1: Name | Path name | ||
Element 2: Include or omit | *INCLUDE, *OMIT | ||
OBJFID | File identifier | Values (up to 300 repetitions): Hexadecimal value | Optional |
JRN | Journal | Path name | Optional |
SUBTREE | Directory subtree | *NONE, *ALL | Optional |
PATTERN | Name pattern | Values (up to 20 repetitions): Element list | Optional |
Element 1: Pattern | Character value, * | ||
Element 2: Include or omit | *INCLUDE, *OMIT | ||
INHERIT | New objects inherit journaling | *NO, *YES | Optional |
IMAGES | Images | *AFTER, *BOTH | Optional |
OMTJRNE | Omit journal entry | *NONE, *OPNCLOSYN | Optional |
LOGLVL | Logging level | *ERRORS, *ALL | Optional |
Top |
Specifies a maximum of 300 objects for which changes are to be journaled. Only objects whose path name identifies an object of type *STMF, *DIR, *SYMLNK, *DTAARA or *DTAQ are supported.
Element 1: Name
A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. Symbolic links within the path name will not be followed. If the path name begins with the tilde character, then the path is assumed to be relative to the appropriate home directory.
Additional information about path name patterns is in the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Element 2: Include or omit
The second element specifies whether names that match the pattern should be included or omitted from the operation. Note that in determining whether a name matches a pattern, relative name patterns are always treated as relative to the current working directory.
Top |
Specifies a maximum of 300 file identifiers (FID) for which changes are to be journaled. FIDs are a unique identifier associated with integrated file system related objects. This field is input in hexadecimal format. Only objects whose FID identifies an object of type *STMF, *DIR, or *SYMLNK that is in the "root" (/), QOpenSys, or user-defined file systems, or objects of type *DTAARA or *DTAQ are supported.
Top |
Specifies the path name of the journal that receives the journaled changes.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Top |
Specifies whether the directory subtrees are included in the start journal operation.
Note: This parameter is ignored if the OBJ parameter is not specified.
Note: This parameter is ignored unless object-path-name is a directory (*DIR) object.
Once the command has begun processing a specific directory subtree, the objects which will be found and processed may be affected by operations that update the organization of objects within the specified directory tree. This includes, but is not limited to, the following:
In order to process the directory subtree, the system code may increase the process-scoped maximum number of file descriptors that can be opened during processing. This is done so that the command is not likely to fail due to a lack of descriptors. This process-scoped maximum value is not reset when the command completes.
Top |
Specifies a maximum of 20 patterns to be used to include or omit objects for the start journal operation.
Only the last part of the path name will be considered for the name pattern match. Path name delimiters are not allowed in the name pattern. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. Symbolic links within the path name will not be followed.
If this parameter is not specified, the default will be to match all patterns.
Additional information about path name patterns is in the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Note: This parameter is ignored if the OBJ parameter is not specified.
Note: This parameter applies to objects that exist when the start journal command is processed. This parameter does not apply to objects that will be created later in a journaled directory where new objects inherit journaling.
Element 1: Pattern
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Element 2: Include or omit
The second element specifies whether names that match the pattern should be included or omitted from the operation. Note that in determining whether a name matches a pattern, relative name patterns are always treated as relative to the current working directory.
Top |
Specifies whether new objects created within a journaled directory should inherit the journal options and the journal state of its parent directory.
Top |
Specifies the kinds of images that are written to the journal receiver for changes to objects.
Note: The value *BOTH is only valid for *DTAARA objects.
Top |
Specifies the journal entries that are omitted.
Note: The value *OPNCLOSYN is only valid for *DIR and *STMF objects.
Top |
Specifies the error logging level used. This parameter is used to determine which messages will be sent.
Top |
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/JRNLA.JRN'. None of the objects within the subdirectories of '/mypath' will be journaled.
Only the after images of updated records are written to the journal.
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.
Only the after images of updated records are written to the journal.
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'.
Only the after images of updated records are written to the journal.
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'.
Top |
*ESCAPE Messages
Top |