Making changes for active logs

Start of changeYou can add, delete, record, enlarge, and encrypt active logs.End of change

Adding active logs

If an active log is in stopped status, it is not reused for output logging; however, it continues to be used for reading. To add a new active log:

  1. Use the Access Method Services DEFINE command to define new active log data sets.
  2. Use DSNJLOGF to preformat the new active log data sets.

    If you do not preformat these logs with the DSNJLOGF utility, Db2 needs to preformat them the first time that they are used, and performance might be impacted. Empty data sets and data sets with residual data need to be preformatted.

  3. Use DSNJU003 to register the new data sets in the BSDS.

For example, specify the following statements:

NEWLOG DSNAME=DSNC111.LOGCOPY1.DS04,COPY1
NEWLOG DSNAME=DSNC111.LOGCOPY2.DS04,COPY2

To copy the contents of an old active log data set to the new one, you can also give the RBA range and the starting and ending timestamp on the NEWLOG statement.

To archive to disk when the size of your active logs has increased, you might find it necessary to increase the size of your archive log data set primary and secondary space quantities by increasing the values of subsystem parameters PRIQTY and SECQTY. Start of changeSee Active log data sets storage requirements for more information.End of change

Deleting active logs

To delete information about an active log data set from the BSDS, you might specify the following statements:

DELETE DSNAME=DSNC111.LOGCOPY1.DS01
DELETE DSNAME=DSNC111.LOGCOPY2.DS01

Recording active logs

To record information about an existing active log data set in the BSDS, you might specify the following statement:

NEWLOG DSNAME=DSNC111.LOGCOPY2.DS05,COPY2,STARTIME=19910212205198,
              ENDTIME=19910412205200,STARTRBA=43F8000,ENDRBA=65F3FFF

You can insert a record of that information into the BSDS for any of these reasons:

  • The data set has been deleted and is needed again.
  • You are copying the contents of one active log data set to another data set (copy 1 to copy 2).
  • You are recovering the BSDS from a backup copy.

Enlarging active logs

When Db2 is inactive (down), use one of the following procedures.

If you can use the Access Method Services REPRO command, follow these steps:

  1. Stop Db2. This step is required because Db2 allocates all active log data sets when it is active.
  2. Use the Access Method Services ALTER command with the NEWNAME option to rename your active log data sets.
  3. Use the Access Method Services DEFINE command to define larger active log data sets. Refer to installation job DSNTIJIN to see the definitions that create the original active log data sets.

    By reusing the old data set names, you don't need to run the change log inventory utility to establish new names in the BSDSs. The old data set names and the correct RBA ranges are already in the BSDSs.

  4. Use the Access Method Services REPRO command to copy the old (renamed) data sets into their respective new data sets.
  5. Start Db2.

If you cannot use the Access Method Services REPRO command, follow this procedure:

  1. Ensure that all active log data sets except the current active log data sets have been archived. Active log data sets that have been archived are marked REUSABLE in print log map utility (DSNJU004) output.
  2. Stop Db2.
  3. Rename or delete the reusable active logs. Allocate new, larger active log data sets with the same names as the old active log data sets.
  4. Run the DSNJLOGF utility to preformat the new log data sets.
  5. Run the change log inventory utility (DSNJU003) with the DELETE statement to delete all active logs except the current active logs from the BSDS.
  6. Run the change log inventory utility with the NEWLOG statement to add to the BSDS the active logs that you just deleted. So that the logs are added as empty, do not specify an RBA range.
  7. Start Db2.
  8. Issue the ARCHIVE LOG command to cause Db2 to truncate the current active logs and switch to one of the new sets of active logs.
  9. Repeat steps 2 through 7 to enlarge the active logs that were just archived.

Although all log data sets do not need to be the same size, from an operational standpoint using the same size is more consistent and efficient. If the log data sets are not the same size, tracking your system's logs can be more difficult. Space can be wasted if you are using dual data sets of different sizes because they fill only to the size of the smallest, not using the remaining space on the larger one.

If you are archiving to disk and the size of your active logs has increased, you might need to increase the size of your archive log data sets. However, because of DFSMS disk management limits, you must specify less than 64,000 tracks for the primary space quantity. Start of changeSee Active log data sets storage requirements for more information.End of change