Start Journal Physical File (STRJRNPF)
Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Start Journal Physical File (STRJRNPF) command is used to start journaling changes made to a specific database physical file to a specific journal. Changes in new members added to the file are also journaled.
The user can specify that only the after image or both the before and after images of records in the journaled physical file be journaled. Before images are necessary to remove journaled changes using the Remove Journaled Changes (RMVJRNCHG) command. In addition, the system will automatically capture the before images for a database file if the file is opened under commitment control. For more information about commitment control, see the Database category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
After journaling begins for the file, and after any new members are added to the file, the user should run the Save Changed Object (SAVCHGOBJ) command with OBJTYPE(*FILE) and OBJJRN(*YES) specified. The file must be saved because journaled changes cannot be applied to a version of the file that was saved before journaling was in effect.
When the file being journaled is a distributed file, the STRJRNPF command is also distributed if journaling was successfully started locally. Even if the distribution request fails, the local file remains journaled.
For other ways to start journaling see the following commands:
- Access paths - Start Journal Access Path (STRJRNAP)
- Integrated file system objects - Start Journal (STRJRN)
- Libraries - Start Journal Library (STRJRNLIB)
- Other objects - Start Journal Object (STRJRNOBJ)
Restrictions:
- The file must not be journaling changes to another journal.
- Overrides are not applied to files specified on the FILE parameter.
- 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. Once the number of objects is greater than or equal to this maximum, journaling does not start for any more objects.
- 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. For information about remote journaling, see the Journal management topic.
- In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA.
- If the file has Large Object (LOB) columns, and the total of the LOB columns plus the record size is greater than 15,761,440 bytes, then the file can only be journaled to a journal with RCVSIZOPT(*MAXOPT2) or RCVSIZOPT(*MAXOPT3) specified.
- Lock Processing
The physical file to start journaling is locked with a read exclusive lock (*EXCLRD). Any logical files built over the physical file are also locked with a read exclusive lock (*EXCLRD).
Top |
Parameters
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | Physical file to be journaled | Values (up to 300 repetitions): Qualified object name | Required, Positional 1 |
Qualifier 1: Physical file to be journaled | Generic name, name, *ALL | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
JRN | Journal | Qualified object name | Required, Positional 2 |
Qualifier 1: Journal | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
IMAGES | Record images | *AFTER, *BOTH | Optional |
OMTJRNE | Journal entries to be omitted | *NONE, *OPNCLO | Optional |
LOGLVL | Logging level | *ERRORS, *ALL | Optional |
Top |
Physical file to be journaled (FILE)
Specifies a maximum of 300 physical files whose changes are written to the journal.
This is a required parameter.
Qualifier 1: Physical file to be journaled
- *ALL
- All physical files in the specified library will have their changes written to the journal.
- generic-name
- Specify the generic name of the physical file for which changes are to be journaled. A generic name is a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, all physical files that have names with the same prefix as the generic name will have their changes journaled.
- file-name
- Specify the name of the physical file for which changes are to be journaled.
Qualifier 2: Library
- *LIBL
- All libraries in the library list for the current thread are searched until the first match is found.
- *CURLIB
- The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
- library-name
- Specify the name of the library to be searched.
Top |
Journal (JRN)
Specifies the journal that will receive the file change journal entries.
This is a required parameter.
Qualifier 1: Journal
- journal-name
- Specify the name of the journal.
Qualifier 2: Library
- *LIBL
- All libraries in the library list for the current thread are searched until the first match is found.
- *CURLIB
- The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
- library-name
- Specify the name of the library to be searched.
Top |
Record images (IMAGES)
Specifies the kinds of record images to be written to the journal for changes to records in the file.
- *AFTER
- Only after images are written to the journal for changes to records in this file.
- *BOTH
- The system writes both before and after images to the journal for changes to records in this file.
Top |
Journal entries to be omitted (OMTJRNE)
Specifies the journal entries that are omitted.
- *NONE
- No journal entries are omitted.
- *OPNCLO
- Open and close entries are omitted. Open and close operations on the specified file members do not create open and close journal entries. This prevents the use of TOJOBO and TOJOBC entries on the Apply Journaled Changes (APYJRNCHG) and Remove Journaled Changes (RMVJRNCHG) commands, but it saves some storage space in the attached receivers.
Top |
Logging level (LOGLVL)
Specifies the error logging level used. This parameter is used to determine which messages will be sent.
- *ERRORS
- All diagnostic and escape messages are sent but the command will not send successful completion messages for each object. At the completion of this command, one completion message will be sent.
- *ALL
- The command sends all the messages that would be sent with *ERRORS and it will also send the successful completion message for each object.
Top |
Examples
STRJRNPF FILE(MYFILE) JRN(MYLIB/JRNLA)
This command journals all changes to all members of file MYFILE (as found using the library search list) to journal JRNLA in library MYLIB. Only the after images of updated records are written to the journal.
Top |
Error messages
*ESCAPE Messages
- CPF6971
- Damage prevents object &1 from being journaled.
- CPF6979
- Journal &1 in library &2 is unusable.
- CPF70A6
- Object &1 in library &2 member &3 is not eligible for the requested operation.
- CPF700A
- &1 of &2 objects have started journaling.
- CPF700D
- File &1 in library &2 not journaled.
- CPF7002
- File &1 in library &2 not a physical file.
- CPF7003
- Entry not journaled to journal &1. Reason code &3.
- CPF7004
- Maximum number of objects journaled to journal &1.
- CPF7011
- Not enough storage or resources.
- CPF703B
- Implicit end of access path journaling failed.
- CPF703C
- Commitment control transaction prevents journaling operation.
- CPF7030
- Object of type *&3 already being journaled.
- CPF7031
- Cannot allocate member &3 file &1 in &2.
- CPF7033
- Start or end journaling failed for member &3.
- CPF7034
- Logical damage of file &1 in &2.
- CPF7035
- Object &1 in &2 already known to journal.
- CPF704B
- Journaling started locally but distributed requests failed.
- CPF705A
- Operation failed due to remote journal.
- CPF7057
- *LIBL not allowed with *ALL or *ALLLIB or a generic name.
- CPF7084
- Object of type *&6 could not be journaled.
- CPF708D
- Journal receiver found logically damaged.
- CPF709D
- Cannot start journaling object of type *&7.
- CPF9801
- Object &2 in library &3 not found.
- CPF9802
- Not authorized to object &2 in &3.
- CPF9803
- Cannot allocate object &2 in library &3.
- CPF9810
- Library &1 not found.
- CPF9812
- File &1 in library &2 not found.
- CPF9820
- Not authorized to use library &1.
- CPF9822
- Not authorized to file &1 in library &2.
- CPF9825
- Not authorized to device &1.
- CPF9830
- Cannot assign library &1.
- CPF9873
- ASP status is preventing access to object.
- CPF9875
- Resources exceeded on ASP &1. Press HELP.
Top |