Ignore journaling when restoring objects

One of the questions we get asked a lot about how to stop an object being journalled when it is restored. This is a problem for replication software because the entries deposited either need to be fitered at the sending stage or at the applying stage. It is most prevalent in shops that use a copy of their production database to test with, they will save the production libraries and restore them to test libraries on a regular basis.

When an object is saved it is saved with information about the journal it was attached to, so when it is restored the system will automatically start journalling of the object to that journal. Even if the journal is not being replicated it can cause some issues due to the amount of data now being deposited with test and production data being mixed in a single journal.

With IBMi OS 7.2 there is a very simple answer, you can ignore the journalling for the objects as part of the restore object command RSTOBJ OBJ(*ALL) SAVLIB(SAVEDLIB) RSTLIB(NEWLIB) STRJRN(*NO). However the RSTLIB command does not have the *IGNORE capability. For IBMi OS 7.1 and before there are a couple of methods that you can use to achieve a similar goal.

On IBMi OS 6.1 onwards you have the option to start journalling of the library plus any objects restored into the library are automatically journalled. This is carried out by the Start Journal Library Command, if you set the library and any objects which are restored to override the journal attributes you can ensure the objects are journalled to a different journal. A command similar to STRJRNLIB LIB(TESTLIB) JRN(NEWLIB/NEWJRN) INHRULES((*ALL *RSTOVRJRN)) will start journalling of the TESTLIB library to NEWLIB/NEWJRN, any objects which are restored to the library will automatically be journalled to the new journal (The caveat is any existing objects which are currently journalled will continue to be journalled to the same journal, but as they should already be journalled to a different journal to production that should not be an issue) when restored.

For IBMi 5.4 you still have to use the old QDFTJRN data area for automatically journalling the objects created in the library. IBM added the same option to the QDFTJRN data area so you can realign the journalling for any restored objects, this is done by setting the following elements of the data area in the library you want the redirection to take place.
Note: The QDFTJRN Data Area method is being sunsetted by IBM, while it is possible to use it on IBMi OS 6.1 and above you should start using the STRJRN command and remove any QDFTJRN data areas from your system.

CRTDTAARA DTAARA(OVERRIDE/QDFTJRN) TYPE(*CHAR) LEN(80)
CHGDTAARA DTAARA(OVERRIDE/QDFTJRN) (1 10) VALUE(NEWLIB)
CHGDTAARA DTAARA(OVERRIDE/QDFTJRN) (11 10) VALUE(NEWJRN)
CHGDTAARA DTAARA(OVERRIDE/QDFTJRN) (21 10) VALUE(*ALL)
CHGDTAARA DTAARA(OVERRIDE/QDFTJRN) (31 10) VALUE(*RSTOVRJRN)
CHGDTAARA DTAARA(OVERRIDE/QDFTJRN) (41 10) VALUE(*ALL)
CHGDTAARA DTAARA(OVERRIDE/QDFTJRN) (51 10) VALUE(*ALLOPR)


Applying TFs SI24505, SI24794, SI24812, and SI24864 are required to activate this *RSTOVRJRN keyword function.

For me getting to IBMi 7.2 is worth the effort just to allow the RSTOBJ command to ignore journalling altogether, that way I am not creating a new journal and having to manage it just for test purposes.

Hope you find the above useful, if you need any further help let us know.

Chris…