Synopsis

Drops and/or builds database indexes that are defined in the WhereScape RED metadata.

Description

Drops and/or builds indexes for a specified table or a specified index. Only indexes that are defined in the WhereScape RED metadata are supported. Typically, this routine is used by a WhereScape RED Scheduler and RED-generated procedures to automatically maintain indexes. However, it is also valid for user-defined custom procedures/scripts to execute this routine to control when indexes are dropped and/or created.

Input

InputDescription
Common InputIncludes all 5 inputs of the Callable Routines Common Input.
Table Name

Table Name to process the relevant indexes of.

Note

The Table Name is ignored when the optional Index Name is specified.

Optional Build Arguments
[ORACLE only]
Optional arguments related to building indexes [ORACLE only]:
TABLESPACE=XYZ will override the default tablespace name and use the specified tablespace name. e.g. 'TABLESPACE=non_default_tablespace'. Typically, the TABLESPACE argument is used to build indexes in a partition-specific tablespace.
Index Name

Optional Index Name to only process the specified index. When NOT specified all the relevant indexes of the table are processed.

Note

  • The Table Name is ignored when the Index Name is specified.
  • Must be specified to use the 'DROP' or 'BUILD' index actions.
Index ActionAction that specifies whether indexes are dropped or built and what types of indexes are applicable:
  • DROP - Drops the specified index (Index Name must be specified).
  • DROP ALL - Drops ALL the indexes of the table.
  • PRE DROP - Drops the indexes of the table that are defined as pre-drop.
  • BUILD - Builds the specified index (Index Name must be specified). Otherwise, build all the indexes of the table that were pre-dropped.
  • BUILD ALL - Builds ALL the indexes of the table.

Output

OutputDescription
Result Number  Output Result Number:
  • 1       Success.
  • -1      Warning.
  • -2      Error.
  • -3      Fatal/Unexpected Error.

Note

Ws_Maintain_Indexes does NOT include a Return Code or Return Message like most of the WhereScape RED Callable routines, but it does output a Result Number.


  • No labels