To move a server in a database mirroring system to a different server without stopping the system, delete the mirror definitions of the current mirror server, create a new server, and add the new server to the mirroring system.
You must have the MANAGE ANY MIRROR SERVER privilege.
This task involves backing up a copy of the database. Depending upon the backup method you choose, see the appropriate privileges for that method.
Context and remarks
Examples in this topic reference localhost in the connection strings. Replace these references with the actual computer names.
Connect to the partner server that you want to move and ensure that it has the mirror role. You can only move the partner with the mirror role. If the server you want to move to is the primary server, you must initiate a failover so that the primary and mirror servers switch roles
Create a new directory for the new partner server.
Connect to the primary server.
Drop the partner definition for the server being moved by executing a DROP MIRROR SERVER statement.
The mirror database stops. If the mirror database is the only database running on the server, then the server also stops.
Create a new partner definition for the server to become the new partner. For example, execute the following statement:
CREATE MIRROR SERVER mirror_server3 AS PARTNER connection_string='SERVER=demo_server3;HOST=localhost:6874' state_file='c:\\server3\\server3.state';
Update the primary and mirror definitions. For example, execute the following statements:
ALTER MIRROR SERVER mirror_demo_primary AS PRIMARY connection_string='SERVER=mirror_demo_primary;HOST=localhost:6871,localhost:6874'; ALTER MIRROR SERVER mirror_demo_mirror AS MIRROR connection_string='SERVER=mirror_demo_mirror;HOST=localhost:6871,localhost:6874';
Make copies of the primary database file and transaction log and add them to the new partner server directory. For example, run the following command:
dbbackup -c "UID=DBA;PWD=sql;SERVER=mirror_server1;DBN=mirror_demo" server3
Start the new partner server with the -xp on option so that the new partner can join the mirroring system. For example, run the following command:
dbsrv16 -n mirror_server3 -x "tcpip(PORT=6874)" -su sql "c:\server3\mirror_demo.db" -xp on
Connect to the new partner server and verify that it is the mirror server.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|