sp_companion

Description

Performs cluster operations such as configuring Adaptive Server as a secondary companion in a high availability system and moving a companion server from one failover mode to another. sp_companion is run from the secondary companion.

Syntax

sp_companion 
	[server_name 
	{, configure
		[, {with_proxydb | NULL}] 
		[, srvlogin]
		[, server_password]
		[, cluster_login] 
		[, cluspassword]]
	| drop
	| suspend
	| resume
	| prepare_failback
	| do_advisory}
		{, all
		| help
		| group attribute_name 
		| base attribute_name}

Parameters

server_name

is the name of the Adaptive Server on which you are performing a cluster operation.

configure

configures the server specified by server_name as the primary companion in a failover configuration.

drop

permanently drops a companion from failover configuration. After the command has completed, the servers are in single-server mode.

suspend

temporarily removes the companions from a failover configuration. After the command is completed, the companions are in suspended mode.

resume

reverses the suspend command and resumes normal companion mode between the companions.

prepare_failback

prepare the secondary companion to relinquish the primary companion’s resources so it can failback.

do_advisory

verifies that the secondary companion is compatible for successfully performing the primary companion’s functions during failover mode.

with_proxydb

vreates proxy databases on the secondary companion for all database other than the system databases – and all subsequent databases that are added – when this parameter is included in the initial configuration of the companion servers. By default, with_proxydb is disabled.

srvlogin

is a user’s login to access the companion server. By default, the value of srvlogin is “sa”.

srvpassword

is the user’s password to access the companion server. By default, the value of srvpassword is null.

cluster_login

i the user’s login to log into the cluster. By default, the value of cluster_login is “sa”.

cluspassword

is the users password you must provide to log into the cluster. By default, the value of cluspassword is null.

Examples

Example 1

Configures the Adaptive Server MONEY1 as the primary companion:

sp_companion "MONEY1", configure

Example 2

Configures the Adaptive Server MONEY1 as the primary companion and creates proxy databases on the secondary companion:

sp_companion "MONEY1", configure, with_proxydb, "sa", "sapsswd"

Example 3

Drops the Adaptive Server PERSONEL1 from the failover configuration. After the command has completed, both the primary companion and the secondary companion will be in single-server mode:

sp_companion "PERSONEL1", "drop"

Example 4

Resumes normal companion mode for the companion server (in this example, MONEY1):

sp_companion "MONEY1", "resume"

Example 5

Prepares the primary companion (in this example, PERSONEL1) to change to normal companion mode and resume control of the Adaptive Server that failed over:

sp_companion "PERSONEL1", "prepare_failback"

Example 6

Checks to make sure a cluster operation with the PERSONEL1 companion will be successful. Because do_advisory in this example uses the all parameter, it checks all the do_advisory attributes of PERSONEL1 to make sure that none of them will prevent a successful cluster operation, and that the secondary companion can successfully perform the primary companion’s operations after failover is complete:

sp_companion "PERSONEL1", do_advisory, "all"

Example 7

Checks to make sure that none of the attributes for the Component Integration Services (CIS) on the companion server is compatible with the local server:

sp_companion "PERSONEL1", do_advisory, "CIS"

Usage

For complete information, see Using Sybase Failover in A High Availability System. Before running the do_advisory command, make sure to read the configuration chapter of this book as well as the do_advisory chapter.

Permissions

Only users with the ha_role can issue sp_companion.