SHRLEVEL—Specify the Object State for the Rebuild Process

The SHRLEVEL keyword specifies what state indexes and tablespaces are set to during the rebuild process.
cafrdb220
The SHRLEVEL keyword specifies what state indexes and tablespaces are set to during the rebuild process. After the rebuild completes, the object state returns to the state before the rebuild.
2
SHRLEVEL Keyword Syntax
This keyword has the following syntax:
[SHRLEVEL {
REFERENCE
|CHANGE [DEADLINE {
NONE
|
timestamp
|CURRENT_DATE [
constant
]|CURRENT_TIMESTAMP [
constant
]}] [LONGLOG {
CONTINUE
|TERM DELAY [
1200
|
int
]}] [MAXRO {
int
|DEFER}] [TERM-LIMIT
int
]}]
  • REFERENCE
    Sets the tablespace to read-only status and rebuilds the index in place. This option is the default option.
  • CHANGE
    Keeps the index and tablespace available and rebuilds the index to the shadow data set. After the shadow data set is built and the final phase of Log Apply is complete, the objects are placed in read-only status for a brief period. You can specify extra keywords when you include SHRLEVEL CHANGE in the SYSIN.
    Keep the following items in mind when using SHRLEVEL CHANGE:
    • You can specify SHRLEVEL CHANGE only once in a job step.
    • SHRLEVEL CHANGE is not valid with the RECOVER control statement.
    • SHRLEVEL CHANGE cannot be used on multiple indexes.
    • SHRLEVEL CHANGE cannot be used with REBUILD INDEX(ALL).
    • When you specify the CHANGE option, the rebuild is processed by
      Rapid Reorg
      .
Example: REBUILD INDEX with SHRLEVEL CHANGE and SHRLEVEL CHANGE related keywords
The following example keeps the index and tablespace available while the index is rebuilt to the shadow data set, without initiating the final phase of Log Apply:
MAXRO DEFER REBUILD INDEX(USER06.XDEPT01) TABLESPACE DB03.TDEPTS SHRLEVEL CHANGE TERM-LIMIT 3
SHRLEVEL CHANGE-Related Keywords
The following keywords control the REBUILD INDEX SHRLEVEL CHANGE process. You can specify these keywords before or after SHRLEVEL CHANGE in the SYSIN. If you specify these keywords in the SYSIN without including the SHRLEVEL CHANGE keyword, message PFR0738E is issued and the job fails.
DEADLINE
The DEADLINE keyword specifies a deadline for the start of the switch phase of log processing. If the switch phase does not begin by the deadline, the reorganization terminates.
This keyword has the following syntax:
DEADLINE {
NONE
|
timestamp
|CURRENT_DATE [
constant
]|CURRENT_TIMESTAMP [
constant
]}
  • NONE
    Specifies no deadline. This value is the default.
  • timestamp
    Specifies the deadline as a timestamp. This deadline must not have already occurred when the reorganization executes.
  • CURRENT_DATE
    constant
    Specifies that the deadline is based on the current date. Optionally apply the following constants, which can also be preceded by a plus (+) sign or a minus (-) sign:
    YEAR, YEARS, MONTH, MONTHS, DAY, DAYS, HOUR, HOURS, MINUTE, MINUTES, SECOND, SECONDS, MICROSECOND, MICROSECONDS
    Limits:
    1 to 99
  • CURRENT_TIMESTAMP
    constant
    Specifies that the deadline is based on the current timestamp. Optionally apply the following constants, which can also be preceded by a plus (+) sign or a minus (-) sign:
    YEAR, YEARS, MONTH, MONTHS, DAY, DAYS, HOUR, HOURS, MINUTE, MINUTES, SECOND, SECONDS, MICROSECOND, MICROSECONDS
    Limits:
    1 to 99
Example: Specify the Deadline by Timestamp
The following example specifies the deadline by timestamp:
DEADLINE 2021-06-03-12.13.14.123456
Example: Specify the Deadline by Current Date with a Constant
The following example specifies the deadline by the current date, with a constant applied:
DEADLINE CURRENT_DATE + 11 HOURS
LONGLOG
The LONGLOG keyword specifies what happens when the application log is being written faster than the utility can read it.
This keyword has the following syntax:
LONGLOG {
CONTINUE
|TERM DELAY [
1200
|
int
]}
  • CONTINUE
    Continues performing the reorganization. This value is the default.
  • TERM DELAY
    Terminates the reorganization after the specified delay:
    • 1200
      Terminates the reorganization 1200 seconds after the LONGLOG command is issued. This setting is the default.
    • int
      Specifies the delay, in seconds, from the time the LONGLOG command is issued to the time the reorganization terminates.
      Limits:
      0 to 9999
MAXRO
The MAXRO keyword specifies the maximum number of seconds for objects to be read-only for the last log apply phase.
This keyword has the following syntax:
MAXRO {
int
|DEFER}
  • int
    Specifies the number of seconds for objects to be read-only. If you specify a small value, you reduce the length of the period of read-only access. Smaller values might increase the amount of time for the REBUILD INDEX to complete.
    Limit:
    1 to 999
  • DEFER
    Specifies that iterations of Log Apply processing with read/write access can continue indefinitely. When MAXRO DEFER is specified, the final phase of Log Apply processing does not start automatically. To start the final phase of Log Apply, issue -ALTER CA UTILID(
    utilid
    ) MAXRO(
    int)
    .
    You can also issue -ALTER CA UTILID(
    utilid
    ) MAXRO(DEFER) to prevent the start of the final phase of Log Apply processing
    .
    The minimum iteration time for MAXRO DEFER is 10 seconds.
TERM-LIMIT
The TERM-LIMIT keyword specifies how long to wait before terminating the process.
Fast Recover
is waiting for one of the following events to occur:
  • For the tablespace or indexspace to stop. If the object does not stop before the TERM-LIMIT value is reached, processing terminates.
  • For claims or locks to release before
    Rapid Reorg
    attempts to stop the tablespace or indexspace. If the claims or locks are not released before the TERM-LIMIT value is reached, processing terminates.
This keyword has the following syntax:
TERM-LIMIT
int
  • int
    Specifies the number of minutes to wait.
    Default:
    1
    Limits:
    1 to 9999