Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Start Journal Library (STRJRNLIB) command is used to start journaling changes (made to a library or list of libraries) to a specific journal, and optionally to start journaling changes to objects within the library or list of libraries. Objects created in, moved into, or restored into a journaled library may be automatically journaled to the same journal the library is journaled to. For more information about 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".
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.
Objects created, moved, or restored into the library that are eligible for journaling may automatically start journaling to the same journal as the library. Which objects inherit the journal state of the library and what journaling attributes they start journaling with are determined by the inherit journaling attributes of the library.
Use the Display Library Description (DSPLIBD) command to display journal information including the inherit rules for the library.
For other ways to start journaling see the following commands:
Restrictions:
The library to start journaling is locked with a read exclusive lock (*EXCLRD).
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
LIB | Library | Values (up to 300 repetitions): Generic name, name | Required, Positional 1 |
JRN | Journal | Qualified object name | Required, Positional 2 |
Qualifier 1: Journal | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
INHRULES | Inherit rules | 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 | ||
LOGLVL | Logging level | *ERRORS, *ALL | Optional |
Top |
Specifies a maximum of 300 library names for which changes are to be journaled.
Top |
Specifies the journal that receives the journaled changes.
This is a required parameter.
Qualifier 1: Journal
Qualifier 2: Library
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.
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 the error logging level used. This parameter is used to determine which messages will be sent.
Top |
Example 1: Start Journaling a Single Library
STRJRNLIB LIB(MYLIBA) JRN(MYLIBA/JRN)
This command journals all changes to library MYLIBA to journal JRN in MYLIBA. Also, all objects that can be journaled that are created in, moved into, or restored into this library will automatically start journaling to journal JRN in MYLIBA.
Example 2: Start Journaling a Library and Selectively Inherit Journaling
STRJRNLIB LIB(MYLIBC) JRN(MYLIBC/JRN) INHRULES((*FILE *ALLOPR *INCLUDE *BOTH *OPNCLOSYN) (*DTAARA *CREATE *INCLUDE *OBJDFT *OBJDFT))
This command journals all changes to library MYLIBC to journal JRN in MYLIBC. All files that are created in, moved into, or restored into library MYLIBC will have journaling started to journal JRN in library MYLIBC, and will generate both before and after images and will omit open and close entries. All data areas that are created in library MYLIBC will have journaling started.
Example 3: Start Journaling a Library and Selectively Inherit Journaling with Omit
STRJRNLIB LIB(MYLIBD) JRN(MYLIBA/JRN) INHRULES((*ALL *ALLOPR *INCLUDE *OBJDFT *OBJDFT *OBJDFT) (*FILE *CREATE *OMIT) (*FILE *RESTORE *OMIT))
This command journals all changes to library MYLIBD to journal JRN in MYLIBA. All objects that can be journaled that are created in, moved into, or restored into library MYLIBD will have journaling started to journal JRN in MYLIBA, except any files that are created or restored into the library.
Example 4: Start Journaling a Library and Selectively Inherit Journaling with Omit and Name Filtering
STRJRNLIB LIB(MYLIBD) JRN(MYLIBA/JRN) INHRULES((*ALL *ALLOPR *INCLUDE *OBJDFT *OBJDFT *OBJDFT *ALL) (*FILE *ALLOPR *OMIT *OBJDFT *OBJDFT *OBJDFT W*))
This command journals all changes to library MYLIBD to journal JRN in MYLIBA. All objects that can be journaled that are created in, moved into, or restored into library MYLIBD will have journaling started to journal JRN in MYLIBA, except any files whose names start with 'W'.
Top |
*ESCAPE Messages
Top |