sp_cluster

(Cluster environments only) Performs a number of procedures related to clusters.

Syntax

Migrates a connection to a different logical cluster or instance:
sp_cluster connection, migrate, lc_name, instance_name, “spid_list
Determines if previous connection migrations to a new instance are pending, and terminates the migrations if they are:
sp_cluster connection, [‘migrate_status’ | 'migrate_cancel' ][, ‘spid_list’]
Modifies an outstanding action, such as canceling the action or changing the timing of the action:
sp_cluster logical, "action", lc_name, { 
	cancel, action_handle |
	modify_time, action_handle, wait_option[, timeout ] |
	release, action_handle }
Adds a resource or one or more routes to the logical cluster:
sp_cluster logical, "add", lc_name, {
	 route, route_type, key_list |
  	 instance, instance_list | 	 failover, instance_list }
Moves a route from one logical cluster to another:
sp_cluster logical, “alter”, lc_name, route, route_type, key_list
Creates a new logical cluster:
sp_cluster logical, "create", lc_name
Stops the logical cluster on one or more instances or the entire logical cluster, and places the instances or the cluster in the inactive state:
sp_cluster logical, "deactivate", lc_name, { 
	"cluster" | 	"instance", instance_list }
   [, wait_option[, timeout,[, @handle output ]]]
Drops a logical cluster, or one or more resources from the logical cluster:
sp_cluster logical, "drop",  lc_name, 
	{cluster | instance, instance_list |
	 failover, instance_list | route, route_type, key_list }
Reverses a manual failover, reinstating the original base instances:
sp_cluster logical, “failback”, lc_name, {
	cluster[, wait_option[, timeout[, @handle output ]]] |
	instance, from_instance_list, to_instance_list[, wait_option[,
		timeout[, @handle output ]]] }
Initiates a manual failover from base instances to failover instances.
sp_cluster logical, “failover”, lc_name, {cluster
	[, to_instance_list[, wait_option[, timeout[, @handle output ]]] 
	| instance, from_instance_list, to_instance_list[, wait_option[,
		timeout[, @handle output ]]] }
Manually gathers and migrates a group of connections to a different logical cluster:
sp_cluster logical, 'gather', lc_name
Displays complete syntax for sp_cluster logical:
sp_cluster logical, “help”
Stops the logical cluster on one or more instances or the entire logical cluster:
sp_cluster logical, "offline", lc_name, 
	{cluster | instance, instance_list }
	[, wait_option[, timeout,[, @handle output ]]]
Starts the default logical cluster on one or more instances:
sp_cluster logical, "online", { lc_name[, instance_list]}
Sets logical cluster rules: the open logical cluster, the failover mode, the system view, the start-up mode, and the load profile:
sp_cluster logical, "set", lc_name, { open 
		| failover, failover_mode | system_view, view_mode 
		| startup, { automatic | manual } | load_profile, profile_name }
	login_distribution, { affinity | "round-robin" }
Displays information about a logical cluster:
sp_cluster logical, "show"
[, lc_name[, {action[, state] | route[, type[, key]]}]]
Lets you set up and manage the load profile for the logical cluster:
sp_cluster profile, [ "show" [, profile_name ]
	| "create", profile_name | "drop", profile_name 
	| "set", profile_name [, weight [, wt_metric [, wt_value ] 
	| threshold [, thr_metric [, thr_value ] ] ]
Lets you set up and manage the load profile for the logical cluster:
sp_cluster profile, [ "show" [, profile_name ] | "create", profile_name | "drop", profile_name | "set", profile_name [, weight [, wt_metric [, wt_value ] | threshold [, thr_metric [, thr_value ] ] ]

Parameters

Examples

Usage

The parameter usage for sp_cluster is:
ParameterUsage Consideration
sp_cluster connection
  • To migrate the current spid, omit spid_list from sp_cluster connection, migrate.

sp_cluster logical, action
  • Retrieve an action handle by querying the monLogicalClusterAction table or executing:
    sp_cluster logical, "show", NULL, action
  • Any client that does not support migration is disconnected when it completes a SQL batch and has no open transactions, or when the timeout period expires, which ever comes first.

  • Any client remaining at the end of the timeout period is disconnected.

  • Cancelling an action does not roll back the action. Additional tasks may be necessary to restore the configuration to the original state.

  • Only completed actions can be released. Releasing an action removes the completed action from the system and from the monLogicalClusterAction table.

sp_cluster logical, 'add'
  • You cannot add a base instance or a failover resource to the system logical cluster.

  • Separate multiple instance, failover resources, or applications with semicolons.

  • Create multiple failover groups by enclosing the group in parenthesis, and separating groups with a comma. If you do not specify group, a new group is created and the instances are added to that group. You can specify a group into which the instances are placed (the group number must be quoted).

    For example:
    1> sp_cluster logical, 'add', tempLC, failover, "asedemo3;asedemo2"
    2> go
    Added failover instance 'asedemo3' to group 1 for logical cluster 'tempLC'.
    Added failover instance 'asedemo2' to group 1 for logical cluster 'tempLC'.
    And then add the instances to the group:
    1> sp_cluster logical, 'add', tempLC, failover, asedemo4, "4"
    2> go
    Added failover instance 'asedemo4' to group 4 for logical cluster 'tempLC'.
sp_cluster logical, "deactivate"
  • You cannot use the deactivate command for the system logical cluster.

  • offline is identical to the deactivate, except deactivate places stopped instances or clusters in the inactive state and offline places them in the offline state.

sp_cluster logical "drop"
  • You must place an instance or failover resource in the offline state before dropping it.

  • Dropping a cluster also drops all routes, resources, and settings associated with the cluster.

sp_cluster logical "failback"
  • To initiate a failback, the logical cluster must first be failed over.

sp_cluster logical "gather"
  • The logical cluster must be online to gather connections manually

  • The logical cluster must have defined routes to gather connections

sp_cluster logical, "offline"
  • You cannot use the offline command for the system logical cluster.

  • offline is identical to deactivate, except deactivate places stopped instances or clusters in the inactive state.

sp_cluster logical "online"
  • You cannot use the online command for the system logical cluster.

sp_cluster logical "set"
  • Only one logical cluster can have the open property. When you set the open property to a new logical cluster, the open property is removed from the previous open logical cluster.

sp_cluster profile
  • The user metric value must be normalized so that it is compatible with values for metrics provided by SAP. Consider a user metric that measures response times. If the maximum acceptable response time is 10 seconds and the measured value is 5, the metric value is 50 (5/10 x 100 = 50).

  • Threshold metrics let you configure at what point a load imbalance should cause connections to be redirected from one instance to another. The workload manager redirects connections when the load score difference (as a percent) between the target instance and the least loaded instance meets or exceeds the threshold value.

    The hysteresis value guards against redirection when the load score difference meets the threshold value, but the instance load scores (for example, 2 and 8) are so low that redirection is not appropriate.

Permissions

The permission checks for sp_cluster differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage cluster privilege or ha_role.

Disabled

With granular permissions disabled, you must be a user with sa_role or ha_role.