DB2 Version 9.7 for Linux, UNIX, and Windows

DB_PARTITIONS table function

The DB_PARTITIONS table function returns the contents of the db2nodes.cfg file in table format.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-DB_PARTITIONS--(--)-----------------------------------------><

The schema is SYSPROC.

Authorization

EXECUTE privilege on the DB_PARTITIONS table function.

Table function parameters

The function has no input parameters.

Example

Retrieve information from a 3 logical partition database.
SELECT * FROM TABLE(DB_PARTITIONS()) AS T
The following example is a sample output from this query.
PARTITION_NUMBER HOST_NAME                PORT_NUMBER SWITCH_NAME
---------------- --------------------...- ----------- -----------
               0 jessicae.torolab.ibm.com           0 jessicae
               1 jessicae.torolab.ibm.com           1 jessicae
               2 jessicae.torolab.ibm.com           2 jessicae

  3 record(s) selected. 

Information returned

Table 1. Information returned by the DB_PARTITIONS table function
Column name Data type Description
PARTITION_NUMBER SMALLINT partition_number - Partition Number monitor element
HOST_NAME VARCHAR(256) host_name - Host name monitor element
PORT_NUMBER SMALLINT The port number for the database partition server.
SWITCH_NAME VARCHAR(128) The name of a high speed interconnect, or switch, for database partition communications.