Range definition

This topic describes the Range definition syntax that occurs in both the LOGSCAN and DROPRECOVERY statements.

This syntax enables you to define a start point or an end point in the Db2 log. You can define the point as a relative byte address (RBA) value, a log record sequence number (LRSN) value, an existing log mark, or a date and time value.


 Range definition syntax diagram

OptionDescription
RBA | LRSN X 'byteString'

Describes a start or end point as a specific RBA or LRSN value. Enter a 1 to 12-character hexadecimal value in the following format: RBA X'nnnnnnnnnnnn'. For extended RBAs/LRSNs, this can be up to 20 characters long. Enter LRSN values in a data sharing environment or RBA values in a non-data-sharing environment.

Example

   FROM RBA X'0005A4693F4'
   TO   RBA X'0005A488902'

MARK logMarkName

Describes a start or end point as a specific log mark. A log mark is a symbolic name that represents a given point in the log. A log mark name

  • Can be up to 40 characters long

  • Can be any combination of alphanumeric or national characters

  • Can use periods to separate portions of the name

  • Is not qualified by Log Master with a user ID or a TSO prefix

  • Can use symbolic substitutions (for more information, see Symbolic substitutions)

Within the Range definition, use existing (not newly created) log marks. Remember that a log mark created within a job step (one run of Log Master) cannot be referenced within that step.

You can create a log mark by using the LOGMARK statement or the MARKSCAN keyword of the LOGSCAN statement. For more information see LOGMARK statement or MARKSCAN. Log Master maintains log mark information in the Repository (in a table named ALPMARK).

You can reference log marks using a numeric value appended to the log mark name. This technique enables you to reuse the same log mark name and refer to specific log points by the numeric suffix. The suffix can be a relative or absolute generation.

  • . relativeGeneration)

    Refers to a specific log point by using a relative value for the numeric suffix. Refer to the most recent log mark with the generation suffix of zero (0). Refer to the previous generation of the log mark with the generation suffix of (-1), and so on. When you work with ongoing processing, it can be convenient to use relative generations with your log mark names.

    Example

    FROM MARK MSTRUPDATESTART(-1)
    TO   MARK MSTRUPDATESTART(0)
  • . absoluteGeneration

    Refers to a specific log point by using the absolute value of the numeric suffix. Separate the suffix from the log mark name with a period.

    Example

    FROM MARK MSTRUPDATESTART.12 
    TO   MARK MSTRUPDATESTART(0)
CURRENT

Use this keyword only in the TO portion of the Scan range definition. This keyword defines the end point of the log scan as the most recent RBA/LRSN value that Db2 has written to the log when your Log Master job begins executing.

If the current job or job step includes the MARKSCAN keyword of the LOGSCAN statement to establish a new log mark, the new log mark will correspond to the RBA/LRSN selected for CURRENT.

Example

FROM MARK MSTRUPDATESTART.12 
TO   MARK MSTRUPDATESTART(0)
LAST ARCHIVE

Use this keyword only in the TO portion of the Scan range definition. This keyword defines the end point of the log scan as the RBA/LRSN value of the end point of the most recently-written archive log file (when your Log Master job begins executing). Use this keyword to reduce the chance of reading active log files on the current Db2 subsystem.

In a data sharing environment, Log Master determines the end points of the most recent archive log files of all members and then uses the earliest of those end points. If the current job or job step uses the MARKSCAN keyword of the LOGSCAN statement to establish a new log mark, the new log mark will correspond to the RBA/LRSN selected for LAST ARCHIVE.

Example

FROM MARK BENCHMARK(0) 
TO   LAST ARCHIVE
DATE (mm/dd/yyyy) / TIME (hh:mm:ss)

Specify a start point or end point according to date and time.

Example

FROM DATE(12/18/2010) TIME(08:15:30.000000) 
TO   DATE(12/20/2010) TIME(12:15:30.000000)

Use any of the available date and time formats in the Range definition, but remember that to control the date and time displayed in reports, you must use the OPTION statement (for more information, see DATEFMT). Log Master supports the following date and time formats:

  • MM/DD/YYYY/HH:MM:SS.nnnnnn (USA)

  • DD.MM.YYYY.HH.MM.SS.nnnnnn (EUR)

  • YYYY-MM-DD-HH.MM.SS.nnnnnn (ISO)

  • YYYY-MM-DD-HH:MM:SS.nnnnnn (JIS)

The default format is ISO.

  • * (Current Date)

    Specifies the current date when the log scan step is executed. If you do not specify a TIME value, Log Master uses a default value of the current date and time. Because of this behavior, you cannot enter DATE (*) without a time value in the FROM portion of the Scan range definition.

    Example

    FROM DATE(12/18/2010) TIME(08:15:30.000000) 
    TO   DATE(12/20/2010) TIME(12:15:30.000000)
  • - nn (relativeDate)

    Specifies a relative date value. When nn is preceded by a minus sign (-), Log Master subtracts the specified number of days from the current date.

    Example

    FROM DATE(-2) TIME(00:00:00)
    TO   DATE(-1) TIME(00:00:00)

    This example scans a range from midnight two days ago until midnight one day ago.

  • - hh:mm:ss (relativeTime)

    Specifies a relative time value. When a time value is preceded by a minus sign (-), Log Master subtracts the number of hours, minutes and so on from the current time.

    Example

    FROM DATE(*) TIME (-12:00:00) TO CURRENT

    This example scans a range from 12 hours before run time up until the current date and time.

  • TODAY

    Specifies the current date value when the log scan step runs.

    Example

    FROM DATE(2010-12-18) TIME (00:01:00)
    TO DATE (TODAY)       TIME (00:01:00)
  • YESTERDAY

    Specifies a date value one day before the current date value when the log scan step runs.

    Example

    FROM DATE(-30)      TIME (00:01:00)
    TO DATE (YESTERDAY) TIME (00:01:00)

Was this page helpful? Yes No Submitting... Thank you

Comments