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

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » High availability and read-only scale-out systems » Database mirroring » Maintaining a database mirroring system

 

Moving a partner server

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.

Prérequis

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.

Contexte et remarques

Examples in this topic reference localhost in the connection strings. Replace these references with the actual computer names.

 Task
  1. 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

  2. Create a new directory for the new partner server.

  3. Connect to the primary server.

  4. 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.

  5. 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'; 
  6. 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';
  7. 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
  8. 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
  9. Connect to the new partner server and verify that it is the mirror server.

Résultat

The mirror system is running with the new partner server.

Suivant

Ensure that clients connecting to the primary server or mirror server have their connection strings updated to specify the addresses of both partners in the Host connection parameter.

 See also