Journal
Journal
Journal
3
Student Notebook
Unit Objectives
After completing this unit, you should be able to:
Describe how journal management can be used to recover data lost
during a failure
Implement journal management on your iSeries system as part of a
comprehensive recovery plan
List the advantages and considerations of journal management
List the advantages and considerations of journaling access paths
Describe remote journaling and how it can be used to replicate data
or to implement a hot-backup environment on a remote system
Notes:
7-2 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
DATA
FILE
What if it disappeared?
Figure 7-2. Think About Your Most Important Data File OL197.0
Notes:
7-4 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Single Level Storage
ON
OFF
Volatile Storage
Main Memory
N S
Data File
Scatter Loading
Notes:
1. Journal Management intercepts the database record (add, update or delete)
2. Journal entry is forced to the journal receiver on a disk with a force ratio of one
3. The database record is given to database data management
4. The data base record is written to disk
FRCRATIO(*NONE) is recommended for journaled files
Journal Objects
PGMX PGMY
Journal
Receiver
Object A Change
Object B Change
Object B Change
Notes:
Contents of a journal entry
• Information identifying the type of change
• Information identifying the record that was changed
• After image of the record
• Before image of the record (optional) (This is a separate journal entry)
• Information identifying the job, the user, the time of change, and so forth
• Information that identifies whether the file was opened, closed, reorganized, cleared, or
saved
7-6 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Objects that can be journaled
Ability to record changes into a journal of:
Data Base physical files (*PF)
Data Area (*DTAARA)
Data Queue (*DTAQ)
IFS objects
Stream files (*STMF)
Directories (*DIR)
Symbolic link (*SYMLNK)
Notes:
An interface is available to start and stop the replication of byte stream files. The changes
to these objects will be recorded in a local journal. With remote journal support, the
changes will also be transported to a backup system for allowing a replay by a business
partner application. The primary target is those environments needing synchronous
replication of the objects for continuous availability. The targeted usage represents an
autonomous operation from the end user perspective. The overall goal is to support
replication, which is defined as trapping changes, recording those changes, transporting
changed data to a backup system, and then replaying the changes on the backup system.
This enhancement, in order to support synchronous or asynchronous replication of a byte
stream file, contains the following capabilities:
• Function to start replication and end replication
• Means of knowing which objects are being replicated
• Means of associating the recorded and transported changes with the appropriate object
hooks at relevant points to record and transport changes
• Transport mechanism
• Repository for recording the changes to the object
• Mechanism for selectively pulling the recorded changes out of the repository (so, for
example, they can be replayed against a replicate)
The start journaling function will accept a list of one or more file names (up to 50). Only the
byte stream file objects (*STMF) will be supported and does not support directories (*DIR)
or file attributes. It also supports only stream files that are in the root file system or its
derivatives (root, /QOpenSys, and user defined file systems).
There is no support for before images, RMVJRNCHG, CMPJRNCHG, APYJRNCHG or
commitment control.
IFS functions recorded in the journal are: fsynch, save, restore, suspend, delete, write,
writev, and ftruncate.
7-8 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Display Journal Entries
Notes:
Notes:
The Display Journal Entry display shows all of the information about a specific journal
entry. The journal entry shown is one that you requested on the Display Journal display.
Sequence - The journal sequence number
The sequence number is initially 1. Each journal entry is sequentially numbered without
any breaks until the Change Journal (CHGHRN) command resets the sequence number.
However, when journal entries are converted and displayed, there may be breaks in the
sequence numbers. The system uses some journal entries only internally and combines
some entries into one during conversion.
Incomplete data
Indicates whether this entry has entry specific data which is not being displayed for one of
the following reasons.
• The length of the entry specific data exceeds 32766 bytes
7-10 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty • The entry is associated with a database file that has one or more fields of data type
BLOB (binary large object), CLOB (character large object) or DBCLOB (double-byte
character large object)
The possible values are:
• No - This entry has all possible data
• Yes - This entry has incomplete data
The data which is not visible through this interface can only be accessed by using the
Retrieve Journal Entries (QjoRetreiveJournalEntries) API or by specifying ENTFMT
(*TYPEPTR) on the RCVJRNE command.
Entry specific data
Additional information about the entry. The contents of this field are dependent on the kind
of journal entry. If there is no entry specific data for the kind of entry being shown, the
message No Entry specific data is shown in this field.
The information shown in this field is not formatted. For a description of the format of the
entry specific data, see the iSeries Backup and Recovery.
A scale line (ruler) is shown above the entries to help you interpret the information. You can
view the entry specific data in either character or hexadecimal representation by using F11.
F11 = Display hexadecimal format
Displays the Entry specific data in a hexadecimal format. The scale line (ruler) above the
data is also changed to reflect the alternate data representation.
F14 = Display previous entry
Shows the entire journal entry for the previous entry that was selected on the Display
Journal Entries display.
To show the entire journal entry of the next entry that was selected, press Enter.
F17 = Position to
Displays the Position the Entry Specific Data display if the cursor is in the entry specific
data portion of the display or the Position the Null Value Indicators display if the cursor is in
the null value indicators portion of the display.
Notes:
The Display Journal Entry Details display shows only the detail entry data for a specific
journal entry. The journal entry shown is one that you requested on the Display Journal
display.
Count/RRN - Either the relative record number (RRN) of the record which caused the
journal entry to be written, or a count which is pertinent to the specific type of journal entry.
This field will be blank except for the journal code/type combinations that follow:
C/CM - The length of the commit identifier on the COMMIT command.
F/AY - The number of journal entries applied by the Apply Journal Changes
(APYJRNCHG) command.
F/IZ - The number of records specified in the total number of records (TOTRCDS)
parameter of the Initialize Physical File Member (INZPFM) command.
F/RC - The number of journal entries removed by the Remove Journal Changes
(RMVJRNCHG) command.
J/NR, J/PR - The number of journal receivers attached or the number detached.
7-12 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty R/(all types) - The relative record number of the record that caused this entry to be
recorded.
Flag - Additional information for certain kinds of journal entries. This field will be blank
except for the journal code/type combinations that follow:
C/CM - Indicates whether the commit operation was started by the user or by the operating
system.
• 0 - All record-level changes were committed for a commit operation initiated by a user
• 2 - All record-level changes were committed for a commit operation initiated by the
operating system
C/RB - Indicates whether the rollback operation was successful for record-level changes
and whether it was initiated by a user or the operating system.
• 0 - All record-level changes were rolled back for a rollback operation initiated by a user
• 1 - Not all record-level changes were successfully rolled back for a rollback operation
initiated by a user
• 2 - All record-level changes were rolled back for a rollback operation initiated by the
operating system
• 3 - Not all record-level changes were rolled back for a rollback operation initiated by the
operating system
F/AY, F/RC - Indicates the completion status.
• 0 - Apply or remove of journal changes completed normally
• 1 - Apply or remove of journal changes completed abnormally
F/IU - Indicates whether the file was synchronized with the journal.
• 0 - The file was synchronized
• 1 - The file was not synchronized
F/IZ - The type of record.
• 0 - *DFT (Default)
• 1 - *DLT (Delete)
F/JM - The type of images that are journaled.
• 0 - *AFTER (after images only)
• 1 - *BOTH (both before and after images)
R/UB, R/DL, R/BR, R/DR - Indicates whether a before image is present in the entry.
• 0 - Before image is not present
• 1 - Before image is present
If both (*BOTH) images were requested and the flag indicates that none is present, then
there was an attempt to update or delete a record that was already deleted.
Commit cycle ID - The commit cycle identifier. This field will be blank if the operation was
not being performed under commitment control.
Referential constraint - Indicates whether this journal entry was recorded for actions that
occurred on records that are part of a referential constraint.
• No - This journal entry is not related to a referential constraint
• Yes - This journal entry is related to a referential constraint
Trigger - Indicates whether this journal entry was recorded for actions that occurred as a
result of a trigger program.
• No - This journal entry is not related to a trigger program
• Yes - This journal entry is related to a trigger program
Sequence numbers 15 -18 encompass a complete transaction. Sequence numbers 19 and
20 represent half of a transaction. The bad data begins at sequence number 19.
7-14 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Implementing Journaling
IMPLEMENTATION PROCEDURE
1. Create the journal receiver
CRTJRNRCV JRNRCV( )
Notes:
CRTJRNRCV Command
Notes:
It is recommended that the journal receiver name should be unique for your system, not
unique within a library. If you have two journal receivers with the same name in different
libraries and they both become damaged, RCLSTG renames both journal receivers when
they are placed in the QRCL library.
The Create Journal Receiver (CRTJRNRCV) command creates a journal receiver. Once a
journal receiver is attached to a journal (with the Create Journal (CRTJRN) or Change
Journal (CHGJRN) command), journal entries can be placed in it. A preferred auxiliary
storage pool (ASP), and a storage space threshold value can be specified for the journal
receiver.
Restrictions
1. A Journal receiver cannot be created in library QTEMP
2. This command cannot be used to create a journal receiver for a remote journal
Note: Do not precede an entry with an asterisk unless that entry is a special value that is
shown (on the display or in the help information) with an asterisk.
7-16 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
7-18 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
CRTJRN Command
Notes:
The Create Journal (CRTJRN) command creates a journal as a local journal with the
specified attributes, and attaches the specified journal receivers to the journal. Once a
journal is created, file changes can be journaled to it or user entries can be sent to it. The
journal state of the created journal is *ACTIVE.
Restrictions
1. A journal cannot be created in the library QTEMP.
2. The specified journal receivers must be created before the running of this command
and they must be empty (that is, the receivers must not have been previously attached
to a journal or have been in the process of being attached to a journal).
3. This command cannot be used to create a remote journal. See the Add Remote Journal
(QjoAddRemoteJournal) API in the iSeries Information Center (Programming>APIs).
ASP - Which auxiliary storage pool. Considerations will be discussed later.
MSGQ - If the threshold of the attached journal receiver is reached and if
MNGRCV(*USER) is specified, a message is sent to the message queue.
7-20 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
STRJRNPF Command
Notes:
When you start journaling for a physical file, the system assigns a unique journal identifier
(JID) to every member. The JID is part of every journal entry for the file. The JID is used to
associate the journal entry with the file. If a file is saved before journaling is started, it will
not have a JID, and if the file is restored it will not have a JID. It is critical to save a
journaled file every time a member has been added to it.
IMAGES(*BOTH) is recommended. It allows backout recovery (RMVJRNCHG). However,
it takes more space.
OMTJRNE(*OPNCLO), is not recommended. You can not use the journal to audit who
opened a file. You can not apply entries to open and close boundaries using the TOJOBO
and TOJOBC parameters.
STRJRNOBJ Command
Notes:
The Start Journal Object (STRJRNOBJ) 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) and Data Queues (*DTAQ).
For more information about the possible journal entries which can be sent, see iSeries
Backup and Recovery.
Additionally, 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.
7-22 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
STRJRN Command (1 of 2)
Notes:
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. For more information about the possible journal entries which can be sent, see
iSeries Backup and Recovery.
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.
STRJRN Command (2 of 2)
Notes:
7-24 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
iSeries Navigator - Start Journaling
Notes:
You can start journaling files, data areas, and data queues using iSeries Navigator panels.
Save Objects
When:
Immediately after STRJRNxx or if a new member is added to the file
Why:
Checkpoint for recovery (F/MS journal entry)
Restore damaged object
Apply journaled changes from *LASTSAVE
Must have the system assigned journal identifier
(JID) in every saved member used for recovery
after a restore
Notes:
When you start journaling for a physical file, the system assigns a unique journal identifier
(JID) to every member. The JID is part of every journal entry for the file. The JID is used to
associate the journal entry with the file. If a file is saved before journaling is started, it will
not have a JID, and if the file is restored it will not have a JID. It is critical to save a
journaled file every time a member has been added to it.
7-26 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Managing the Receiver Chain
RCV0001
Old
Receiver
RCV0002
Current
Receiver
*File
Notes:
The CRTJRN and the CHGJRN commands can specify a value for the MNGRCV
parameter of *USER or *SYSTEM.
• *USER - a user manages receivers with the CHGJRN command
• *SYSTEM - the system manages when the receiver reaches threshold. Additionally,
during IPL, the system performs CHGJRN to create and attach a new receiver and
reset the sequence number
DLTRCV(*YES) uses
Journaling for commitment control or explicit access path protection
Journal receiver is being replicated via remote journal
Notes:
Manage receivers (MNGRCV)
Specifies how the changing of journal receivers (detaching the currently attached journal
receivers and attaching new journal receivers) is managed.
The possible values are:
*USER
The user manages the changing of journal receivers by issuing the Change Journal
(CHGJRN) command to attach new receivers and detach old receivers.
*SYSTEM
The system manages the changing of journal receivers (this function is called system
change-journal management). When an attached journal receiver reaches its size
threshold, the system detaches the attached journal receivers and creates and attaches
new journal receivers. Message CPF7020 is sent to the journal message queue when the
journal receivers are detached. Additionally, during an initial program load (IPL), the system
performs a CHGJRN command to create and attach new journal receivers and to reset the
7-28 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty journal sequence number of journals that are not needed for commitment control recovery
for that IPL. Also, the system attempts to perform a CHGJRN command to reset the
sequence numbers when the journal receiver's sequence number exceeds 2,147,000,000.
1. The storage space threshold value must be specified on the Create Journal Receiver
(CRTJRNRCV) command before this value is specified, and the threshold must be a
minimum of 5000 KB
2. Specifying MNGRCV(*SYSTEM) does not prevent you from using the CHGJRN
command to manage journal receivers
Delete receivers (DLTRCV)
Specifies whether the system deletes journal receivers when they are no longer needed or
leaves them on the system for the user to delete after they have been detached by system
change-journal management or by a user-issued CHGJRN command.
Note: This parameter can be specified only if MNGRCV(*SYSTEM) is specified.
The possible values are:
*NO
The journal receivers are not deleted by the system. It is underlined because it is the
default value for this parameter.
*YES
The journal receivers are deleted by the system.
When the journal has the DLTRCV(*YES) attribute, the following conditions can prevent the
system from deleting the receiver. When one of these conditions occurs, the system sends
message CPI70E6 to the journal message queue, and then retries the delete operation
every 10 minutes until the operation is successful.
• A lock conflict occurs for either the journal receiver or its journal
• An exit program that was registered by way of the QIBM_QJO_DLT_JRNRCV exit point
indicates that a receiver is not eligible for deletion
• A journal has remote journals associated with it and one or more of the associated
remote journals do not yet have full copies of this receiver
J PR RCV0006
RCV0007
J NR RCV0008
J PR RCV0007
RCV0008
J NR RCV0009
Notes:
PR stands for previous receiver.
NR stands for next receiver.
The PR and NR entries are automatically added when a receiver is created or changed.
They are used by the system to make recovery seamless across a journal receiver chain.
7-30 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
WRKJRNA Command
Notes:
The Work with Journal Attributes display shows the current attributes of this journal and the
names of the journal receiver(s) that are currently attached to this journal, if any.
You can use function keys to display lists of objects associated with this journal. You can
request the following lists:
• F13 - Files journaled to this journal
• F14 - Access paths journaled to this journal
• F15 - Receivers that have been used or are being used by this journal
• F16 - Remote journal information
Note: Some of these lists or options are not available when working with an internal system
journal (*INTSYSJRN for JRN).
The type of journal, the possible values are:
• *LOCAL - A local journal
• *REMOTE - A remote journal
Journal state
The state of the journal, the possible values are:
• *ACTIVE - If this is a local journal, this means journal entries can be deposited to this
journal. If this is a remote journal, this means journal entries can be received from a
source journal.
• *INACTIVE - If this is a local journal, this means journal entries can not be deposited to
this journal, unless they have been designated as journal entries which must be
deposited. See the 'Journal Entry Information' appendix in the iSeries Backup and
Recovery. for the journal entry designations. If this is a remote journal, this means
journal entries cannot be received from a source journal.
• *FAILED - If this is a remote journal, this means journal entries can not be received from
a source journal due to a remote journal function failure, for example a communication
line failure. Before inactivating the remote journal by issuing the Change Remote
Journal (CHGRMTJRN) or the Change Journal (CHGJRN) command or by calling the
Change Journal State (QjoChangeJournalState) API, you may want to receive, retrieve,
or display any unconfirmed entries from the journal.
• This value does not apply to local journals.
F13=Display journaled files
Shows the Display Journaled Files display for the selected journal.
Note: This function key is not available if you are working with an internal system journal
(*INTSYSJRN for JRN).
F14=Display journaled access paths
Shows the Display Journaled Access Paths display for the selected journal.
Note: This function key is not available if you are working with an internal system journal
(*INTSYSJRN for JRN).
F15=Work with receiver directory
Shows the Work with Receiver Directory display for the selected journal.
F16=Work with remote journal information
Shows the Work with Remote Journal Information display for the select.
Note: This function key is not available if you are working with an internal system journal
(*INTSYSJRN for JRN).
7-32 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
F15 = Work with Receiver Directory
Notes:
The Work with Receiver Directory display shows a list of all journal receivers that are
associated with this journal, if any. The list of receivers is ordered from the oldest (first
attached) at the top of the list, to the newest (currently attached) at the bottom of the list.
You can make selections on the list to:
• 8 - Display the attributes of the selected receivers
• 4 - Delete the selected receivers
Number
A number associated with a journal receiver and assigned by the system which is relative
to all other receivers in the receiver directory at a given time. The first two digits identify the
journal chain number and the last three digits identify the receiver number within the chain.
A chain identifies a group of receivers that are contiguous allowing the system to process
entries across receivers within the same chain.
The chain number starts with zero and is incremented sequentially each time a new chain
is needed. New chains are started when a damaged receiver is recovered by restoring a
partial version.
Status
The status of the receiver can be one of the following:
ATTACHED The receiver is currently attached to the journal.
ONLINE The receiver is online. The receiver has not been saved and it has been
detached from the journal.
SAVED The receiver was saved after it was detached. The receiver storage was
not freed when it was saved.
FREED The receiver was saved after it was detached. The receiver storage was
freed when it was saved.
PARTIAL The receiver status is partial for one of the following reasons:
• It was restored from a version that was saved while it was attached
to the journal. Additional journal entries may have been written that
were not restored.
• It was one of a pair of dual receivers, and it was found damaged
while attached to the journal. The receiver has since been
detached. This receiver is considered partial because additional
journal entries may have been written to the dual receiver.
• It is associated with a remote journal and it does not contain all the
journal entries that are in the associated journal receiver attached
to the source journal.
DELETED The receiver has been deleted. This status is shown after option 4
(Delete) completes. If you refresh (F5) the list, deleted receivers are
removed from the list.
7-34 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
WRKJRN Command
Notes:
The Work with Journals display shows a list of journals you can work with. You can select
tasks to be performed on specific journals.
Opt
Type the option you want.
2=Forward recovery
Select this option to reconstruct a file from a particular point by restoring a saved version of
the file and then applying journaled changes to the file in the same order that they were
originally made.
3=Backout recovery
Select this option to restore a file to a previous state by removing changes to the file in the
reverse order from which the existing journal receivers are re-associated with the
recovered journal, so it is not necessary to save and restore the receivers to associate
them again with the journal. This option is not valid for remote journals.
Forward Recovery
1. WRKJRN
Notes:
To perform forward recovery by entering the commands yourself, do the following:
1. Restore the files: RSTOBJ
2. Allocate the files: ALCOBJ
3. Restore receivers: RSTOBJ
4. APYJRNCHG...FROMENT(*LASTSAVE) TOENT(*LASTRST)
5. Deallocate the files: DLCOBJ
7-36 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Work with Forward Recovery
Notes:
The Work with Forward Recovery display shows a list of the database file members that
you have specified for forward recovery. From this display, you can select the type of action
you want to perform with each member.
The options you can select are:
• 1=Add member to list
• 2=Apply journaled changes
• 3=Restore
• 4=Remove member from list
1=Add member to list
Causes the entry typed on the line above the existing members to be added to the list.
Once added to the list, the other options can be used on the new member.
7-38 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Backout Recovery
1. WRKJRN
2. Option 3 = Backout recovery
3. Option 2 = Remove journaled changes.
RMVJRNCHG is prompted.
Prompts for restore of receivers not on-line
Notes:
7-40 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Work with Backout Recovery
Notes:
The Work with Backout Recovery display shows a list of the data file members you have
specified for backout recovery. From this display, you can select the type of action you want
to perform with each member.
The options you can select are:
• 1=Add member to list
• 2=Remove journaled changes
• 4=Remove member from list
2=Remove journaled changes
Causes the Remove Journaled Changes (RMVJRNCHG) command prompt to be shown
with known values already assigned. You can then run the command to remove the
specified changes.
This option can be used on an entry typed into the empty line above the list entries, if the
typed entry already exists in the list.
*JRN
DSPJRN
FILE(names)
*CURRENT
RCVRNG RCV00010
Start(*CURRENT/name)
End(name/*CURRENT) RCV0009
FROMENT(*FIRST/seq#) RCV0008
Notes:
Before starting forward or backward recovery, use the DSPJRN command to examine the
journal receiver entries to find the best starting and stopping recovery points.
7-42 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
DSPJRN Command Keywords
DSPJRN KEYWORDS
NBRENT (*ALL/#)
DEPENT (*ALL*NONE)
Notes:
OUTPUT(* *PRINT *OUTFILE). If *OUTFILE is chosen, the journal entries are written to a
data base file, which can be queried.
Display Journal (1 of 3)
Notes:
The Display Journal (DSPJRN) command allows you to convert journal entries (contained
in one or more receivers) into a form suitable for external representation. Output of the
command can be displayed or printed with the job's spooled printer output or directed to a
database output file.
The contents of selected entries in the journal receivers may be converted for output. It is
also possible to selectively limit the entries that are displayed. If no journal entries satisfy
the selection or limitation criteria, an escape message is sent indicating that fact.
Gaps may exist in the sequence numbers of the entries converted. These occur because
some of the journal entries represent internal system information. These entries are not
converted.
It is possible to show journal entries whose journal sequence numbers are reset in the
chain of receivers being specified.
7-44 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty The FILE, JRNCDE, ENTTYP, JOB, PGM, USRPRF, CMTCYCID, and DEPENT
parameters can be used to specify a subset of all available entries within a range of journal
entries.
Journaled physical file (FILE)
Specifies a maximum of 300 qualified file names whose journal entries are converted for
output.
Range of journal receivers (RCVRNG)
Specifies the starting (first) and ending (last) journal receivers (the receiver range) that
contain the journal entries being converted for output.
Starting sequence number (FROMENT)
Specifies the first journal entry that is being considered for conversion for external
representation.
Starting date and time (FROMTIME)
Specifies the date and time of the first journal entry being converted for external
representation.
Display Journal (2 of 3)
Notes:
Number of journal entries (NBRENT)
Specifies the total number of journal entries that are being converted for output.
Journal codes (JRNCDE)
Specifies the journal codes for which journal entries are converted for output.
The possible single values are:
*ALL
The conversion of journal entries is not limited to entries with a particular journal code. This
value is the default for this parameter and therefore it is underlined.
*CTL
Only journal entries created to control the journal functions are converted for external
representation. The journal codes are 'J' and 'F'.
The possible Journal Code values are:
7-46 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty Journal-code
Specify the journal code for which journal entries are converted.
For a list of the journal codes that are valid on this parameter, press F4 (Prompt) from the
JRNCDE prompt. An explanation of the list of journal codes that can be specified is in
iSeries Backup and Recovery.
The possible Journal Code Selection values are:
*ALLSLT
The journal with the specified journal code are converted for output only if all other
selection parameters are satisfied. It is the default value for this parameter.
*IGNFILSLT
Journal entries having the specified journal code are converted for output only if all
selection parameters, except the FILE parameter, are satisfied.
Note: This value is not valid for journal code D, F or R.
Journal entry types (ENTTYP)
Specifies whether to limit the conversion of journal entries to those of a specified entry
type.
The conversion of journal entries is not limited to a particular entry-type.
*RCD
Only entries that have an entry type for record level operations are converted. The
following entry types are valid: BR, DL, DR, PT, PX, UB, UP, and UR.
Entry-type
Specify the entry type that limits the number of journal entries being converted for external
representation. Up to 50 valid entry types can be specified. More information on entry types
is in the iSeries Backup and Recovery.
Display Journal (3 of 3)
Notes:
Commit cycle identifier (CMTCYCID)
Specifies the commit cycle identifier of the specific journal that participated in a logical unit
of work for which the journal entries are converted for output.
Dependent entries (DEPENT)
Specifies whether the journal entries to be converted for output include the journal entries
recording actions that occur as a result of a trigger program and actions on records that are
part of a referential constraint.
Output format (OUTFMT)
Specifies whether the entry specific data portion of the journal entry information appears in
character format or hexadecimal format. This keyword is ignored if *OUTFILE is specified
for the Output prompt (OUTPUT keyword).
7-48 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
7-50 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Journal Codes
J PR Previous receiver
NR Next receiver
RS Receiver saved
__________________________________________
F JM Journaling started
MS Member saved
SS Save-while-active group saved
R OP File opened
CL File closed
PT Record added
UB Image before update
UP Image after update
DL Record deleted
U XX User entry
Notes:
7-52 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Recovery Point Example (1 of 2)
Notes:
The DSPJRN command is used to examine the file activity, and determine at what point the
good data ends, and bad (erroneous or incomplete) data begins. At this time, application
knowledge is very helpful, if not required.
This example deals with a banking application. Three files are journaled: a savings account
file, a checking account file, and a money market account file. This example deals with a
program that transfers money between checking and savings. A complete transaction is an
update of both SAVE and CHECK.
Notes:
7-54 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
User Generated Entries
Notes:
A better name would be programmer entries, because a programmer modifies the
application program to include statements that cause additional entries to be placed in the
journal receiver.
The idea is to label the file activity more accurately, more completely. For Example, when a
logical unit of works is finished, add an entry placed that says, This is complete. User
entries should make analysis of journal entries and file activity easier and faster.
This may be thought of as an alternative to commitment control.
Notes:
Journal Code: Can not specify. Always U.
Entry Type: Pick a two position entry type.
Entry Data: Entry specific data.
Specify up to 3000 characters, enclosed in apostrophes. The Send Journal Entry
(SNDJRNE) command is used to write a single journal entry to a specific journal. The entry
can contain any information. The user may assign an entry type to the journal entry and
may also associate the journal entry with a specified physical file member.
The journal code for the entry is U, which indicates a user-specified journal entry.
Note: The Send Journal Entry (QJOSJRNE) Application Programming Interface (API) can
also be used to write a journal entry to a specific journal. Using this API may improve
performance and can provide additional function that is not available with this command.
For more information, see the iSeries Information Center (Programming>APIs).
1. If a file is specified, it must either be currently journaled to the specified journal or it
must have been last journaled to the specified journal
7-56 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Note: The underlined values are the defaults for the associated parameter.
TOJOBO: job-name
TOJOBC: job-name
Notes:
Several parameters are the same as the DSPJRN command.
The Apply Journaled Changes (APYJRNCHG) command applies the changes that are
journaled (for a particular member of a database file) to a saved version of the file to
recover the file after an operational error or some form of damage. The journaled changes
are applied from the specified starting point, either the point at which a file was last saved
or a particular entry on the journal, until the specified ending point has been reached. The
ending point can be the point at which the file has had all changes applied, the file was last
restored, a specified entry has been reached, a specified time has been reached, or the file
was opened or closed by a job (the CMTBDY parameter is used for handling changes that
are still pending in the file).
Note: The Display Journal (DSPJRN) command can be used to help determine the desired
starting and/or ending points.
A list of physical files and members can be specified. The journaled changes for physical
file members are applied in the order that the journal entries are found on the journal, which
is the same order in which the changes are made to the physical file members.
7-58 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty If an error is found at any point while the journal entries are being applied, the operation
ends and the file member or members might be only partially updated from the journal
entries. The command ends when a journal entry is found that indicates one of the
following has occurred:
• The member was reorganized
• The member was restored
• Journaling was ended for the file member
• The member was deleted or saved with storage freed
• Journal IPL synchronization failed for the file member
• The member had its changes applied or removed (through the APYJRNCHG command
or the Remove Journaled Changes (RMVJRNCHG) command).
See the iSeries Backup and Recovery for a complete listing of the various entries and how
they are handled by this command.
The command also ends on illogical conditions, such as attempts to do the following:
• To add a record to an existing relative record number
• To add a record beyond the next record position after the end of the file
• To add a record that has a duplicate key
• To delete a deleted record
• To update a nonexistent record
Most illogical conditions are caused by starting the apply journaled changes operation at
the wrong place in the journal with respect to the current contents of the file members.
Note: If applying journaled changes ends for one of the members specified, it ends for all of
the members specified.
If the command ends due to illogical conditions and it is logically possible to restart the
apply operation, you can issue the command again specifying a new starting sequence
number.
Restrictions:
1. This command is shipped with public *EXCLUDE authority and the QPGMR and QSRV
user profiles have private authorities to use the command
2. The files specified on this command must currently have their changes journaled and
they must have been journaled to the specified journal throughout the period indicated
on the command
3. If a restore operation occurs before the apply operation, the file being restored must
have been journaled at the time of the save operation. The files indicated on the
command are allocated exclusively while the changes are being applied
4. If a file cannot be allocated, the command ends and no journaled changes are applied
5. If there is no journal entry that corresponds to the period indicated on the command, the
command ends and no journaled changes are applied
6. If the journal sequence numbers have been reset in the range of the receivers specified,
and a sequence number is specified on the FROMENT or TOENT parameter, the first
occurrence of the sequence number specified on either parameter is used
7. The TOJOBO and TOJOBC parameters cannot be used to specify when the apply
journaled changes operation is to end if one or more journal receivers in the specified
receiver range was attached to a journal with RCVSIZOPT(*MINFIXLEN) in effect
Journaled physical file (FILE)
Specifies a maximum of 300 qualified names of physical database files to which journal
entries are being applied.
Range of journal receivers (RCVRNG)
Specifies the starting and ending journal receivers used in applying the journal entries. The
system begins by applying the journal entries in the first journal receiver in this journal
receiver range and proceeds through the receivers until it applies the journal entries in the
last journal receiver in this journal receiver range. The possible single values are:
*LASTSAVE
The range of journal receivers used is determined by the system, as a result of save
information for the files that have their recorded changes applied. This parameter value is
only valid if *LASTSAVE is also specified on the Starting sequence number prompt
(FROMENT parameter).
*CURRENT
The journal receiver that is currently attached when starting to apply journal entries is used.
The possible Starting Receiver values are:
Starting-journal-receiver
Specify the name of the journal receiver used as the first (oldest) receiver.
Ending sequence number (TOENT)
Specifies the entry used as the ending point for applying changes that have been
journaled.
*LASTRST
The Journal entries are applied ending with the entry before the file member was last
restored. The system determines the actual ending position for each of the files specified
on the command. The system verifies that the date and time of the restored version of the
file member on the system is the same as the date and time that the file member was last
restored, as indicated on the journal. If the dates and times do not match, no entries are
applied and an inquiry message is sent to the user or system operator, requesting a cancel
or ignore response. If an ignore response is given to the message, the operation is
7-60 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty attempted. A cancel response causes the operation to end, and no journal entries are
applied.
This parameter value is only valid if *LASTSAVE is also specified on the Starting
sequence number prompt (FROMENT parameter). *LASTRST is assumed if none of the
following parameters are specified:
• Ending date and time prompt (TOTIME parameter)
• Fully qualified job name prompt (TOJOBO parameter)
• Fully qualified job name prompt (TOJOBC parameter)
*LAST
Journal entries are applied through the last entry.
ending-sequence-number
Specifies the sequence number of the last entry that is applied to the file member.
Ending date and time (TOTIME)
Specifies the time and date of the last journal entry that is applied to the file member. The
first entry with that or the next earlier time is the ending point for the applying of journal
entries.
Fully qualified job name (TOJOBO)
Specifies the job identifier of the job that, when it opens a physical file member (or logical
member defined over the physical member) that is specified on the Journaled physical
file prompt (FILE parameter), ends the applying of journal entries by this command. This is
the ending point for all members specified.
Fully qualified job name (TOJOBC)
Specifies the job identifier of the job that ends the applying of journal entries by this
command. This is the ending point for all members specified. The applying of journal
entries is ended when either of the following occurs:
• The specified job closes a physical file member (or logical member defined over the
physical member) that is specified on the Journaled physical file prompt (FILE
parameter)
• The specified job is ended
Commitment Boundary
Specifies whether commitment boundaries are honored when the journal entries to which
journaled changes are to be applied are part of a commitment control logical unit of work
(LUW). More information on the use of commitment control is in iSeries Backup and
Recovery.
Note: For purposes of this parameter description, the TO option is used to describe either
the TOENT, the TOTIME, the TOJOBO, or the TOJOBC parameter, whichever is specified.
*NO
The journal entries are applied from the entry specified on the FROMENT parameter to the
entry indicated on the TO option, regardless of commitment boundaries. Even if a journal
entry within this range is a participant of the LUW, the operation is attempted.
*YES
The journal entries are applied from the entry specified on the FROMENT parameter to the
entry indicated on the TO option, honoring commitment boundaries.
• If the journal entry specified on the FROMENT parameter is in the middle of the LUW of
which it is a participant, an error message is sent and the operation is not attempted
• If the journal entry indicated on the TO option is in the middle of the LUW of which it is a
participant, the operation stops at the commitment boundary before that journal entry. A
diagnostic message is sent at the end of the operation
Note: If a journal entry is encountered that causes the operation to end before the entry
indicated on the TO option, commitment boundaries might not be honored.
Note: The values which are underlined are the defaults for the associated parameter.
7-62 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
RMVJRNCHG Command (Backout Recovery)
JRN: name
End: name
TOJOBO: job-name
Notes:
The Remove Journal Changes (RMVJRNCHG) command removes the changes that have
been journaled for a particular member of a database file. The journaled changes are
removed from the file from the specified starting point to the ending point. The journal
entries are processed in reverse of the order in which they were placed into the journal
receiver, from the most recent to the oldest. The starting point can be identified as the last
journal entry in the specified journal receiver range, the point at which a file was last saved,
or a particular entry in the receiver range. The ending point can be the first journal entry or
a particular entry in the specified journal receiver range, or the point at which a file was
opened by a specified job. The CMTBDY parameter can be used for handling changes that
are pending in the file.
If an error is found at any point while the journal entries are being removed, the operation
ends and the file member or members may be only partially updated from the journal
entries. The command ends when a journal entry is found that indicates one of the
following has occurred:
• The member is cleared
7-64 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty 5. If there is no journal entry that represents the entry specified on the FROMENT or
TOENT parameter, the command ends and no journaled changes are removed from the
files.
6. If the journal sequence numbers have been reset in the range of the receivers specified,
and a sequence number is specified on the FROMENT or TOENT parameter, the first
occurrence of the sequence number specified on either parameter is used.
7. The TOJOBO parameter cannot be used to specify when the remove journaled
changes operation is to end if one or more journal receivers in the specified receiver
range was attached to a journal with RCVSIZOPT(*MINFIXLEN) in effect.
8. This command cannot be used on or with a remote journal.
SAVCHGOBJ -
Journaling Considerations (1 of 3)
SAVCHGOBJ....OBJJRN(*NO)
WEEKLY DAILY
SAVIB LIB(LIBA LIBB) CHGJRN JRN(name) JRNRCV(*GEN)
LIBA
SAVCHGOBJ OBJ(*ALL) LIB(LIBA LIBB) OBJJRN(*NO)
FILEA
FILEB Changes
FILEC occur to FILEA
FILEA on
RCVR0001
Tuesday FILEA
JRNA RCVR0002
RCVR0001 RCVR0003
FILEA
LIBB RCVR0002
RCVR0001
RCVR0001
RCVR0002
RCVR0003
Notes:
The Save Changed Object (SAVCHGOBJ) command saves a copy of each changed object
or group of objects located in the same library. When *ALL is specified on the Objects
prompt (OBJ parameter), objects can be saved from all user libraries or from up to 300
specified libraries. When saving to a save file, only one library can be specified. For
database files, only the changed members are saved.
Objects changed since the specified date and time are saved with the following exceptions:
• If OBJJRN(*NO) is specified, database files currently being journaled are not saved,
unless journaling was started after the specified date and time. This ensures that
changes made to a physical file before journaling starts are not lost (because they were
not journaled in a journal receiver)
• Freed objects (programs, files, journal receivers, and so forth) are not saved
• User-defined messages, job and output queue definitions, logical file definitions, and
data queue descriptions are saved, but the contents of those objects are not saved.
Logical file access paths are saved if ACCPTH(*YES) is specified
7-66 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty Specified objects that were changed and the libraries where they reside remain locked
during the save operation.
Saved objects can be restored with the Restore Object (RSTOBJ) command.
To determine the date and time that an object was changed, run the Display Object
Description (DSPOBJD) command with DETAIL(*FULL) specified. For database file
members that were changed, run the Display File Description (DSPFD) command.
The types of objects that can be saved by this command are listed for the OBJTYPE
parameter in the Appendix, Expanded Parameter Descriptions. The system saves the
changed objects by writing a copy of each one on diskettes, tapes, optical volumes, or a
save file. The description of each object is changed with the date, time, and place when it
was last saved and is controlled by the UPDHST parameter.
Note: This command ignores all file overrides currently in effect for the job except for the
save output file.
Journaled objects (OBJJRN)
Specifies whether changes to objects currently being entered in a journal as specified in
the Start Journal Physical File (STRJRNPF) command are saved.
The possible values are:
*NO
Objects that are being journaled are not saved. If the Start Journal Physical File
(STRJRNPF) command was run after the specified date and time, all changed members
are saved. The date and time of the last journal start can be displayed by the Display File
Description (DSPFD) command.
*YES
Objects whose changes are entered in a journal are saved.
Reference date (REFDATE)
Specifies the reference date. Objects that have been changed since this date are saved.
The possible values are:
*SAVLIB The objects that have been changed since the date of the last running of the
Save Library (SAVLIB) command are saved. If the specified library was never saved, a
message is issued and the library is not saved, but the operation continues.
Reference-date
Specify the reference date. Objects that have been changed since this date are saved. If
you specify a date later than the date of the running of this command, a message is issued
and the operation ends. The date must be specified in the job date format.
Reference time (REFTIME)
Specifies the reference time. Objects that have been changed since this time on the
specified date are saved.
7-68 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
SAVCHGOBJ -
Journaling Considerations (2 of 3)
SAVCHGOBJ....OBJJRN(*YES)
WEEKLY DAILY
SAVIB LIB(LIBA LIBB) CHGJRN JRN(name) JRNRCV(*GEN)
LIBA
SAVCHGOBJ OBJ(*ALL) LIB(LIBA LIBB) OBJJRN(*YES)
FILEA
FILEB Changes
FILEC
occur to
Changes
FILEB on
occur to
JRNA Wednesday
FILEA on FILEA
Tuesday FILEA FILEB
LIBB
FILEB
RCVR0001 FILEA RCVR0001
RCVR0002 RCVR0001 RCVR0002
RCVR0003
RCVR0001 RCVR0002 RCVR0003
Notes:
SAVCHGOBJ -
Journaling Considerations (3 of 3)
Notes:
7-70 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Operations that Cause Incomplete Recovery
Notes:
After using APYJRNCHG or RMVJRNCHG, the journal receiver should be examined to see
the status or results of the operation. The journal receiver will have an F/AY entry to hold
the status or results of an APYJRNCHG and likewise an F/RC entry to hold the status or
results of an RMVJRNCHG. Look in the Count/PRN and flag fields of the entries.
Count/RRN
Either the relative record number (RRN) of the record which caused the journal entry to be
written, or a count which is pertinent to the specific type of journal entry. This field will be
blank except for the journal code/type combinations that follow:
F/AY
The number of journal entries applied by the Apply Journal Changes (APYJRNCHG)
command.
F/RC
The number of journal entries removed by the Remove Journal Changes (RMVJRNCHG)
command.
Flag
Additional information for certain kinds of journal entries. This field will be blank except for
the journal code/type combinations that follow:
F/AY, F/RC
Indicates the completion status.
• 0 - Apply or remove of journal changes completed normally
• 1 - Apply or remove of journal changes completed abnormally
7-72 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Illogical Conditions that Stop
APYJRNCHG or RMVJRNCHG
Attempts to do the following:
To add a record to an existing relative record number
To add a record beyond the next record position after the end of
the file
To add a record that has a duplicate key
To delete a deleted record
To update a nonexistent record
Examine Count/RRN and Flag of F/AY or F/RC
Notes:
Most illogical conditions are caused by starting the apply journaled changes operation at
the wrong place in the journal with respect to the current contents of the file members.
Note: If applying or removing journaled changes ends for one of the members specified, it
ends for all of the members specified.
If the command ends due to illogical conditions and it is logically possible to restart the
apply or remove operation, you can issue the command again specifying a new starting
sequence number.
It is possible to apply or remove changes even if the sequence numbers have been reset.
The system sends an informational message and continues to apply the changes.
Look in the F/AY or F/RC journal entry. Examine the Count/PRN and Flag fields to see the
result of the APYJRNCHG or RMVJRNCHG.
Notes:
• High change volume files are good candidates
• Files whose changes have no written records, such as those used for telephone order
entry are good candidates
• Consider the effect in your business during a delay to reconstruct a file
• If you journal one file, you should journal all files related to it
• Do not journal source files, since when a member is updated, every record is
considered changed and therefore written to the journal
7-74 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
How Should Files Be Assigned To Journals?
One journal - simple management and recovery
Application's files in same journal simplifies recovery
V2R3 or earlier: all files opened in same commitment definition must
use same journal
Backup, security or auditing requirements
Notes:
*LIB LIBJRNA
*JRNRCV JRCVA
*JRN JRNA
*LIB SAVFLIB
Notes:
If you are journaling many active files to the same journal, the journal receiver can become
a performance bottleneck. One solution is to put receiver in a user ASP. This also provides
additional protection.
The system spreads journal receivers across multiple disk units to improve performance.
The journal receiver may be placed across the ten fastest disk arms in the ASP. Journal
entries are written in a round robin technique with these arms.
7-76 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Restore Considerations
Recommended Restore Sequence (automatic if all in the same
library)
1. Journals
2. Physical files
3. Logical files
4. Journal receivers
RSTLIB LIB(name) - All objects within library restored in correct
sequence
RSTLIB LIB(*NONSYS *ALLUSR)
Libraries restored alphabetically
Notes:
When you restore a journal, the system creates a new journal receiver and attaches it. A
new receiver chain is started.
Notes:
Journal entries to be omitted (OMTJRNE)
Specifies the journal entries that are omitted.
The possible values are:
*NONE
To 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.
Receiver size options (RCVSIZOPT)
Specifies the options that affect the size of the receivers attached to the journal.
7-78 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
12
11 1
10 2
9
8
7
6
5
4
3
15
Aids debugging
Notes:
7-80 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Lab Exercises
Lab 4
Journal Management
Notes:
7-82 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Remote Journal
Journal entries transported to a duplicate receiver on a backup
iSeries
Used to replicate data remotely or provide a hot-backup site
OS/400 base support
Transport done below machine interface for better performance
Notes:
7-84 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Remote Journal - Hot Backup
Call to RCVJRNE
Receive
Applications exit program
and .
.
Apply jobs .
RC
DB Operation
Processing........
VJ
RN
E
Transport
Notes:
• Objects can not be journaled to remote journals
• Can not use SNDJRNE or API QJIOSJRNE to send entries to remote journal
How Does It Work?
• DB images transported in real time
• All transport managed below the MI (that is, in microcode)
• Memory to memory transfer - does not wait to reach target disk
• If the communications line goes down, source applications keep executing
Four transport mechanisms:
- Opticonnect (Optical bus)
- TCP/IP
- SNA (APPC)
- ATM
7-86 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Remote Journal Benefits
Less disk writes on source system than prior support
Less CPU overhead than prior support on source system
DB Images can be sent to target machine in real time
High availability (24x7)
Shift saving JRN receivers to the target machine
No lost transactions
Faster switch-back
Notes:
Differences from what's in the market today:
• Less disk writes on source system than former JRN support
- Greater DASD efficiency
- Adaptive bundling
• Less CPU overhead than prior support
- Frees up CPU cycles on production/source machine
- Shifts work to the backout/target machine
• DB images can be sent to target machine in real time
- SYNC mode
- No delay
- No trapped transactions
• If you need High availability (24x7)
7-88 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
How To Add A Remote Journal? (1 of 6)
Notes:
Add a remote journal with iSeries Navigator
1. In the iSeries Navigator window, expand the system you want to use
2. Expand Database
3. Expand the database you want to use
Notes:
4. Expand Libraries
5. Click on the library that contains the journal that you want to add a remote journal to
7-90 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
How To Add A Remote Journal? (3 of 6)
Notes:
6. Right-click the journal you want to add a remote journal to and select Properties
Notes:
7. On the Journal Properties dialog box, click Remote Journals
7-92 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
How To Add A Remote Journal? (5 of 6)
Notes:
8. To add (associate) a remote journal to this journal, click Add
Notes:
The Add a Remote Journal dialog associates a remote journal on the target system, as
identified by the relational database directory entry (WRKRDBDIRE), with the journal on
the source system. the journal on the source system may be either a local journal or
another remote journal. A maximum of 255 remote journals may be associated with a
single journal on a source system.
The remote journal will be created if it does not already exist. If a remote journal with the
specified name already exists on the target system, it will be reused if it was previously
associated with this journal.
Relational database name:
Lists the relational database (RDB) directory entries. Select the RDB directory entry that
you want.
7-94 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Redirect Receiver
Specifies whether or not to create the remote journal receivers on the target system
with a different library from that used on the source system.
If you chose a journal type of Type 1, you are adding a remote journal to a local journal,
and the local journal has no other Type 1 remote journals defined, the Redirect receiver
check box is not checked. The Target receiver library field is blank and not available
until this check box is checked.
If you chose a journal type of Type 1, you are adding a remote journal to a local journal,
and the local journal has other Type 1 remote journals defined, the Redirect receiver
check box and Target receiver library fields are set to whatever values are in effect for
the other remote journal. The fields are not available.
If you chose a journal type of Type 1, you are adding a remote journal to a remote
journal, the Redirect receiver check box and Target receiver library fields are set to
whatever values are in effect for the remote journal that you are adding the remote
journal to. The fields are not available.
If you chose a journal type of Type 2, the Redirect receiver check box is not checked,
and the Target receiver library field is blank and not available until this check box is
checked. If, however, you are adding a Type 2 to a remote journal of Type 2 that has
already specified a target receiver library, the Redirect receiver check box is checked
and not available, and the Target receiver library field defaults to the target receiver
library used by the source journal and can be changed.
Target receiver library
Allows you to specify the library on the target system where the remote journal
receivers are to be located. If this field is blank, receivers will reside in the same
libraries as on the source system.
Note: This function assumes that you have an RDB directory entry and that you have a
user profile on the target system.
7-96 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Remote Journal APIs
ADDRMTJRN Add Remote Journal (QjoAddRemoteJournal API)
Establishes and associates a remote journal on a target system with a journal on a
source system
Notes:
Alternatively to iSeries Navigator, you can use the Add Remote Journal (ADDRMTJRN)
Command or the Add Remote Journal (QjoAddRemoteJournal) API to add a remote
journal or with Business Partner Products (Need to install RJ-enabled Business Partner
product on both machines).
If you setup the remote journal with iSeries Navigator, CL-command or API, there are
• no application changes required
• no special feature to install
• no tuning mandated
• no extra housekeeping steps
Even Swap of Receivers is automated on the target.
CL-Commands:
The Add Remote Journal (ADDRMTJRN) command associates a remote journal on the
target system, as identified by the relational database directory entry, with the specified
journal on the source system. The journal on the source system may be either a local
journal or another remote journals. A maximum of 255 remote journals may be associated
with a single journal on a source system.
The Change Remote Journal (CHGRMTJRN) command is used to change the journal state
for remote journals. This command is used on the source system for a remote journal that
is associated with a source-system journal, to change the state of the remote journal from
*ACTIVE to *INACTIVE or from *INACTIVE to *ACTIVE. A journal state of *ACTIVE for a
remote journal indicates that journal entries can be received from the associated journal on
the source system. A journal state of *INACTIVE for a remote journal indicates that the
journal is not ready to receive journal entries from a source journal. This command also
allows additional attributes that are associated with the journal state to be set.
The Remove Remote Journal (RMVRMTJRN) command disassociates a remote journal on
the specified target system from the specified journal on the source system. The journal on
the source system may be either a local journal or another remote journal. The remote
journal, and any associated journal receivers, are not deleted from the target system by the
command processing. No processing is performed on the target system for the command.
The remote journal that remains on the target system may later be added back to the
remote journal definition for the journal on the source system by using the Add Remote
Journal (ADDRMTJRN) command.
The Change Journal (CHGJRN) command can be used to modify the other journal
attributes of remote journals, such as the journal message queue, deleting receivers, and
text. Special attention needs to be given to the base main storage pool size for both source
and target systems in order to keep page faulting to a minimum. See the Performance
section for other performance issues when working with remote journals.
7-98 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Notes:
7-100 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Access Path Protection
Benefit: Reduces IPL time after abnormal end
Notes:
Without access path protection, an IPL after an abnormal system end could take several
hours.
An access path describes the order in which records in a database file are processed. A file
can have multiple access paths, if different programs need to see the records in different
sequences. If your system ends abnormally when access paths are in use, the system may
have to rebuild the access paths before you can use the files again. This is a
time-consuming process. To perform an IPL on a large, busy iSeries server that has ended
abnormally can take many hours.
Two methods of access-path protection are available:
1. System-managed access-path protection (SMAPP)
2. Explicit journaling of access paths
Notes:
Access path maintenance (MAINT)
Specifies, for files with key fields, the type of access path maintenance used for all
members of the physical file.
The possible values are:
*IMMED
The access path is updated each time a record is changed, added, or deleted from a
member. *IMMED must be specified for files that require unique keys.
*REBLD
The access path is completely rebuilt each time a file member is opened. The access path
is maintained until the member is closed; then the access path is deleted. *REBLD cannot
be specified for files that require unique keys.
7-102 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty *DLY
The maintenance of the access path is delayed until the physical file member is opened for
use. Then, the access path is changed only for records that have been added, deleted, or
changed since the file was last opened. While the file is open, changes made to its
members are immediately reflected in the access paths of those members, no matter what
is specified for MAINT. To prevent a lengthy rebuild time when the file is opened, *DLY
should be specified only when the number of changes to the access path between
successive opens are small; that is, when the file is opened frequently or when the key
fields in records for this access path change infrequently. *DLY is not valid for Access paths
that require unique key values.
If the number of changes between a close and the next open reaches approximately 10
percent of the access path size, the system stops saving changes and the access path is
completely rebuilt the next time the file is opened.
Access path recovery (RECOVER)
Specifies, for files with immediate or delayed access path maintenance, when recovery
processing of the file is performed if the access path is being changed when a system
failure occurs. This parameter is valid only for a file with a keyed access path.
If *IMMED is specified for the MAINT parameter, the access path can be rebuilt during
initial program load (IPL) (before any user can run a job), or after IPL has ended (during
jobs running at the same time), or when the file is next opened. While the access path is
being rebuilt, the file cannot be used by any job.
During the IPL, an Override Access Path Recovery display lists those access paths that
must be recovered and the RECOVER parameter value for each access path. The user
can override the RECOVER parameter value on this display. More information on access
paths is in the iSeries Backup and Recovery.
If *REBLD is specified for the MAINT parameter, the access path is rebuilt the next time its
file is opened.
The possible values are:
*NO
The access path of the file is rebuilt when the file is opened. *NO is the default for all files
that do not require unique keys. The file's access path, if not valid, is rebuilt when the file is
next opened.
Note: *NO is the default for all files that do not require unique keys.
*AFTIPL
The access path of the file is rebuilt after the initial program load (IPL) operation is
completed. This option allows other jobs not using this file to start processing immediately
after the completion of the IPL. If a job tries to allocate the file while its access path is being
rebuilt, a file open exception occurs.
Note: *AFTIPL is the default for all files that require unique keys.
*IPL
The access path of the file is rebuilt during the IPL operation. This ensures that the file's
access path is rebuilt before the first user program tries to use it; however, no jobs can start
running until after all files that specify RECOVER(*IPL) have their access paths rebuilt.
Force keyed access path (FRCACCPTH)
Specifies, for files with key fields, whether access path changes are forced to auxiliary
storage along with the associated records in the file. FRCACCPTH(*YES) minimizes (but
does not remove) the possibility that an abnormal job end may cause damage to the
access path that requires it to be rebuilt.
The possible values are:
*NO
The access path and associated records are not forced to be written to auxiliary storage
when the access path is changed.
*YES
The access path and associated records are forced to be written to auxiliary storage when
the access path is changed. *YES cannot be specified if *REBLD is specified on the
Access path maintenance prompt (MAINT parameter).
FRCACCPTH(*YES) slows the response time of the system if the access path is changed
in an interactive job. If the access path is changed frequently, the overall performance of
the system is decreased.
Note: The default of the parameters are underlined.
7-104 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
EDTRBDAP Command
Notes:
This display will appear during an attended IPL after an abnormal system end.
The Edit Rebuild of Access Paths display shows the names of the file members that have
immediate or delayed maintenance access paths that are not valid.
The display allows you to rebuild the access path for a given member of the file. The
access path for a file member is marked as not valid when the system ends abnormally and
the file member is in use.
Files with journaled access paths and files with rebuild maintenance of the access path are
not shown on the Edit Rebuild Access Path display.
When a sequence value is selected and the Enter key is pressed, the status field is
updated to show the current rebuild condition of the access path.
If you see More... on the lower right side of your display, there is more information to view.
Press Page Down (or Roll Up) to move toward the end of the information. Press Page Up
(or Roll Down) to move toward the beginning of the information.
If you see Bottom instead of More..., you are at the end of the information.
7-106 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Explicit Access Path Journaling (Protection)
You decide which access paths to protect
Underlying physical file(s) must be journaled
STRJRNAP for file with the access path
Access path and file use same journal
Encoded vector access paths not eligible
Notes:
As mentioned earlier, if your system ends abnormally when access paths are in use, the
system may have to rebuild the access paths before the database can be used again.
To perform an IPL on a large, busy iSeries that has ended abnormally can take many
hours.
Two methods of access-path protection are available:
• Explicit journaling of access paths
• System-managed access-path protection
Explicit journal management may be used to keep a record of changes to access paths.
This greatly reduces the amount of time it takes the system to perform an IPL after it ends
abnormally. However, this method requires the user to decide which access paths should
be journaled and how the journaling should be controlled.
The need to protect some access paths may have be obvious but, for other access paths,
the need may not be so obvious. For example, the use of a file may vary from time-to-time
during the day or even over a cycle as long as a year. It is easy to omit an access path.
Protecting every access path may consume system resources unnecessarily and omission
of the wrong path could affect availability in the event of an abnormal termination.
Most users make a decision based on their experience with their applications.
An alternative to a user controlled access path protection scheme is to use the System
Managed Access Path Protection (SMAPP) facility.
7-108 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
System Managed
Access Path Protection - SMAPP
Reduces IPL time after abnormal end
User sets target recovery time
Automatic
Determines which access paths to journal
Adjusts for system hardware and file changes
Files not journaled - uses internal journal and receiver
Files already journaled - uses same journal and receiver
Will not duplicate protection if access path already journaled
Notes:
You can allow the system to determine which access paths to protect. You specify target
recovery times for access paths for the entire system or for auxiliary storage pools (ASPs).
Your system has a default recovery time for access paths for the entire system of 90
minutes when it is shipped. You can use the Edit Recovery for Access Paths (EDTRCYAP)
command to see and change the target recovery times for access paths and to see how
much space the system is using for system-managed access-path protection (SMAPP).
SMAPP provides a simple method to reduce your recovery time after an abnormal system
end. SMAPP manages the required environment for you. You do not need to use any type
of journal management to use SMAPP.
• Automated
- You need NOT take any action to benefit
- Adapts to new LFs and APs as they arrive
- No files get overlooked
- Uses an algorithm somewhat similar to journaling without as much disk space or
CPU overhead
Some access paths are not eligible for protection by SMAPP including the following:
• Those defined for file that specifies MAINT(*REBLD)
• Any access path that is already explicitly journaled
• Any access path in the QTEMP library
• Any access path whose underlying physical files are journaled to different journals
• Any access path for a physical file that was created specifying FRCACCPTH(*YES)
• Any encoded vector access path
7-110 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
SMAPP Performance
and Auxiliary Storage Use
Low target recovery time has greater impact on performance
Asynchronous writes, which do not directly affect response time for a
transaction
Specify target recovery times either for entire system or ASPs, but
not both.
Storage space for journal receivers
System manages internal receiver space.
Internal receivers are more condensed - less space
Uses existing receiver if file is already being journaled
RCVSIZOPT(*RMVINTENT) saves space at a small performance
cost
Can be turned off
Increased disk activity
Usually small impact on CPU
Notes:
• Disk space consumed
- AP JRN requires customer to change Journal receivers, can overflow an ASP, and
consumes hundreds of megabytes per day
- SMAPP logging area is circular and consumes less space
• JRNRCVR placement
- AP JRN requires Journal placement on user ASP to achieve best performance
- SMAPP spreads logging area among ten fastest arms, with affinity for arms with
write cache, bundles writes to 32K, and performs 10 writes in parallel
• Performance impacts
- AP JRN performs a synchronous write to the disk for each DB operation (Add,
Delete, Update)
- SMAPP provides just as good protection with bundled async writes thereby reducing
total number of writes and performance overhead
Notes:
The system does not keep track of the access path rebuild exposure when SMAPP
protection is set to *OFF.
The Edit Recovery for Access Paths display shows a list of access path recovery times for
the system and for auxiliary storage pools (ASP) that are currently on the system. The
information shown reflects the current target and estimated access path recovery times.
Note: The ASP information is not shown when the system ASP (ASP 1) is the only ASP
that exists.
On this list, you can type changes for the target access path recovery times for the system
and for the ASPs. You can also view updated access path recovery status information.
Estimate system access path recovery time
The estimated system access path recovery time is the estimated total amount of time (in
minutes) that the system will take to recover the access paths on the system during initial
program load (IPL) after an abnormal system end.
7-112 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty This value assumes that all access paths eligible for protection are recovered or built at
IPL.
Access paths that are not eligible for protection are those that are in library QTEMP, those
with *REBLD maintenance, and those whose underlying physical files are journaled to
different journals.
The time taken to rebuild access paths exposed while running the Copy File (CPYF), the
Reorganize Physical File Member (RGZPFM), or the Restore Object (RSTOBJ) commands
is not considered in the estimated access path recovery time.
• Plus signs (+++++) are shown when the estimated access path recovery time is greater
than 32,767 minutes
• This field is blank when system-managed access-path protection is turned off (target
system access path recovery time of *OFF)
Note: If you have only one processing unit and user ASPs, this value is the sum of the
estimated access path recovery times given per auxiliary storage pool (ASP). If you have
multiple processing units and user ASPs, this value can be significantly less than the sum
of the estimated access path recovery times per ASP. With more than one processing unit,
the system can recover more than one access path at the same time, and therefore more
than one ASP at the same time.
Total storage used
The total amount of auxiliary disk storage used by internal objects that are used exclusively
for system-managed access-path protection (SMAPP). This value is expressed in
megabytes (1,000,000 bytes) and is the sum of the auxiliary storage used for access-path
protection for each auxiliary storage pool (ASP).
Note: This value does not include the additional space that is used by SMAPP on a
user-created journal or journal receiver. (Additional space on the user-created journal
receiver is used only when the user is journaling a file at the same time the system is
protecting an access path built over that file. Both the file and the access path must be
journaled to the same journal.)
% of storage used
The total amount of auxiliary disk storage used exclusively for system-managed
access-path protection as a percentage of the total amount of system auxiliary disk
storage.
System access path recovery time
The system access path recovery time can be changed by typing a new value over the
current value.
The target system-managed system access path recovery time is the time (in minutes)
targeted for access-path protection for the system.
• *SYSDFT - The system access path recovery time is set to the system default value of
120 minutes.
7-114 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
SMAPP Summary
Automatic
Not much DASD consumed
Not much performance overhead
Does NOT miss any files
Needs no special setup, no ASPs required
No special hardware
Covers broad spectrum of outage causes
Substantial IPL/Recovery time reductions
Notes:
Outage causes covered;
• Pumped DASD, power, CPU cards, Memory, software, operator
• Nearly all except DASD failure
- Raid-5 and mirroring cover these
7-116 iSeries System Administration and Control © Copyright IBM Corp. 1995, 2003
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V2.0.0.3
Student Notebook
Uempty
Unit Summary
Describe how journal management can be used to recover data lost
during a failure
Implement journal management on your iSeries system as part of a
comprehensive recovery plan
List the advantages and considerations of journal management
List the advantages and considerations of journaling access paths
Describe remote journaling and how it can be used to replicate data
or to implement a hot-backup environment on a remote system
Notes: