admin_sql_connection

Definition

To disconnect from or to force the reconnection of the selected instances of the SAP CC system with a selected instance of the database system

Command Usage

Syntax

admin_sql_connection <CTRL_OP> <JDBC_URI_DBI_IDX> [<DB_SCOPE>] [<INST_TARGETS> ...]

Command Arguments
Name Description
<CTRL_OP> The control operation (disconnect or reconnect or status)
<JDBC_URI_DBI_IDX> The index number (1 to 12) of the JDBC URI configured in the SAP CC system for an instance of the multi-instance database system
<DB_SCOPE> Optional: The scope: "core" (available for all instances) or "session" (available for raters only); By default: "core"
<INST_TARGETS> Optional: Command targets (instance ID or instance type)

Detailed Information

The admin_sql_connection command allows you to manage the database connection in a high availability (HA) environment. The back-end database system includes multiple database instances. You can specify the instances of the SAP CC system and the instance of the database system. The database instance is identified by its JDBC URI and its scope configured in the SAP CC system.

You can:

  • Force the reconnection of the selected instances of the SAP CC system with a selected instance of a multi-instance database system
  • Deactivate the connection of the selected instances of the SAP CC system from a selected instance of a multi-instance database system (this operation is a logical disconnection)

Note

In a non HA environment including a back-end database system with a unique instance, you cannot use the admin_sql_connection command to manage the database connections of a particular instance of the SAP CC system. Use the refresh_sql_connections command instead of forcing the update of all the database connections established by the complete SAP CC system and its instance system.

Use

In an HA environment including a multi-instance database system, the SAP CC system manages a pool of JDBC URIs representing the declared database instances. The different instances of the SAP CC system are connected to all of the database instances and use one of these connections. In case of failure, the SAP CC system provides a function that detects any disconnection from a database instance and forces an instance of the SAP CC system to switch to another database instance. You use this command to anticipate the downtime of a database instance. Each instance of the SAP CC system smoothly changes communication with the database by selecting another database instance from the pool of JDBC URIs.

Example

In a high availability environment, type the following command:

  • Admin+> admin_sql_connection reconnect 2 core rater#1 rater#2: Reconnects rater instances #1 and #2 with the second instance of the back-end database

Technical Operations

Preparing Multi-Instance Database Downtime

You use this command to manage the planned downtime of a database instance of a multi-instance database system

  • You disconnect the relevant instances of the SAP CC when you plan to shutdown an instance of the multi-instance database system
  • You reconnect the relevant instances of the SAP CC system after you restart an instance of the multi-instance database system
Troubleshooting Operations (System and User)

You use this command:

  • If an instance of the multi-instance database system (or another multi-instance database system) has failed. Because some instances of the SAP CC system are connected to this failed database instance, you then reconnect the relevant instances of the SAP CC system to another instance of the back-end database system.
  • If you have accidentally disconnected an instance of the SAP CC system from an instance of the database system. You then reconnect the instance of the SAP CC system with the disconnected instance of the database system.

Authorization

You must have a specific role in your SAP CC user profile. Refer to the SAP CC Security Guide for more information about the necessary authorizations.

See Also

refresh_sql_connections - To force the update of the connections to the database

Additional Information

Consult the SAP CC System Parameter Reference for more information about the configuration settings dedicated to the multi-instance database management: The number of declared database instances (see SQLHELPER_DB_INSTANCE_COUNT), the pool of JDBC URIs (see SQLHELPER_JDBC_URI_DBI1).

Messages

Code Message Action
err.bad_targets Error: Bad target: {target}. Verify the target set in your command and consult the command information (usage, details).  
err.bad_uri_id Error: The index of JDBC URI "{}" is not valid.  
err.control_operation Error: The control operation "{}" is not valid.  
err.parameter_missing Error: This command needs at least 2 parameters.  
err.malformed_target Error: The target {target} is malformed.  
err.forbidden_target Error: The target {target} is forbidden.  
adminSQLConnection.ok OK: The SQL connections are {0,choice,0#offline|1#online} on {2} database uri #{1}"  
adminSQLConnection.nok Error: An error occurred during the update of the SQL connections: "{}"