DB2 Version 9.7 for Linux, UNIX, and Windows

GET_SWRD_SETTINGS procedure - Retrieve redistribute information

The GET_SWRD_SETTINGS procedure reads the existing redistribute registry records for the given database partition group.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-GET_SWRD_SETTINGS--(--dbpgName--,--matchingSpec--,----------->

>--redistMethod--,--pMapFile--,--distFile -,--stepSize -,------->

>--totalSteps -,--stageSize -,--nextStep -,--processState -,---->

>--pNumber -,--pWeight -)--------------------------------------><

The schema is SYSPROC.

Procedure parameters

dbpgName
An input argument of type VARCHAR(128) that specifies the database partition group name against which the redistribute process is to run.
matchingSpec
An input argument of type SMALLINT that specifies the bitwise field identifier(s) from Table 1, indicating the target fields to be returned by the output parameters. Those output parameters that are not required can be set to null.

For example, if matchingSpec is set to 96, which is the integer value of (REDIST_STAGE_SIZE | REDIST_NEXT_STEP), the caller of this function only needs to provide stageSize and nextStep to receive the values, and the remainder of the output parameters can be null.

Table 1. Bitwise field identifiers
Field Name Hexadecimal value Decimal value
REDIST_METHOD 0x0001<<0 1
REDIST_PMAP_FILE 0x0001<<1 2
REDIST_DIST_FILE 0x0001<<2 4
REDIST_STEP_SIZE 0x0001<<3 8
REDIST_NUM_STEPS 0x0001<<4 16
REDIST_STAGE_SIZE 0x0001<<5 32
REDIST_NEXT_STEP 0x0001<<6 64
REDIST_PROCESS_STATE 0x0001<<7 128
REDIST_PWEIGHT_START_NODE 0x0001<<8 256
REDIST_PWEIGHT 0x0001<<9 512
redistMethod
An output argument of type SMALLINT that specifies whether the redistribute is to run using the data distribution file or the target distribution map. There are two possible return values:
  • 2: indicates that the redistribute process will work with a data distribution file as input.
  • 3: indicates that the redistribute process will work with a target distribution map as input.
pMapFile
An output argument of type VARCHAR (255) that specifies the full path file name of the target distribution map on the database server.
distFile
An output argument of type VARCHAR (255) that specifies the full path file name of the data distribution file on the database server.
stepSize
An output argument of type BIGINT that specifies the maximum number of rows that can be moved before a commit must be called to prevent a log full situation. The number can be changed in each redistribution step.
totalSteps
An output argument of type SMALLINT that specifies the number of steps it takes to completely redistribute the given database partition group.
stageSize
An output argument of type SMALLINT that specifies the number of steps to be run consecutively.
nextStep
An output argument of type SMALLINT that specifies the index separating which steps have been completed, and what still needs to be run.
processState
An output argument of type SMALLINT that indicates whether or not the redistribute process will be stopped at the next check point. A check point is placed at beginning of each redistribute step. If this argument is set to 1, the step will not start; if the value is 0, the step will proceed.
pNumber
An output argument of type VARCHAR (6000) that might return a list of comma-separated database partition numbers in a string format. These partition numbers can be either the database partitions that are currently used by the database partition group, or the ones to be added or dropped. The sequence and the count of these partition numbers correspond to the target partition weight returned by the pWeight variable.
pWeight
An output argument of type VARCHAR (6000) that might return a list of comma-separated target database partition weight numbers. The sequence and the count of these partition weights correspond to the partition numbers returned by the pNumber variable.

Authorization

EXECUTE privilege on the GET_SWRD_SETTINGS procedure.

Example

Report the content of the step wise redistribution plan for the given database partition group.
CALL SYSPROC.GET_SWRD_SETTINGS
   ('IBMDEFAULTGROUP', 255, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Usage note

The redistribute stored procedures and functions work only in partitioned database environments, where a distribution key has been defined for each table.