Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Journal

Download as pdf or txt
Download as pdf or txt
You are on page 1of 117

V2.0.0.

3
Student Notebook

Uempty Unit 7. Journal Management

What This Unit is About


Journal management is a very valuable and powerful tool which is an
integral part of the operating system. When used properly as part of a
comprehensive recovery plan, it significantly improves the ability of the
administrator to recover from many types of job and system failures.

What You Should Be Able to Do


After completing this unit, a student 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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
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

Figure 7-1. Objectives OL197.0

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

Uempty 7.1 Overview of Journal Management

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-3


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Think About Your Most Important Data File

DATA
FILE

What if it disappeared?

How would you get it back?


- RSTOBJ
- Rekey all data from last save plus data since last save

How much time would it take?

Need to shorten the recovery time for data files?

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

*PGM Magnetic Storage


Disk Drives
Delete
Update
Write 1
2
*JRN *JRNRCV
Buffer
Disk File A File A File A
I/O
3
4

Data File
Scatter Loading

Figure 7-3. Single Level Storage OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-5


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Journal Objects

Journaling Data Flow

PGMX PGMY

Object A Object B Object B Object C


Change Change Change Change

Journal
Receiver

Object A Change
Object B Change
Object B Change

Obj. A Obj. B Obj. C

Figure 7-4. Journal Objects OL197.0

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)

Note: IFS objects must be in the Root('/'), QOpensys, User-defined


file system

Figure 7-5. Objects that can be journaled OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-7


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

• 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

Figure 7-6. Displaying Journal Entries OL197.0

Notes:

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-9


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Display Journal Entry

Figure 7-7. Display Journal Entry OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-11


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

F10 = Display Only Entry Details

Figure 7-8. F10 = Display Only Entry Details OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-13


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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( )

2. Create the journal


CRTJRN JRN( ) JRNRCV( )

3. Start journaling for selected


objects
STRJRNxxx objects( ) JRN( )
4. Save the objects
That's it!
Figure 7-9. Implementing Journaling OL197.0

Notes:

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-15


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

CRTJRNRCV Command

Figure 7-10. CRTJRNRCV Command OL197.0

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

Uempty Auxiliary storagepool ID (ASP)


Specifies the auxiliary storage pool (ASP) from which the system allocates storage for
the journal receiver.
The possible values are:
*LIBASP
The storage space for the journal receiver is allocated from the same auxiliary
storage pool as the storage space of the journal receiver's library. The word
*LIBASP is underlined because it is the default value for the parameter ASP
number.
1
The storage space for the journal receiver is allocated from the ASP (1), the system
auxiliary storage pool.
Auxiliary-storage-pool-identifier
Specify a value ranging from 1 through 16 as the identifier of the ASP.
Note: The value of 1 is the system ASP.
Journal receiver threshold (THRESHOLD)
Specifies a storage space threshold value in (KB) for the journal receiver. If the
threshold value is exceeded during journaling, one of the following occurs:
• The message CPF7099 is sent to the journal message queue if the journal has the
MNGRCV(*USER) attribute
• The system attempts to create and attach a new receiver if the journal has the
MNGRCV(*SYSTEM) attribute. When the old receiver is detached, the message
CPF7020 is sent to the journal message queue. If the attempt fails due to lock
conflicts, the system sends the message CPI70E5 and then tries again every ten
minutes until the change journal operation is successful
• When the system cannot determine if the journal has the MNGCRV(*SYSTEM)
attribute, or if the attempt to create and attach new journal receiver fails because of
something other than a lock conflict, the message CPI70E3 is sent
The journal message queue is specified on the CRTJRN (Create Journal) or CHGJRN
(Change Journal) command.
Note: The value for the MNGRCV parameter is specified for the journal on the CRTJRN
or CHGJRN command. If you have not specified system change-journal management
(*SYSTEM), and the threshold value is exceeded, you may want to take some action,
such as issuing a CHGJRN command.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-17


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

The possible values are:


*NONE
No threshold value is specified. The message CPF7099 is not sent and
MNGRCV(*SYSTEM) cannot be specified when attaching this receiver to a journal.
Threshold-value
Specify a value ranging from 1 through 1920000 in kilobytes (KB) of storage. Each
1000 KB specifies 1,024,000 bytes of storage space. When the size of the space for
the journal receiver is larger than the size specified by this value, a message is sent
to the identified message queue if appropriate, and journaling continues.
Notes:
1. It is recommended that the threshold value be no less than 5000. Otherwise, you
may see the threshold exceeded message to frequently. Also, if the threshold
value is too small, the threshold exceeded message may occur when the journal
receiver is attached to a journal either with the Create Journal (CRTJRN)
command or the Change Journal (CHGJRN) command.
2. If you plan to use the system change-journal management support, the threshold
must be a minimum of 5000 KB.

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

Figure 7-11. CTRJRN Command OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-19


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

MNGRCV - *USER - User must manage changing journal receivers.


DLTRCV - If you specify MNGRCV(*SYSTEM) you can specify DLTRCV(*YES) to have
detached journal receivers automatically deleted if they are no longer needed by the
system. The system can not determine if you need receivers to recover applications. It can
only determine if it needs a receiver for commitment control or for access path recovery. If
a receiver is automatically deleted in this manner, the system does not issue a warning
message if the receiver has not been saved.
RCVSIZOPT(*RMVINTENT) - To reduce the size of your receivers, at a slight performance
cost, you can have the system automatically and periodically remove internal system
entries.
RCVSIZOPT(*MINFIXLEN) - Job, program and user profile information is not included in
the entries. Do not choose this option if you need the information for an audit trail. It also
limits selection criteria in these commands: DSPJRN, RCVJRNE, RTVJRNE,
CMPJRNIMG, APYJRNCHG AND RMVJRNCHG.

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

Figure 7-12. STRJRNPF Command OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-21


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

STRJRNOBJ Command

Figure 7-13. STRJROBJ Command OL197.0

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)

Figure 7-14. STRJRN Command (1 of 2) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-23


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

STRJRN Command (2 of 2)

Figure 7-15. STRJRN Command (2 of 2) OL197.0

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

Figure 7-16. iSeries Navigator - Start Journaling OL197.0

Notes:
You can start journaling files, data areas, and data queues using iSeries Navigator panels.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-25


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

Figure 7-17. Save Objects OL197.0

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

MNGRCV(*USER): CHGJRN JRN(name) JRNRCV(*GEN)


SEQOPT(*CONT or*RESET)
*PGM

RCV0001
Old
Receiver

RCV0002
Current
Receiver
*File

Figure 7-18. Managing the Receiver Chain OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-27


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

System Change Journal Management


CRTJRN ... MNGRCV(*SYSTEM)
Threshold: Receiver changed automatically and message sent
IPL: Receiver changed automatically with sequence number
reset

CRTJRN ... MNGRCV(*SYSTEM) DLTRCV(*YES)


Detached receiver automatically deleted as soon as it is not
needed for recovering access paths or rolling back uncommitted
changes
CAUTION: Journal receivers deleted automatically and without
sending the usual inquiry message that it has not been saved

DLTRCV(*YES) uses
Journaling for commitment control or explicit access path protection
Journal receiver is being replicated via remote journal

Figure 7-19. System Change Journal Management OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-29


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Journal Receiver Chain

J PR RCV0006

RCV0007
J NR RCV0008

J PR RCV0007

RCV0008
J NR RCV0009

Figure 7-20. Journal Receiver Chain OL197.0

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

Figure 7-21. WRKJRNA Command OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-31


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

Figure 7-22. F15 = Work with Receiver Directory OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-33


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

CHECKING JOURNAL STATUS/DAMAGE

Figure 7-23. WRKJRN Command OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-35


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Forward Recovery
1. WRKJRN

2. Option 2 = Forward recovery

3. Option 2 = Apply journaled changes (all PFs to recover).

System deletes dependent LFs

System deletes PFs

Prompts restore of PFs and allocates

*EXCL until recovery complete.

Prompts for restore of LFs.

APYJRNCHG prompted with

FROMENT(*LASTSAVE) and TOENT(*LASTRST).

Prompts for receivers not online

Figure 7-24. Forward Recovery OL197.0

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

Figure 7-25. Work with Forward Recovery OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-37


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

2=Apply journaled changes


Causes the Apply Journal Changes (APYJRNCHG) command prompt to be shown with
known values already assigned. You can then run the command to apply 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.
3=Restore
Causes the system to display a Restore Object (RSTOBJ) command prompt for restoring
the database file. The system will verify that all members requested are restored. If
members are restored that were not on your recovery list, the system will add them to the
list.
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.
4=Remove member from list
Causes the member to be removed from the recovery list.
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.
Status
The status of the member relative to it's recovery process. The status of each member can
change as the recovery process progresses.
The status definitions are:
Blank
The member and the journal objects are all usable and everything is synchronized. None of
the journal objects need to be recovered prior to continuing recovery of the member.
NOT SYNCHRONIZED
The journal receiver used for this member are damaged and will need to be recovered
before the member can be recovered.
To recover a member with this status, first go back to the Work with Journals menu
(F3=Exit) and take the option to recover damaged journal receiver(s).
DAMAGED
The member is damaged and will need to be restored as part of the recovery process. The
system will insure you go through the restore step as you continue the recovery process.
NOT FOUND
The system cannot locate the specified database file. The system will ensure that the file
has been restored before proceeding with the recovery.

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

Uempty DIFFERENT JOURNAL


The member is not journaled to the journal you are working with. You will need to work with
the correct journal to recover this database file. Use the Display File Description (DSPFD)
command to determine the correct journal.
NOT JOURNALED
The member is not journaled to any journal. It cannot be recovered.
RESTORE COMPLETE
When the recovery process requires a restore of the database file, this status is shown
once the restore has successfully completed. If a restore is unsuccessful, messages will be
displayed and the status will remain unchanged.
RECOVERED
When the recovery completes successfully, this status is shown. If the recovery is
unsuccessful, messages will be displayed and the status will remain unchanged.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-39


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
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

Figure 7-26. Backout Recovery OL197.0

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

Figure 7-27. Work With Backout Recovery OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-41


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Determine Start/Stop Entries


for APYJRNCHG, RMVJRNCHG

*JRN

DSPJRN

FILE(names)
*CURRENT
RCVRNG RCV00010
Start(*CURRENT/name)
End(name/*CURRENT) RCV0009

FROMENT(*FIRST/seq#) RCV0008

TOENT(*LAST/seq#) RECEIVER SAVED


TO TAPE

Figure 7-28. Determine Start/Stop Entries for APYJRNCHG, RMVJRNCHG OL197.0

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

JRN (name) JRNCDE (*ALL/list)


FILE *ALLFILE
name/*ALL
ENTTYP (*ALL/list)
RCVRNG
Start (*CURRENT/name) JOB (*ALL/name)
End (name/*CURRENT)

FROMENT (*FIRST/seq #) PGM (*ALL/name)


FROMTIME ( )
USRPRF (*ALL/name)
TOENT (*LAST/seq #)
TOTIME ( ) CMTCYCID ( )

NBRENT (*ALL/#)
DEPENT (*ALL*NONE)

OUTFMT (*CHAR *HEX)

Figure 7-29. DSPJRN Command Keywords OL197.0

Notes:
OUTPUT(* *PRINT *OUTFILE). If *OUTFILE is chosen, the journal entries are written to a
data base file, which can be queried.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-43


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Display Journal (1 of 3)

Figure 7-30. Display Journal (DSPJRN) (1 of 3) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-45


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Display Journal (2 of 3)

Figure 7-31. Display Journal (DSPJRN) (2 of 3) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-47


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Display Journal (3 of 3)

Figure 7-32. Display Journal (DSPJRN) (3 of 3) OL197.0

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

Uempty Journal identification number (JRNID)


Specifies the five-character journal identification number (ID) of the internal system journal
(*INTSYSJRN) to be displayed. Journal IDs are assigned by the system. The first two
characters represent the journal type, and the last three characters are the auxiliary
storage pool (ASP) identifier. Following is a listing of journal types.
Journal Types
10 System-managed access path protection (SMAPP)
20 Directory
Output (OUTPUT)
Specifies whether the output from the command is shown at the requesting work station,
printed with the job's spooled printer output, or sent to the database file specified on the
File to receive output prompt (OUTFILE parameter).
When the output of the command is directed to the requesting work station, basic
information on the journal entries is shown. From the basic display, an option can be
selected to show information in detail for any journal entry being shown.
If the output is printed with the job's spooled printer output, all Display Journal - Help of the
information that would be shown is printed.
The possible values are:
*
The output is shown (if requested by an interactive job) or printed with the job's spooled
output (if requested by a batch job). The default output is shown on the display and
therefore the asterisk is the default value for this parameter and you could recognize this
because the asterisk is underlined.
*PRINT
The output is printed with the job's spooled output.
*OUTFILE
The output is directed to the database file specified on the File to receive output prompt
(OUTFILE parameter).
Outfile format (OUTFILFMT)
Specifies the format of the journal entries written to the output file specified on the File to
receive output prompt (OUTFILE parameter). This parameter can be specified only if the
value *OUTFILE is specified on the OUTPUT parameter.
The information fields and the format of the information in each journal entry is shown in
tables for this parameter in the command description in the CL Reference, SC41-5722
book.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-49


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

The possible values are:


*TYPE1
The converted entries are formatted to include the minimum information that can be
specified. This value is underlined because it is the default value for this parameter.
*TYPE2
The converted entries include the information returned when OUTFILFMT(*TYPE1) is
specified, the name of the user profile for the job that generated the displayed journal
entries, and the name of the system on which the output records were generated.
*TYPE3
The converted journal entries include all the information returned when
OUTFILFMT(*TYPE2) is specified, and the null value indicators.
*TYPE4
The converted entries include the information returned when OUTFILFMT(*TYPE3) is
specified, the journal identifier, the physical file trigger indicator, and the referential
constraint indicator.
File to receive output (OUTFILE)
Specifies the name and library of the database file to which the output of the command is
directed. If the output file already exists, the system attempts to use it. Records may
replace or be added to the current data in the file member. If no records are written to the
database file (because of the specified selection values), and *REPLACE is specified on
the OUTMBR parameter, records are cleared from the existing database file. If the file does
not exist, this command creates a database file in the specified library.
• If a new file is created and *TYPE1 is specified on the Outfile format prompt
(OUTFILFMT parameter), the system uses QADSPJRN in QSYS with a format name of
QJORDJE as a model
• If a new file is created and *TYPE2 is specified on that parameter, the system uses
QADSPJR2 in QSYS with a format name of QJORDJE2 as a model
• If a new file is created and *TYPE3 is specified on that parameter, the system uses
QADSPJR3 in QSYS with a format name of QJORDJE3 as a model
• If a new file is created and OUTFILFMT(*TYPE4) is specified, the system uses
QADSPJR4 in QSYS with a format name of QJORDJE4 as a model
The possible operation values are:
*REPLACE
The system clears the existing member and adds the new records.
*ADD
The system adds the new records to the end of the existing records.

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

Uempty Entry data length (ENTDTALEN)


Specifies the maximum field length of the entry specific data portion of the journal entry
when the output file is created by the system. This field contains part of the variable portion
of the journal entries (such as the after-image of records for update journal entries). If the
output file exists, this parameter is ignored.
For this parameter, a single value or a single list of three elements can be specified.
The possible single values are:
*OUTFILFMT
The field length of the entry specific data field in the output file is determined by the value
specified on the Outfile format prompt (OUTFILFMT parameter). The attributes of this field
are the same as those of the entry specific data field in the corresponding model output file
supplied by the system. Also the value here is underlined because it is the default value for
this parameter.
If *TYPE1 or *TYPE2 is specified on the Outfile format prompt (OUTFILFMT parameter),
the entry specific data field in the output database file is a fixed-length field 100 characters
long.
If *TYPE3 or *TYPE4 is specified on Outfile format prompt (OUTFILFMT parameter), the
entry specific data field in the output file is a variable length field with a maximum field
length of 100 characters and an allocated length of 100 characters. The buffer is 2 bytes
longer than the maximum field length to include the length portion of the variable length
field.
The system calculates the length of the entry specific data field to accommodate the
longest entry specific data among all journal entries in the specified receiver range.
Field-length
Specify a field length of the entry specific data portion of the output file.
Include Entries (INCENT)
Specifies whether only the confirmed, or both the confirmed and unconfirmed, journal
entries are converted for output. This parameter only applies when converting journal
entries for output from a remote journal.
The possible values are:
*CONFIRMED
Only those journal entries which have been confirmed are converted for output. It is the
default value for this parameter.
*ALL
All confirmed and unconfirmed journal entries are converted for output.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-51


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Journal Codes

Selected Entry Classifications

Journal Code Type Description

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

Figure 7-33. Journal Codes OL197.0

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)

Figure 7-34. Recovery Point Example (1 of 2) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-53


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Recovery Point Example (2 of 2)

Figure 7-35. Recovery Point Example (2 of 2) OL197.0

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

Figure 7-36. User Generated Entries OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-55


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Record Application Checkpoints: SNDJRNE

Figure 7-37. Record Application Checkpoints: SNDJRNE OL197.0

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

Uempty 2. This command cannot be used on or with 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.
Journal entry type (TYPE)
Specifies the journal entry type of this journal entry.
The possible values are:
00
The journal entry type is a '00' (hex FOFO).
'Entry-type'
Specify a 2-character value or hex value used for the journal entry type. This value must be
greater than or equal to hex C000.
If a hexadecimal value is specified that does not represent characters, that value is not
shown on the DSPJRN display or on the printout.
Entry data (ENTDTA)
Specifies the user-specified data that is placed in the variable portion of the journal entry.
The possible values are:
*BLANK
No user-specified data is placed in the journal entry.
'Entry specific-data'
Specify no more than 3000 characters, enclosed in apostrophes.
Journaled physical file (FILE)
Specifies the name and library of a database physical file and member with which this entry
is associated.
Force journal entry (FORCE)
Specifies whether the journal receiver is forced to auxiliary storage after the user entry is
placed on it.
The possible values are:
*NO
The journal receiver is not forced to auxiliary storage.
*YES
The journal receiver is forced to auxiliary storage.

Note: The underlined values are the defaults for the associated parameter.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-57


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

APYJRNCHG Command (Forward Recovery)


JRN: name

FILE: *LIBL*CURLIBname/*ALL name

RCVRNG: Start: Name *LASTSAVE *CURRENT

End: Name *CURRENT

FROMENT: *LASTSAVE number *FIRST

TOENT: *LASTRST number *LAST

TOTIME: Date Time

TOJOBO: job-name

TOJOBC: job-name

CMTBDY: *NO *YES

Figure 7-38. APYJRNCHG Command (Forward Recovery) OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-59


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-61


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

*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

FILE: *LIBLname *CURLIB/name *ALL

RCVRNG: Start: *CURRENT name

End: name

FROMENT: *LAST number *LASTSAVE

TOENT: *FIRST number

TOJOBO: job-name

CMTBDY: *NO *YES

Figure 7-39. RMVHRNCHG Command (Backout Recovery) OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-63


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

• The member is saved and its storage is freed


• The member is reorganized
• The member is restored
• The member has its end-of-data specification changed
• Journaling has started for the member
• The member is deleted
• Journal initial program load (IPL) synchronization fails
• The system has already applied or removed the changes through the Apply Journal
Changes (APYJRNCHG) command or the 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. If the command ends due to illogical
conditions and it is logically possible to restart the operation, you can issue the command
again, specifying a new starting sequence number.
Note: If the operation ends for one of the members specified, it ends for all of the members
specified.
Journal entry changes can be removed even if the sequence numbers have been reset.
The system handles this condition, sends an informational message, and continues the
removal of journaled changes. If journal receivers are attached and detached in pairs (dual
receivers), the system tries to use the first of the two receivers. (The order of the receivers
can be viewed on the Work with Receiver Directory display, which can be accessed using
the Work with Journal Attributes (WRKJRNA) command.) When the first receiver is not
usable (for example, because it is damaged or not found), the system tries to use the
second receiver of the pair. If neither receiver is usable, the removal of journaled changes
ends.
Restrictions:
1. This command is shipped with public *EXCLUDE authority and QPGMR and QSRV
user profiles have private authorities to use the command.
2. The files specified on this command must currently be having their changes journaled,
and they must have been journaled to the specified journal throughout the period
indicated on the command.
3. Before images are required for the files (see the Start Journal Physical File
(STRJRNPF) command).
4. The files indicated on the command are allocated exclusively while the changes are
being removed. If a file cannot be allocated exclusively, the command ends and no
journaled changes are removed from the files.

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-65


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

MONDAY TUESDAY WEDNESDAY THURSDAY

Figure 7-40. SAVCHGOBJ Journaling Considerations (1 of 3) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-67


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

The possible values are:


*NONE
No explicit time is specified. Any objects changed since the date specified by the
Reference date prompt (REFDATE parameter) are saved.
Reference-time
Specify the reference time. Objects that have been changed since this time on the
specified date are saved. If *SAVLIB is specified on the Reference date prompt (REFDATE
parameter), no reference time can be specified. If you specify a time later than the time of
the running of this command, a message is issued and the operation ends.
The time can be specified with or without a time separator:
• Without a time separator, specify a string of 6 digits (hhmmss) where hh = hours, mm =
minutes, and ss = seconds
• With a time separator, specify a string of 8 digits where the time separator specified for
your job is used to separate the hours, minutes, and seconds. If you enter this
command from the command line, the string must be enclosed in apostrophes. If a time
separator other than the separator specified for your job is used, this command will fail
Note: The values that are underlined are the default values for the associated parameter.

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

MONDAY TUESDAY WEDNESDAY THURSDAY

Figure 7-41. SAVCHGOBJ Journaling Considerations (2 of 3) OL197.0

Notes:

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-69


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

SAVCHGOBJ -
Journaling Considerations (3 of 3)

Forward Recovery After Data Loss on Friday


1. Load SAVLIB tape
2. RSTLIB
3. Load SAVCHGOBJ tape for Thursday
4. RSTOBJ OBJ(*ALL)
5. APYJRNCHG
6. Rekey data since Thursday's SAVCHGOBJ tape

Figure 7-42. SAVCHGOBJ Journaling Considerations (3 of 3) OL197.0

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

Code Type Operation APYJRNCHG RMVJRNCHG

F AY Journal changes applied Ends Ends


F CR Member-cleared Cleared Ignores
F IU File not synchronized Ends Ends
F JM Start journaling member Ignores Ends
F MD Member deleted Ends Ends
F MF SAVxx STG(*FREE) Ends Ends
F MR Member restored Ends Ends
F RC Journaled changes removed Ends Ends
F RG Member reorganized Ends Ends
F SA Start APYJRNCHG Ends Ends
F SR Start RMVJRNCHG Ends Ends

Examine Count/RRN and Flag of F/AY or F/RC

Figure 7-43. Operations that Cause Incomplete Recovery OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-71


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

Figure 7-44. Illogical Conditions that Stop APYJRNCHG or RMVJRNCHG OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-73


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Which Files Should Be Journaled?


How much does the file change?
How difficult would it be to reconstruct file changes?
How critical is the file?
How does the file relate to other files?
All files in an application
All files in a referential constraint network
All files affected by trigger programs
Not source files

Figure 7-45. What Files Should Be Journaled? OL197.0

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

Figure 7-46. How Should files Be Assigned to Journals? OL197.0

Notes:

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-75


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Should Journal Receivers Be in a User ASP?


System ASP - operating system and user objects
Library user ASP (Library is first object in ASP)
*JRN must be in library ASP with journaled file
*JRNRCV may be in different ASP
Non-library user ASP (not recommended)
First object in ASP is a journal, journal receiver or save file

ASP1 ASP2 ASP3


System ASP User ASP User ASP
"Library user ASP" "Non-library user ASP"

*LIB CUSTLIB *LIB LIBJRNB *JRNRCV JRCVB


*FILE *JRN JRNB
*FILE *SAVF ORDSAV

*LIB LIBJRNA
*JRNRCV JRCVA
*JRN JRNA

*LIB SAVFLIB

Figure 7-47. Should Journal Receivers Be in a User ASP? OL197.0

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

Figure 7-48. Restore Considerations OL197.0

Notes:
When you restore a journal, the system creates a new journal receiver and attaches it. A
new receiver chain is started.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-77


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Other Journal Considerations


Before images
Backout recovery possible
Deleted records can be recovered
CMPJRNIMG is more meaningful
Journaled files should have FRCRATIO(*NONE)
*JRNRCV spread across 10 fastest disk arms in ASP
Size of journal receivers
Access path journaled also?
STRJRNPF IMAGES(*AFTER *BOTH)
OMTJRNE(*NONE *OPNCLO)
CRTJRN RCVSIZOPT(*RMVINTENT *MINFIXLEN)

Figure 7-49. Other Journal Considerations OL197.0

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

Uempty The possible values are:


*NONE
No options affect the size of the journal entries attached to the receiver. All journal entries
placed on the receiver are permanent.
*RMVINTENT
The size of the receivers attached to the journal are reduced by automatic removal of the
internal entries required only for initial program load (IPL) recovery when these entries are
no longer required.
*MINFIXLEN
The size of the journal entries that are deposited into the attached journal receivers is
reduced by the automatic removal of the job, program, and user profile information.
Note: The default values of the parameter is underlined.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-79


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

File Journaling Summary

Recovers damaged data file member

12
11 1
10 2
9
8
7
6
5
4
3

Decreases time required to do backup

Provides audit trail

15

Provides activity reporting

Aids debugging

Figure 7-50. File Journaling Summary OL197.0

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

Figure 7-51. Lab Exercises OL197.0

Notes:

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-81


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

Uempty 7.2 Remote Journal

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-83


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
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

Figure 7-52. Remote Journal OL197.0

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

Primary (Local) System Backup (Remote) System

Call to RCVJRNE
Receive
Applications exit program
and .
.
Apply jobs .

RC

DB Operation
Processing........

VJ
RN
E
Transport

DB JRN and JRN and DB files


files JRNRCVs JRNRCVs

Figure 7-53. Remote Journal - Hot Backup OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-85


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Two transport modes:


- Sync Transmission with confirmation
- Async Transmission (no confirmation)

• Can broadcast up to 255 secondaries/target systems


• Can cascade without limit to other systems
• CHGJRN initiated from source, performed in lock-step on target
What Happens When I Crash/Recover?
• Simply reconnect
• Catch-up phase begins
- Automatic journal receiver recalibration
- Fire-hose mode
• Catch-up for rates bulk transfer of JRN receiver:
- SNA
— 1Gig transferred in 10 min
- ATM
— 1 Gig transferred in 5 min
- Optical connection
— 1 Gig transferred in 2.2 min with RAID protected disk
— 1 Gig transferred in 1.0 min with non-RAID
• Faster catch-up means faster switch-back.

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

Figure 7-54. Remote Journal Benefits OL197.0

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)

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-87


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

• If you need to free up CPU cycles on the source/production machine


• If you'd like to Shift the role of saving JRN receivers from the source to the target
machine
• If you cannot tolerate any lost transactions
• If switch-back needs to be faster switch-back
• If you're feeding a central data warehouse from multiple sites

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)

Figure 7-55. How To Add A Remote Journal? (1 of 6) OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-89


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

How To Add A Remote Journal? (2 of 6)

Figure 7-56. How To Add A Remote Journal? (2 of 6) OL197.0

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)

Figure 7-57. How To Add A Remote Journal? (3 of 6) OL197.0

Notes:
6. Right-click the journal you want to add a remote journal to and select Properties

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-91


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

How To Add A Remote Journal? (4 of 6)

Figure 7-58. How To Add A Remote Journal? (4 of 6) OL197.0

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)

Figure 7-59. How To Add A Remote Journal? (5 of 6) OL197.0

Notes:
8. To add (associate) a remote journal to this journal, click Add

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-93


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

How To Add A Remote Journal? (6 of 6)

Figure 7-60. How To Add A Remote Journal? (6 of 6) OL197.0

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

Uempty Journal type:


Allows you to select whether the remote journal should be of Type 1 or Type 2.The journal
type default is Type 1.The remote journal type influences the redirection capabilities,
journal receiver restore operations, and remote journal association characteristics.
Limited redirection (Type 1)
If the remote journal being added is Type 1, the journal library name may be redirected
to a single different library from that of the local journal. All Type 1 remote journals
associated with a given local journal must reside in the same library on the target
system.
Journal name
Displays the name of the remote journal on the target system. This field cannot be
edited.
Library
Allows you to specify the library on the target system where the remote journal is to be
located. If you are adding a remote journal to a local journal and no other Type 1 remote
journals have been added to the local journal, the default for this field is the library name
of the local journal. In this case, the Library field can be edited.
If you are adding a remote journal to a local journal and another Type 1 has been
added, the default for this field is the redirected library that is already established. In this
case, the Library field cannot be edited.
If you are adding a remote journal (of Type 1) to a remote journal, the default for this
field is the redirected library that is already established. In this case, the Library field
cannot be edited.
A Type 1 remote journal cannot be added to a Type 2 remote journal.
Flexible redirection (Type 2)
If the remote journal being added is Type 2, you may specify a redirected library that is
the same as or different from the redirected library specified on previous additions of
Type 2 remote journals. Subsequent additions of Type 2 remote journals may specify a
different library redirection from what was specified on any previously added remote
journal.
Journal name
Allows you to specify the name of the remote journal on the target system. You can edit
this field.
Library
Allows you to specify the name of the library where the remote journal is located. The
default for this field is the journal’s library to which you are adding the remote journal.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-95


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
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

CHGRMTJRN Change Journal State (QjoChangeJournalState API)


Changes the journal state for local and remote journals

RMVRMTJRN Remove Remote (Journal QjoRemoveRemoteJournal API)


Disassociates a remote journal on a target system from a journal on a source system

Retrieve Journal Information (QjoRetrieveJournalInformation API)


Retrieves the attributes of a journal including the receiver directory, journaled files,
and remote journals

Retrieve Journal Receiver Information (QjoRtvJrnReceiverInformation API)


Retrieves the attributes of a journal receiver

Figure 7-61. Remote Journal APIs OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-97


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

Uempty 7.3 Access Path Protection

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-99


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Introduction to Access Path Journaling

How can I significantly reduce


the time needed to IPL following
an abnormal system end?

That's easy! Implement


ACCESS PATH JOURNALING!
OR Use SYSTEM MANAGED
ACCESS PATH PROTECTION.

Figure 7-62. Introduction to Access Path Journaling OL197.0

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

How: By journaling access paths

What does the user have to do? Very little

What does it cost? Some CPU performance and some DASD


space

Figure 7-63. Access Path Protection OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-101


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Access Path's Contribution to IPL Time


Abnormal end of system can leave an access path unusable
Access path will be made usable no later than when file is opened
Protected Access Paths
Recovered quickly via journal during or after IPL
Unprotected Access Paths
DB files have a RECOVER attribute
RECOVER(*NO): Rebuild when opened
RECOVER(*AFTIPL): IPL, then rebuild
RECOVER(*IPL)
Rebuild during IPL
Valid only if file has MAINT *IMMED or *DLY, not *REBLD
During IPL, RECOVER attribute changeable on Override Access
Path Recovery display

Figure 7-64. Access Path’s Contribution to IPL Time OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-103


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

*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

Figure 7-65. EDTRBDAP Command OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-105


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

The following sequence values can be selected:


1-99=Rebuild sequence
Rebuild during IPL (number less than IPL Threshold)
If the sequence value is a number less than or equal to the IPL threshold value, the access
path is rebuilt during the IPL. This recovery option ensures that the file's access path is
rebuilt before the job uses the file. Note that rebuilding access paths during the IPL causes
the IPL to run longer.
Rebuild after IPL (number greater than IPL Threshold)
If the sequence value is a number greater than the IPL threshold value, the access path is
rebuilt after the IPL is completed. Jobs cannot use a file whose access path is rebuilt after
the IPL until the rebuilding of the access path for the file is complete. However, jobs not
using a file whose access path is rebuilt after the IPL can begin running immediately after
the IPL is complete.
*OPN=Rebuild at open
The access path is rebuilt when the file is next opened. If the access path has unique keys,
rebuilding the access path at open time prevents some applications from adding and
updating records to the file until the rebuild of the access path is complete.
*HLD=Hold the rebuild
The access path is rebuilt when the sequence value is changed to 1-99 or *OPN.
Sequence
The sequence in which access paths are rebuilt is determined by the values assigned to
them. The possible values include: whole numbers ranging from 1 through 99, *OPN, and
*HLD. One (1) represents the highest priority path and is rebuilt first. Whether paths with
values 1 through 99 are rebuilt before or after the IPL is determined by the value specified
on the THRESHOLD parameter. *OPN designates a value of 100, which means the access
path is rebuilt the next time the file is opened, and *HLD designates a value of 200, which
means the access path is not rebuilt until the value has been changed to *OPN or to a
number ranging from 1 through 99.
Status
The status values are:
• RUN
• The access path is being rebuilt
• READY
• The access path is waiting to be rebuilt according to its sequence number
• WAIT
• The access path is rebuilt when the required locks are obtained
• HELD
• The access path is rebuilt when the user changes the sequence to *OPN or to a value
ranging from 1 through 99

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

Figure 7-66. Explicit Access Path Journaling (Protection) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-107


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

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

Figure 7-67. System Managed Access Path Protection - SMAPP OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-109


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

• Can be customized to your needs


- You get to dial the level of protection you desire
- You tell the system how much recovery time you can afford and the system tries to
match it
• Is expected to have minimal performance impact/overhead
- Perhaps as low as 3 - 4%
- Even less if you want to specify a slightly longer recovery time
• Completely compatible with any journaling you are already using
- No need to change any of your current practices
- Doesn't require set up of a private User ASP

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

Figure 7-68. SMAPP Performance and Auxiliary Storage Use OL197.0

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

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-111


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

Edit Recovery for Access Paths (EDTRCYAP)

Figure 7-69. Edit Recovery for Access Paths (EDTRCYAP) OL197.0

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.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-113


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Notebook

• *NONE - No system access path recovery time is set. No access-path protection is


provided by the system unless needed to meet a target access path recovery time.
However, current access path exposure is monitored and estimated access path
recovery times are available
• *MIN - The system access path recovery time is set to the minimum access path
recovery time for the system, which provides for the fastest access path recovery. The
eligible access paths for the entire system are protected
• *OFF - No access-path protection is provided by the system. The system does not
monitor current exposure and no estimated access path recovery times are available
• 10 to 1440 - The number of minutes (in ten minute intervals) set for the system access
path recovery time
Note: This field is blank if an internal system failure keeps the system from determining the
system access path recovery time.
ASP (Auxiliary storage pool)
The ASP (auxiliary storage pool) number. Each ASP configured on the system is listed,
whether or not access paths can be created on the ASP. (Access paths cannot be created
on a non-library user ASP).
Note: The value 1 is the system ASP.
Recovery Time
The target time for access path recovery and the estimated time for access path recovery
are shown for each auxiliary storage pool (ASP).
You can change the target access path recovery time for an ASP by typing a new value
over the current value.
Target Access Path Recovery Time
The target system-managed access path recovery time is the time (in minutes) targeted for
access-path protection for the ASP.
• *NONE - No access path recovery time is set. The access paths for the specified ASP
are protected only if they need to be protected to reach the system access path
recovery time specified
• *MIN - All of the eligible access paths for the specified ASP are protected. The system
uses the minimum time needed for access path recovery
• 10 to 1440 - The number of minutes (in ten minute intervals) set for the access path
recovery time
Note: This field is blank if an internal system failure keeps the system from determining the
access path recovery time.

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

Uempty Estimated Access Path Recovery Time


The estimated amount of time (in minutes) that the system takes to recover the access
paths for the ASP during an initial program load (IPL) after an abnormal system end.
• Plus signs (+++++) are shown when the, estimated access path recovery time is greater
than 32,767 minutes
• This field is zero if the ASP is a non-library ASP. (Access paths cannot be created on a
nonlibrary ASP)
Note: This field is blank if an internal system failure keeps the system from determining the
estimated access path recovery time for the ASP.
The following describes the relationship of the values given in these columns for some
special system situations:
• If the target access path recovery time value is *MIN, the estimated access path
recovery time value is the system calculated minimum access path recovery time
• If the target access path recovery time value is less than the system calculated
minimum access path recovery time, the estimated access path recovery time value is
the system calculated minimum access path recovery time
• If the target access path recovery time value is *NONE, the estimated access path
recovery time value is the system calculated current access path recovery time
Disk Storage Used
The disk storage used for system-managed access-path protection (SMAPP) in megabytes
and as a percentage of total auxiliary storage is shown for each auxiliary storage pool
(ASP).
Megabytes Storage Used
The amount of auxiliary disk storage being used on each ASP exclusively for SMAPP. This
value is expressed in megabytes (1,000,000 bytes).
Note: This value does not include additional space 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 on ASP
The amount of auxiliary disk storage used exclusively for SMAPP as a percentage of the
total amount of auxiliary storage used.
If the user ASP has overflowed into the system ASP, this value is ++++++.

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-115


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
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

Figure 7-70. SMAPP Summary OL197.0

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

Figure 7-71. Unit Summary OL197.0

Notes:

© Copyright IBM Corp. 1995, 2003 Unit 7. Journal Management 7-117


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

You might also like