| Where allowed to run: All environments (*ALL) Threadsafe: Yes |
Parameters Examples Error messages |
The Change Journaled Object (CHGJRNOBJ) command changes the journaling attributes of a journaled object without the need to end and restart journaling for the object.
The command can be used to change the Images (IMAGES) value for a database file (*FILE) or a data area (*DTAARA) object without the need to end and restart journaling for the object. Otherwise the Start Journal Physical File (STRJRNPF) command can be used to set this value for database files. The Start Journal (STRJRN) command or the Start Journal Object (STRJRNOBJ) command can be used to set this value for data areas.
The command can be used to change the Omit journal entry (OMTJRNE) value for a database file (*FILE), an integrated file system stream file (*STMF) or directory (*DIR) object without the need to end and restart journaling for the object. Otherwise the Start Journal Physical File (STRJRNPF) command can be used to set this value for database files. The Start Journal (STRJRN) command can be used to set this value for integrated file system objects.
The command can be used to change the New objects inherit journaling (INHERIT) value for an integrated file system directory (*DIR) object without the need to end and restart journaling for the object. Otherwise the Start Journal (STRJRN) command can be used to set this value for integrated file system objects.
The command can be used to allow a database file (*FILE), that contains changes for partial transactions, to be used. Partial transactions can only exist for an object that can be changed under commitment control. Database file objects (*FILE) are the only objects that can be opened using commitment control.
Partial transactions can exist for two reasons:
The command can be used to change the Inherit rules (INHRULES) value for a library (*LIB) without the need to end and restart journaling for the library. Otherwise the Start Journal Library (STRJRNLIB) command can be used to set this value for libraries. Use the Display Library Description (DSPLIBD) command to see the current inherit rules of a library.
The command can be used to change the Remote journal filter (RMTJRNFTR) value for an object.
If a change does not apply to an object type, the objects of that type are ignored and processing continues with the next object. Also, if the object already has the correct value for the attribute being changed no error will be returned.
Restrictions:
The object being modified is locked with a read exclusive lock (*EXCLRD).
| Top |
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| OBJ | Objects | Values (up to 300 repetitions): Element list | Optional |
| Element 1: Object | Qualified object name | ||
| Qualifier 1: Object | Generic name, name, *ALL | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
| Element 2: Object type | *FILE, *DTAARA, *DTAQ, *LIB | ||
| OBJPATH | 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 |
| 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 | ||
| ATR | Attribute | *IMAGES, *OMTJRNE, *INHERIT, *PTLTNS, *INHRULES, *RMTJRNFTR | Optional |
| IMAGES | Images | *SAME, *AFTER, *BOTH | Optional |
| OMTJRNE | Omit journal entry | *SAME, *NONE, *OPNCLOSYN | Optional |
| INHERIT | New objects inherit journaling | *SAME, *NO, *YES | Optional |
| PTLTNS | Partial transactions | *SAME, *ALWUSE | Optional |
| INHRULES | Inherit rules | Single values: *SAME Other values (up to 20 repetitions): Element list |
Optional |
| Element 1: Object type | *ALL, *FILE, *DTAARA, *DTAQ | ||
| Element 2: Operation | *ALLOPR, *CREATE, *MOVE, *RESTORE, *RSTOVRJRN | ||
| Element 3: Rule action | *INCLUDE, *OMIT | ||
| Element 4: Images | *OBJDFT, *AFTER, *BOTH | ||
| Element 5: Omit journal entry | *OBJDFT, *NONE, *OPNCLO | ||
| Element 6: Remote journal filter | *OBJDFT, *NO, *YES | ||
| Element 7: Name filter | Generic name, name, *ALL | ||
| RMTJRNFTR | Remote journal filter | *SAME, *NO, *YES | Optional |
| Top |
Specifies an object or list of objects for which their journaling attributes are to be changed.
Element 1: Object
Qualifier 1: Object
Qualifier 2: Library
Element 2: Object type
Specify the object type of the object that is to have its journaling attributes changed.
| Top |
Specifies a maximum of 300 objects for which journaling attributes are to be changed. Only objects whose path name identifies an object of type *STMF, *DIR, or *SYMLNK that is in the "root" (/), QOpenSys, or user-defined file systems, or objects of type *FILE, *DTAARA, *DTAQ, or *LIB are supported. Objects found that match the specified selection criteria but are not currently being journaled are ignored.
Element 1: Name
Symbolic links within the path name will not be followed.
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 path name or a 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 (FIDs) for which journaling attributes are to be changed. 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 *FILE, *DTAARA, *DTAQ, or *LIB are supported.
| Top |
Specifies whether the directory subtrees are included in determining the objects for which journaling attributes are to be changed.
Note: This parameter is only valid if one or more path names were specified on the Objects (OBJPATH) parameter.
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 which journaling attributes are to be changed.
Note: This parameter is only valid if one or more path names were specified on the Objects (OBJPATH) parameter.
Note: This parameter applies to objects that exist when the change journal object 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
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 which attribute will be selected to be changed.
| Top |
Specifies the kinds of images that are written to the journal receiver for changes to objects.
Note: The value *BOTH is ignored for all object types except data area (*DTAARA) and database file (*FILE) objects.
| Top |
Specifies the journal entries that are omitted.
Note: The value *OPNCLOSYN is ignored for all object types except *FILE, *DIR and *STMF objects.
Note: The value *OPNCLOSYN is the same as OMTJRNE(*OPNCLO) on the Start Journal Physical File (STRJRNPF) command for *FILE objects.
| Top |
Specifies whether new objects created within a journaled directory, moved into a journaled directory, or restored into a journaled directory should inherit the journal state of the parent directory.
Note: The INHERIT parameter is ignored for all object types except *DIR objects.
| Top |
Specifies whether an object that contains changes for partial transactions can be used or not.
Note: The PTLTNS parameter is ignored for all object types except *FILE objects.
Note: All object (*ALLOBJ) special authority is required if *ALWUSE is specified.
| Top |
Specifies which objects created within a journaled library, moved into a journaled library, or restored into a journaled library should inherit the journal state of the library and which journaling attributes those objects should have.
Each rule defines object types, object names, and operations that the rule applies to. Multiple rules can be defined for the same set of objects. If multiple rules are defined for the same object and operation, the last rule defined for that object will be applied.
These rules only affect objects when they are created, moved into, or restored into the library. The journaling state and journaling attributes of objects within the library do not change if they are renamed. Once journaled, objects will not automatically end journaling if they are moved out of the library. Additionally, objects that are journaled prior to being moved into the library will not change their journaling state or attributes when they are moved.
Note: If a data area named QDFTJRN exists within the library, no objects created, moved, or restored into the library will inherit the journal state of the library. Objects created, moved, and restored into the library will automatically start journaling based on the data area information.
Single values
Element 1: Object type
Specify the object type of the objects that are identified by this rule.
Element 2: Operation
Specifies the operation or operations identified by this rule.
If the accompanying rule action is set to *OMIT and the object is not restored over an existing object, the restored object will retain the same journal state and journaling attributes as it had when it was saved. The journal state of the library is ignored.
If the accompanying rule action is set to *OMIT and the object is not restored over an existing object, the restored object will retain the same journal state and journaling attributes as it had when it was saved. The journal state of the library is ignored.
Element 3: Rule action
Specifies whether or not the objects that match object type and operation in this rule will be included or omitted from the list of objects that inherit the journal state of the library.
Element 4: Images
Specifies the kinds of images that are written to the journal receiver for changes to objects that inherit the journal state of the library.
Note: This element is ignored if *OMIT is specified for Rule action.
Note: The value *BOTH is only valid for data area (*DTAARA) and database file (*FILE) objects. If *BOTH is specified and *ALL is specified for Object type, the system will generate both before and after images for data areas and database files. All other object types will only generate after images.
Element 5: Omit journal entry
Specifies the journal entries that are omitted for objects that inherit the journal state of the library.
Note: This element is ignored if *OMIT is specified for Rule action.
Note: The value *OPNCLO is only valid for database files (*FILE). If *OPNCLO is specified and *ALL is specified for Object type, database files will omit open and close entries. All other object types will not omit any journal entries.
Element 6: Remote journal filter
Specifies whether or not the journal entries deposited for the objects that inherit the journal state of the library should be eligible for remote journal filtering by object.
See the Change Remote Journal (CHGRMTJRN) command or the Change Journal State (QjoChangeJournalState) API for more information about remote journal filtering.
Note: This element is ignored if *OMIT is specified for Rule action.
Element 7: Name filter
Specifies the object names of the objects that are identified by this rule.
Note: A generic name is specified as a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, then all objects that have names with the same prefix as the generic object name are selected.
| Top |
Specifies whether or not the journal entries deposited for objects should be eligible for remote journal filtering by object.
See the Change Remote Journal (CHGRMTJRN) command or the Change Journal State (QjoChangeJournalState) API for more information about remote journal filtering.
Note: The value *YES is ignored for all object types except data area (*DTAARA), data queue (*DTAQ), and database file (*FILE) objects.
| Top |
Example 1: Change File Journaling Attribute IMAGES
CHGJRNOBJ OBJ((LIBA/FILEA *FILE)) ATR(*IMAGES) IMAGES(*BOTH)
This command will change the attribute of file FILEA in library LIBA to now journal both before and after images for the file without having to end journaling and start journaling of the file.
Example 2: Change File Journaling Attribute OMTJRNE
CHGJRNOBJ OBJ((LIBB/FILEB *FILE)) ATR(*OMTJRNE)
OMTJRNE(*OPNCLOSYN)
This command will change the attribute of file FILEB in library LIBB to now omit open and close entries.
Example 3: Change Object Journaling Attribute OMTJRNE
CHGJRNOBJ OBJFID(00000000000000007E09BDB000000009)
ATR(*OMTJRNE) OMTJRNE(*OPNCLOSYN)
This command will change the attribute of the object represented by the specified file identifier to now omit open, close and force entries. This object can be an object of type *DIR or *STMF.
Example 4: Change File Attribute PTLTNS
CHGJRNOBJ OBJ((LIBC/FILEC *FILE)) ATR(*PTLTNS)
PTLTNS(*ALWUSE)
This command will change the file so that it can be used again, however the partial transactions are not themselves completed. This method should only be used in rare circumstances when the file could not be recovered by applying or removing the journaled changes.
Example 5: Change Library Journaling Attribute INHRULES
CHGJRNOBJ OBJ((LIBD *LIB)) ATR(*INHRULES)
INHRULES((*FILE *CREATE *INCLUDE *BOTH *NONE *NO
*ALL))
This command will change the inherit rules of the library so that all database files created in library LIBD will automatically start journaling to the same journal as LIBD is journaled to. The files will be journaled with IMAGES(*BOTH), OMTJRNE(*NONE), and RMTJRNFTR(*NO).
Example 6: Change File Journaling Attribute RMTJRNFTR
CHGJRNOBJ OBJ((LIBE/FILEE *FILE)) ATR(*RMTJRNFTR)
RMTJRNFTR(*YES)
This command will change the attribute of file FILEE in library LIBE to allow entries deposited for this file to be filtered by remote journal filtering by object.
| Top |
*ESCAPE Messages
| Top |