Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » SQL Anywhere High Availability » Introduction to database mirroring » Setting up database mirroring

Forcing a database server to become the primary server Next Page

Initiating failover on the primary server


You can initiate a database mirroring failover from the primary server to the mirror server by executing the following statement:

ALTER DATABASE SET PARTNER FAILOVER

This statement is an alternative to specifying a preferred server, and can be used with logic that controls when ownership of the database is given to a specific database server. For example, you may want to initiate failover based on the availability of the partner server (determined by the value of the PartnerState database property), or the number of connections to the database (determined by the value of the ConnCount database property).

When this statement is executed, any existing connections to the database are closed, including the connection that executed the statement. Consequently, if the statement is contained in a procedure or event, other statements that follow it may not be executed. The permissions required to execute this statement are controlled by the -gk server option.

See also