Use of Wildcards in RECOVER and REBUILD Statements

Using wildcards lets you quickly select multiple objects with similar names and qualifiers.
cafrdb2
Using wildcards (or masking) in your RECOVER and REBUILD statements lets you quickly select multiple objects with similar names and qualifiers. Objects that are specified using wildcards are always processed by partition. Using wildcards can interfere with DSNUM
int
or PART
int
specification. Also, you cannot use wildcards to select catalog and directory objects. You must explicitly specify the object names.
You can specify the following wildcard characters when selecting databases, tablespaces, indexspaces, or indexes:
  • percent sign (%)
    Indicates that zero or more characters can occupy the position.
    A '%' is not permitted in the first position of the database name for any statement.
  • underscore (_)
    Indicates that any one character can occupy the underscored position.
Any character other than % or _ represents a single occurrence of itself.
Examples: Wildcards in RECOVER Statements
The RECOVER statement supports the use of wildcards with databases, tablespaces, indexspaces, and indexes. The following examples show how you can use the wildcards with the RECOVER syntax:
RECOVER DATABASE DB% RECOVER TABLESPACE [DB%.]TS% RECOVER INDEXSPACE [D%01.]IX%SP RECOVER INDEX (ALL) TABLESPACE [D%01.]TS% RECOVER INDEX ([USER%.]I%01) TABLESPACE [DB01.]TS01 RECOVER INDEX ([USER%.]I%01,I%02,I%03) TABLESPACE [DB01.]TS01
Examples: Wildcards in REBUILD Statements
The REBUILD statement supports the use of wildcards with indexes. The following examples show how you can use wildcards with the REBUILD syntax:
REBUILD INDEX (ALL) DATABASE DB% REBUILD INDEX (ALL) TABLESPACE [DB%.]TS% REBUILD INDEX ([USER%.]I%01) TABLESPACE [DB01.]TS01 REBUILD INDEX ([USER%.]I%01,I%02,I%03) TABLESPACE [DB01.]TS01
Examples: Unsupported Wildcard Syntax
The following syntax is not supported. You cannot use a '%' in the first position of a database name when recovering or rebuilding indexes:
DATABASE % TABLESPACE %.% INDEX (ALL) TABLESPACE %.% INDEX (ALL) DATABASE %