The DB_PARTITIONS table function returns the contents of the db2nodes.cfg file in table format.
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
The function has no input parameters.
SELECT * FROM TABLE(DB_PARTITIONS()) as T
PARTITION_NUMBER HOST_NAME PORT_NUMBER SWITCHNAME
---------------- --------- ----------- -------
0 so1 0 so1-ib0
1 so2 0 so2-ib0
2 so3 0 so3-ib0
3 so4 0 so4-ib0
4 record(s) selected.
SELECT * FROM TABLE(DB_PARTITIONS()) as T
PARTITION_NUMBER HOST_NAME PORT_NUMBER SWITCHNAME
---------------- ---------- ----------- ----------
0 so1 0 so1-ib0
0 so2 0 so2-ib0
0 so3 0 so3-ib0
3 record(s) selected.
For DB2 Enterprise Server Edition and in a partitioned database environment, the DB_PARTITIONS table function returns one row for each entry in the db2nodes.cfg file.
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. |