1. Connection Pool Controlling and Monitoring Commands

The following is a list of commands that monitor and control JDBC/JCA Connection pools.

Command Description

connection-pool-info

Monitors JDBC/JCA connection pools.

If a connection pool ID is specified, its information is displayed in detail.

control-connection-pool

Controls JDBC/JCA connection pools.

This command can create, activate, deactivate, refresh, or shrink connection pools.

control-cluster-data-source

Controls cluster data sources. Displays a list of component data sources of cluster data sources or performs failback.

create-connection-pool

Creates a JDBC connection pool.

This does not apply to JCA connection pools.

destroy-connection

Forcibly ends an active connection.

disable-connection-pool

Deactivates a JDBC connection pool.

This does not apply to JCA connection pools.

enable-connection-pool

Activates a JDBC connection pool.

This does not apply to JCA connection pools.

refresh-connection-pool

Replaces connections in the JDBC connection pool with new connections. This does not apply to JCA connection pools.

return-connection

Returns an active connection to a connection pool.

shrink-connection-pool

Reduces the number of connections in the JDBC connection pool to the minimum number. This does not apply to JCA connection pools.

1.1. connection-pool-info

Monitors JDBC/JCA connection pools. If a connection pool ID is specified, its information is displayed in detail.

  • Alias

    cpinfo

  • Usage

    connection-pool-info -server <server-name>
                         [-id <connection-pool-id>]
                         [-jca | -jdbc]
                         [-jndi]
                         [-active]
                         [-t]
                         [-stmt]
  • Parameters

    Parameter Description

    -server <server-name>

    Server name.

    [-id <connection-pool-id>]

    Connection pool ID.

    [-jca]

    Displays only JCA connection pool information.

    [-jdbc]

    Displays only JDBC connection pool information.

    [-jndi]

    Displays the JNDI name of the connection pool.

    [-active]

    Displays the created connection pools on the server.

    [-t]

    Displays the name of the thread that most recently used the connection.

    This parameter requires the -id parameter to be used.

    [-stmt]

    Statement cache information by each connection.

  • Example

    [MASTER]domain1.adminServer>connection-pool-info -server server1 -jndi -jdbc
    The connection pool information on the server [server1].
    ================================================================================
    +------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
    | Connection |JNDI | Min | Max | Act | Act | Act | Idle| Dis | Tot | Wait| Ena |
    |   Pool ID  |Expo |     |     | ive | ive | ive |     |posa | al  |     |bled |
    |            | rt  |     |     | Max |     |Aver |     | ble |     |     |     |
    |            |Name |     |     |     |     | age |     |     |     |     |     |
    +------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
    | ds1        | ds1 |   2 |  30 |   0 |   0 | 0.0 |   2 |   0 |   2 | fal | true|
    |            |     |     |     |     |     |     |     |     |     |se   |     |
    +------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
    | ds2 *      | ds2 |   2 |  30 |   0 |   0 | 0.0 |   0 |   0 |   0 | fal | fal |
    |            |     |     |     |     |     |     |     |     |     |se   |se   |
    +------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
    
    * : has not been created, total = active + idle + disposable
    ================================================================================
    
    [MASTER]domain1.adminServer>connection-pool-info -server server1 -id ds1 -t -jdbc
    Information about connections in the server [server1]'s connection pool [ds1].
    ================================================================================
    +---------------+-------+-------------------+-----------+--------+-------------+
    | Connection ID | State |  State time(sec.) | Use count |  Type  | Thread name |
    +---------------+-------+-------------------+-----------+--------+-------------+
    | ds1-1         | active|          1105.954 |         1 | pooled | http-w1     |
    | ds1-2         | idle  |          1105.923 |         0 | pooled |             |
    +---------------+-------+-------------------+-----------+--------+-------------+
    ================================================================================
    
    [MASTER]domain1.adminServer>connection-pool-info -server server1 -id ds1 -stmt -jdbc
    Information about statement caches in the server [server1]'s connection pool [ds1].
    ================================================================================
    +--------------+-----------+--------+---------+--------+-----------+-----------+
    | Connection ID|   Access  |   Hit  |   Miss  |   Add  |   Remove  |  Current  |
    |              |   Count   | Count  |  Count  | Count  |   Count   |   Size    |
    +--------------+-----------+--------+---------+--------+-----------+-----------+
    | ds1-1        |         5 |      0 |       5 |      5 |         0 |         5 |
    +--------------+-----------+--------+---------+--------+-----------+-----------+
    | ds1-2        |         5 |      2 |       3 |      3 |         0 |         3 |
    +--------------+-----------+--------+---------+--------+-----------+-----------+
    ================================================================================

1.2. control-connection-pool

Controls JDBC/JCA connection pools. This command can create, activate, deactivate, refresh, or shrink connection pools.

  • Alias

    controlcp, ctrlcp

  • Usage

    control-connection-pool -id <connection-pool-id>
                            [-server <server-name>]
                            [-enable | -shrink | -disable | -refresh | -create]
  • Parameters

    Parameter Description

    -id <connection-pool-id>

    Connection pool ID.

    [-server <server-name>]

    Server name.

    [-enable]

    Activates a connection pool.

    [-shrink]

    Reduces the number connections of connection pool to the minimum number of connections.

    [-disable]

    Deactivates a connection pool.

    [-refresh]

    Replaces connections in the connection pool with new connections.

    [-create]

    Creates a connection pool.

  • Example

    [MASTER]domain1.adminServer>control-connection-pool -id ds1 -server server1 -enable
    Servers that successfully enabled a connection pool : server1
    Servers that failed to enable a connection pool : none.
    
    [MASTER]domain1.adminServer>control-connection-pool -id ds1 -server server1 -shrink
    Servers that successfully shrank a connection pool : server1
    Servers that failed to shrink a connection pool : none.
    
    [MASTER]domain1.adminServer>control-connection-pool -id ds1 -server server1 -disable
    Servers that successfully disabled a connection pool : server1
    Servers that failed to disable a connection pool : none.
    
    [MASTER]domain1.adminServer>control-connection-pool -id ds1 -server server1 -refresh
    Servers that successfully refreshed a connection pool : server1
    Servers that failed to refresh a connection pool : none.
    
    [MASTER]domain1.adminServer>control-connection-pool -id ds1 -server server1 -create
    Servers that successfully created a connection pool : server1
    Servers that failed to create a connection pool : none.

1.3. control-cluster-data-source

Controls cluster data sources. Performs failback or displays a list of component data sources of cluster data sources.

  • Alias

    controlcds, ctrlcds

  • Usage

    control-cluster-data-source -server <server-name>
                               -id <data-source-id>
                               [-failback]
  • Parameters

    Parameter Description

    -server <server-name>

    Server name.

    -id <data-source-id>

    Cluster data source ID.

    [-failback]

    Performs failback for cluster data sources.

  • Example

    [MASTER]domain1.adminServer>control-cluster-data-source -server server1 -id cds1  
    Component data sources of the cluster data source [cds1] : ds1, ds2
    
    [MASTER]domain1.adminServer>control-cluster-data-source -server server1 -id cds1 -failback  
    The failback for the cluster data source [cds1] succeeded.

1.4. create-connection-pool

Creates a JDBC connection pool. This does not apply to JCA connection pools.

  • Alias

    createcp

  • Usage

    create-connection-pool -id <connection-pool-id>
                           [-server <server-name>]
  • Parameters

    Parameter Description

    -id <connection-pool-id>

    JDBC connection pool ID.

    [-server <server-name>]

    Server name.

  • Example

    [MASTER]domain1.adminServer>create-connection-pool -id ds1 -server server1
    Servers that successfully created a connection pool : server1
    Servers that failed to create a connection pool : none.

1.5. destroy-connection

Forcibly ends an active connection.

The command can be used to end an active connection with an issue when an application requests a connection. It is only available for active connections. Note that this command forcibly ends an actual physical connection.

  • Alias

    destroyconnection

  • Usage

    destroy-connection -server <server-name>
                       [-cpid <connection-pool-id> | -cid <connection-id>]
  • Parameters

    Parameter Description

    -server <server-name>

    Name of the server that has the connection pool with the connection to forcibly end.

    [-cpid <connection-pool-id>]

    Connection pool ID. All connections that belong to this pool are ended.

    [-cid <connection-id>]

    Connection ID. A specific connection in a connection pool is ended. You can specify multiple connection IDs by using a comma (,) as a delimiter. To check connection IDs, use the connection-pool-info command with the -id option.

  • Example

    [MASTER]domain1.adminServer>destroy-connection -server server1 -cpid ds1
    Successfully destroyed the connections from the connection pool.
    
    [MASTER]domain1.adminServer>return-connection -server server1 -cid ds1-1,ds1-2
    Successfully destroyed the connections from the connection pool.

1.6. disable-connection-pool

Activates a JDBC connection pool. This does not apply to JCA connection pools.

  • Alias

    disablecp

  • Usage

    disable-connection-pool -id <connection-pool-id>
                            [-server <server-name>]
  • Parameters

    Parameter Description

    -id <connection-pool-id>

    JDBC connection pool ID.

    [-server <server-name>]

    Server name.

  • Example

    [MASTER]domain1.adminServer>disable-connection-pool -id ds1 -server server1
    Servers that successfully disabled a connection pool : server1
    Servers that failed to disable a connection pool : none.

1.7. enable-connection-pool

Activates a JDBC connection pool. This does not apply to JCA connection pools.

  • Alias

    enablecp

  • Usage

    enable-connection-pool -id <connection-pool-id>
                           [-server <server-name>]
  • Parameters

    Parameter Description

    -id <connection-pool-id>

    JDBC connection pool ID.

    [-server <server-name>]

    Server name.

  • Example

    [MASTER]domain1.adminServer>enable-connection-pool -id ds1 -server server1
    Servers that successfully enabled a connection pool : server1
    Servers that failed to enable a connection pool : none.

1.8. refresh-connection-pool

Replaces connections in the JDBC connection pool with new connections. This does not apply to JCA connection pools.

  • Alias

    refreshcp

  • Usage

    refresh-connection-pool -id <connection-pool-id >
                            [-server <server-name>]
  • Parameters

    Parameter Description

    -id <connection-pool-id>

    JDBC connection pool ID.

    [-server <server-name>]

    Server name.

  • Example

    [MASTER]domain1.adminServer>refresh-connection-pool -id ds1 -server server1
    Servers that successfully refreshed a connection pool : server1
    Servers that failed to refresh a connection pool : none.

1.9. return-connection

Returns an active connection to a connection pool.

If an application does not close a connection and the data source setting, "Action On Connection Leak" is not set AutoClose, a leak occurs because the connection’s status remains active. The command can be used to avoid this issue. It is only available for active connections. However, if a connection to return is being used for the current transaction, it is not returned. If an error occurs while a connection is returned, the connection is destroyed.

  • Alias

    returnconnection

  • Usage

    return-connection -server <server-name>
                      [-cpid <connection-pool-id> | -cid <connection-id>]
  • Parameters

    Parameter Description

    -server <server-name>

    Name of the server that has the connection pool to which the connection is returned.

    [-cpid <connection-pool-id>]

    Connection pool ID. All connections that belong to this pool are returned.

    [-cid <connection-id>]

    Connection ID. A specific connection in a connection pool is returned. You can specify multiple connection IDs by using a comma (,) as a delimiter. To check connection IDs, use the connection-pool-info command with the -id option.

  • Example

    [MASTER]domain1.adminServer>return-connection -server server1 -cpid ds1
    Successfully returned the connections to the connection pool.
    
    [MASTER]domain1.adminServer>return-connection -server server1 -cid ds1-1,ds1-2
    Successfully returned the connections to the connection pool.

1.10. shrink-connection-pool

Reduces the number of connections in the JDBC connection pool to the minimum number. This does not apply to JCA connection pools.

  • Alias

    shrinkcp

  • Usage

    shrink-connection-pool -id <connection-pool-id****>
                           [-server <server-name>]
  • Parameters

    Parameter Description

    -id <connection-pool-id>

    JDBC connection pool ID.

    [-server <server-name>]

    Server name.

  • Example

    [MASTER]domain1.adminServer>shrink-connection-pool -id ds1 -server server1
    Servers that successfully shrank a connection pool : server1
    Servers that failed to shrink a connection pool : none.