WANSync SQL Server Operations Guide
This documentation and any related computer software help programs (hereinafter referred to as the Documentation ) is for the end user s informational purposes only and is subject to change or withdrawal by CA at any time. This Documentation may not be copied, transferred, reproduced, disclosed, modified or duplicated, in whole or in part, without the prior written consent of CA. This Documentation is confidential and proprietary information of CA and protected by the copyright laws of the United States and international treaties. Notwithstanding the foregoing, licensed users may print a reasonable number of copies of the Documentation for their own internal use, and may make one copy of the related software as reasonably required for back-up and disaster recovery purposes, provided that all CA copyright notices and legends are affixed to each reproduced copy. Only authorized employees, consultants, or agents of the user who are bound by the provisions of the license for the Product are permitted to have access to such copies. The right to print copies of the Documentation and to make a copy of the related software is limited to the period during which the applicable license for the Product remains in full force and effect. Should the license terminate for any reason, it shall be the user s responsibility to certify in writing to CA that all copies and partial copies of the Documentation have been returned to CA or destroyed. EXCEPT AS OTHERWISE STATED IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION AS IS WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. The use of any product referenced in the Documentation is governed by the end user s applicable license agreement. The manufacturer of this Documentation is CA. Provided with Restricted Rights. Use, duplication or disclosure by the United States Government is subject to the restrictions set forth in FAR Sections 12.212, 52.227-14, and 52.227-19(c)(1) - (2) and DFARS Section 252.227-7014(b)(3), as applicable, or their successors. All trademarks, trade names, service marks, and logos referenced herein belong to their respective companies. Copyright 2007 CA. All rights reserved.
Contents Chapter 1: Getting Started 5 About WANSync SQL... 6 Requirements... 7 Supported SQL Server Versions... 7 Select Databases for Replication... 8 WANSync Components... 9 XOsoft Engine... 9 WANSync Manager... 9 WANSync CLI... 10 ws_ex2ex.exe Utility... 11 Chapter 2: Server Setup 13 Install WANSync Manager... 13 Prepare the Servers... 14 Remote Installation Wizard... 14 Master Server... 18 Replica Server... 18 Create a New Scenario... 19 Run the Scenario from Outside the Wizard... 27 Chapter 3: Switching Over to a Replica Server 29 Switch Over to a Replica Server... 29 Rename the Microsoft SQL Server 7... 29 Rename the Microsoft SQL Server 2000/2005... 30 Chapter 4: Chapter 4: Switching Back to the Master Server 31 Prepare the Servers... 32 Switch Back to the Original Master Server... 33 Appendix A: WANSync Tips 35 Spool Settings... 35 Read Only Web GUI... 36 Contents 3
Index 39 4 Operations Guide
Chapter 1: Getting Started This document outlines a disaster recovery solution for SQL Server, based on replication to a local or remote replica server. In case of a critical failure where it is not possible to simply make the SQL data available again immediately (due to server crash, or worse - total site disaster), it is possible to recover from the backup server or to switch your users to the replica (backup) SQL server and resume operation in minimum time. The goal is to provide a step-by-step guide to the procedures that must be carried out before and after failure, in order to achieve successful disaster recovery of your SQL server. Important! WANSync provides reliable SQL disaster recovery. However, since recovery is a manual process, you must follow the steps in this guide exactly to be successful. You should customize the steps listed in this guide only if: (1) you are very familiar with WANSync and fully understand the potential impact and (2) have fully tested the step(s) in a lab environment before implementing in a production environment. For a fully automated solution please review WANSync for SQL. Getting Started 5
About WANSync SQL About WANSync SQL WANSync SQL is an SQL data recovery solution that uses asynchronous realtime replication to provide cost-effective disaster recovery capabilities for Microsoft SQL on 32- and 64-bit Windows standalone and cluster servers. WANSync's asynchronous SQL server replication, over LAN or WAN, of database files from a production server to one or more local or geographically distant replica servers offers rapid SQL server recovery. Integrated continuous data protection safeguards against data corruption, and completely nondisruptive automatic testing of the SQL data recovery system reports on the state of the replica server environment to ensure it operates as planned in the event of a switchover. When disaster strikes, and anything that puts a stop to your ability to do business is a disaster, it is critical that you respond urgently. Whether a flood or a blackout, or the more probable virus attack or user error, you must recovery quickly with minimal data loss or risk losing productivity, revenue, customers and opportunities, perhaps even the viability of your entire business. WANSync SQL server replication software and SQL data recovery software helps ensure that you are ready to respond. 6 Operations Guide
Requirements Requirements In order to implement the WANSync procedures, you must have or install the following: The same version of Microsoft SQL Server installed on both master and replica servers SQL Server installed with the same login credentials on master and replica machines The XOsoft Engine installed on both master and replica servers Also, you must stop the SQL Server service on a replica host when replication is active. Note: If the SQL master database is not replicated, you can detach the replicated databases on the replica server without stopping the service. Configure any antivirus software and backups to exclude the WANSync installation directory as well as the WANSync spool directory if its location has been changed from the installation directory. Supported SQL Server Versions WANSync SQL auto-discovery supports the following SQL Server versions: Microsoft SQL Server 7 Microsoft SQL Server 2000/2005 Getting Started 7
Select Databases for Replication Select Databases for Replication Using WANSync SQL, you can replicate either all SQL databases (including SQL master Database) or only user-created databases. Replicating one or more user-created databases offers the following advantages: Initial data synchronization between master and replica servers is faster, as less data is transferred over the network Data can be stored on a replica site at a different location, even if the standby solution is used There is no need to stop SQL Server service on the replica machine. However, replicated databases must be detached before replication is started Alternatively, you can replicate all SQL databases (including the SQL master database. In this case, there is no need to attach databases, as the SQL master database on the replica server is updated with path information for all other databases. However, this approach requires the following: SQL server service must be stopped on the replica server before replication is started The database directory structure on the master and replica servers must be identical (this is required only if you intend to open SQL databases on the replica server) You can consider replication of all databases (including the master database containing SQL configuration information), if you plan to make frequent changes to system tables (for example, adding users to the syslogins table in the SQL master database). Changes to system tables are reflected in the replicated files. Important! If you are using Assured Recovery testing, replication of the system databases is mandatory. 8 Operations Guide
WANSync Components WANSync Components WANSync is comprised of the following components: XOsoft Engine. WANSync s service - runs on each server involved in the scenario WANSync Manager. Management GUI - used to manage and configure WANSyncHA WANSync CLI. Provides command line access to all WANSync Manager functions ws_ex2ex.exe. Located in the WANSync installation folder. It is used during the switchover process and to validate your Exchange configuration. XOsoft Engine WANSync is the executable file that lies at the heart of the WANSync system. It is installed on every host participating in replication and must be running before any replication scenario can run. Each engine can act as a master or replica with respect to each replication procedure or tree. It can also participate in more than one replication tree, as long as the file system directories, to which the different replication procedures are applied, don't overlap one another. WANSync runs as a daemon system service on Unix and communicates via default TCP port 25000 (you can change the default port number). WANSync Manager The Manager is a graphical user interface (GUI) application that controls all replication hosts, both in the definition and operation (running) of replication services. The offline process is mainly the definition of replication scenarios. Once a replication scenario is sent to the participating hosts, the Manager also provides the means for online control (running, synchronizing, etc.) and monitoring (i.e., node status, log files, etc.). You can operate the WANSync Manager from any location from which connections are established to WANSync hosts. Note: The Manager connects as a TCP client to master and replicas defined in the replication scenario. Once a replication process is running, the Manager is no longer required for the process to continue. Connection to replica hosts is not mandatory - it is required only in order to enable selection of destination directories via browsing, instead of manually. Connection to the master host is mandatory. Getting Started 9
WANSync Components WANSync CLI The CLI is the command line (non-gui) equivalent of the WANSync Manager. You can call it up using the commands: > cd <INSTALLDIR> > ws_cli When you first enter the CLI, it (running as a command prompt) displays the application title immediately followed by its version number, and a list of the existing scenarios. Typing ls, at this level shows a letter with a bracket around it, indicating the user type: ([S] - Super User; [A] - Admin; [C] - Control; [V] - View Only). In the above example, the user is a Super User. At any point in time, typing Help or? presents a list of available commands. Note: Commands that are not available in the WANSync Managers GUI interface are grayed-out and made insensitive. In the CLI version, however, they do not appear (for example, a Super User has many more commands at his/her disposal than does a View Only user). The list of options are indexed sequentially from zero on. When a list of options is reduced, it is still indexed sequentially, starting from zero. Help always displays all the commands, even though some may not be available. There are two modes available to the CLI: Edit mode Create new replication scenarios Specify servers (master and replica) either by their server name or by their IP address Add directories/files to be replicated from master to replica(s) Set appropriate directories on the replica(s) Set replication properties Edit mode is identified by the Edit:WS> prompt Note: Running the CLI requires write permission in the current working directory. Run mode Start/stop replication 10 Operations Guide
WANSync Components Synchronize hosts Monitor the replication process Display events and error messages The run mode is identified by the Run:WS> prompt The CLI configuration is presented as a hierarchical structure: WS (WANSync CLI root) <Scenario name> <Server name> (master and replicas) DIR [List of replicated directories] [List of included/excluded files] (optional) REPORTS (for master server only) [List of reporting properties] EVENTS (for master server only) [List of event notification properties] [List of master/replica properties] For more details on using the CLI, see the WANSync User Guide. ws_ex2ex.exe Utility This utility is located in the WANSync installation folder. It is used during the switchover process. It is also used to validate your Exchange configuration. Getting Started 11
Chapter 2: Server Setup This chapter describes the most common setup for WANSync SQL Servers. Install WANSync Manager Install WANSync Manager and the Remote Installation Wizard onto the machine from which the WANSync scenario will be configured. The location of the Manager is not critical so long as it is accessible in the event of a disaster. Frequently, the Manager is installed on an administrative workstation. Important! If the Manager is installed directly on either the master or replica servers, ensure that the XOsoft Engine is also installed. If you intend to use the XOsoft Remote Installer (recommended), the machine on which you are running the remote installer must have the.net framework 2.0 installed. The framework is required only on the machine running the remote installer wizard (GUI); the target servers do not have this requirement. Server Setup 13
Prepare the Servers After the scenario is run it is cached on your master and replica servers. Once cached, you can download it to any installed WANSync Manager by selecting Download from the File menu (then enter the name of your master or replica server). Prepare the Servers The following subsections describe how to prepare the Exchange servers for use with WANSync. Remote Installation Wizard You can use the Remote Installation Wizard to deploy the XOsoft Engine to any number of servers, or cluster nodes, in one step. Alternatively, you can install the XOsoft Engine manually by running setup.exe directly on each server. Note: If you install the XOsoft Engine using the remote installation wizard, you can skip the the manual installation step under the sections Master Server and Replica Server. Run the remote installation wizard either from the start menu or from the WANSync Manager Tools menu. When using the remote installation wizard, consider the following steps: Installation location - ensure that this path is correct and contains a valid WANSync setup package. 14 Operations Guide
Prepare the Servers Hosts selection - select the servers (or cluster) nodes to which you want to deploy the XOsoft Engine (you can add servers manually from the Host Name/IP Address box). User credentials - the user account that is used to install the XOsoft Engine on each target server (ensure that this account is a local Administrator on all target machines). Server Setup 15
Prepare the Servers Preinstall verification - click Next after all servers have reported success. Installation settings - if installing on standalone servers (i.e., not clustered), use Local System Account for the Service Logon Information. 16 Operations Guide
Prepare the Servers Note: If you are installing to cluster nodes, ensure that you enter an account that is a local administrator on all cluster nodes. Ready to Install - confirm that all desired servers are listed and then click the Install button. Installing - you can monitor the installation process. Report - in this last step you can view the full installation report and, optionally, save a copy (the XOsoft Engine now is installed on all selected servers or cluster nodes). Server Setup 17
Prepare the Servers Master Server To install on the master server 1. If you did not use the Remote Installation Wizard, install WANSync on the master server. Note: If you are installing on cluster nodes, use a service account that is a local administrator on all cluster nodes. For standalone servers (i.e., nonclustered), use the default of Local System. 2. If you have file level antivirus software installed, exclude the WANSync installation directory and SQL database and log files from antivirus protection. 3. If the master server is a cluster, perform steps 1 and 2 on all nodes. You do not need to switch over the SQL group during installation. Replica Server To install on the replica server 1. If you did not use the Remote Installation Wizard, install WANSync on the replica server. Note: If you are installing on cluster nodes, use a service account that is a local administrator on all cluster nodes. For standalone servers (i.e., nonclustered), use the default of Local System. 2. If you have file level antivirus software installed, exclude the WANSync installation directory and Exchange database and log files from antivirus protection. 3. If the replica server is a cluster, perform steps 1 and 2 on all nodes. You do not need to switch over the SQL group during installation. 18 Operations Guide
Prepare the Servers Create a New Scenario To create a new scenario 1. Open WANSync Manager. From the File menu select New or click the New Scenario button. 2. At the Welcome step click Next to Create New Scenario. 3. At the Scenario Type step select MS SQL, Disaster Recovery Scenario (basic) and, optionally, Replica Integrity Testing for Assured Recovery. Note: Learn more about Assured Recovery and how it can help ensure success through automatic testing. Please visit the Products menu at www.caxosoft.com or review the WANSync User Guide for more information. Server Setup 19
Prepare the Servers 4. During the Hosts step, name the scenario and input the server names for the master and replica hosts. Important! If either server is a MSCS cluster, enter the SQL Virtual Server Name as the master and/or replica name. 20 Operations Guide
Prepare the Servers 5. At the Master Configuration step, WANSync displays the SQL databases on the master server. These are the databases that will be replicated and protected. At this step you also have the option to exclude specific databases from replication and monitoring. Important! If you have Assured Recovery enabled, you must replicate the system databases. If you do not want to replicate the system databases and the checkboxes that allow them to be excluded are not provided, create a new scenario which does not have Assured Recovery enabled. Server Setup 21
Prepare the Servers 6. The Root Directories step displays the data to be replicated. Press the Next button to continue. Important! You can add additional files or folders to replication after running this wizard. Follow the prompt to run the scenario later then double click on the master server name under the Directories tab. 22 Operations Guide
Prepare the Servers 7. The Scenario Properties step allows you to configure additional properties. No changes are required at this step. Click Next when ready. Important! You can modify all the settings in this pane after the scenario is created. However, before changing any Spool properties (which are configured here), please review Spool Settings for configuration details. Server Setup 23
Prepare the Servers 8. The Assured Recovery step is presented only if you selected AR in the Scenario Type step. Important! If scheduled testing is desired, double-click on the value for Schedule: the Assured Recovery hours screen opens allowing you to set a schedule for testing. 24 Operations Guide
Prepare the Servers 9. 9. Scenario Verification checks many different parameters between the master and replica and servers to ensure a successful switchover. If any errors are reported you cannot continue until they are resolved. To retry verification click the Retry button. After the scenario is verified successfully, click Next to continue. Important! Although the software allows you to continue with warnings, it is not recommended to do so. Resolve any warning situations before continuing to ensure proper operation of the application. Server Setup 25
Prepare the Servers 10. The scenario configuration is now complete. Click the Run Now button to start data synchronization or click Finish to run the scenario later. Synchronization may take a while depending on database size and network bandwidth between the master and replica. You will receive the following message in the Event window when synchronization is complete: All modifications during synchronization are replicated. At this point, real-time replication is operational and the disaster recovery solution is installed and active. 26 Operations Guide
Run the Scenario from Outside the Wizard Run the Scenario from Outside the Wizard To run the scenario from outside the wizard 1. Select the Run button on the WANSync Manager tool bar or select Run from the Tools menu. 2. Click OK to run the scenario. The Run screen is displayed. 1. Leave the default values in the dialog box: the Block Synchronization method with the Ignore Same Size/time Files option unchecked. 2. Click the Synchronize button. Synchronization may take a while, depending on database size and network bandwidth between the master and replica. You will receive the following message in the event window when the synchronization is complete: All modifications during synchronization are replicated. At this point, real-time replication is operational and the disaster recovery solution is installed and active. Server Setup 27
Chapter 3: Switching Over to a Replica Server This section describes how to switch over to the replica server after a failure occurs on the master server. A switchover uses the replica server as a totally redundant inactive server, which, in case of failure, replaces the master server. Switch Over to a Replica Server To perform the switchover 1. If the master host is available, stop the replication scenario in the WANSync Manager. 2. If the master host is not responding, restart XOsoft Engine service on the replica host. 3. Start the SQL Server service on the replica server. 4. If you do not replicate the SQL master database, you may need to attach the replicated databases if they are not already attached. 5. Disconnect the master server from the network. 6. If the replica server is on the same subnet as the master, add the IP of the master server to the network adapter of the replica. In this case the replica network adapter will have two IP addresses. This is done using the Advanced button in the TCP/IP properties of the appropriate network adapter. 7. In case the new server needs to be on a different subnet, edit the DNS by changing the master server s IP address to the replica server s IP address. For example: The master server Server1 has an IP of 10.201.200.4. The replica server Server2 has an IP address of 192.168.3.10. On your DNS server, change the IP address of Server1 to 192.168.3.10. Rename the Microsoft SQL Server 7 If you have changed the computer name, you cannot start the SQL Server until you run the SQL Server Setup. You will be prompted to upgrade, and the necessary SQL Server registry keys will be reset with the new computer name. The databases are not affected by this procedure. Switching Over to a Replica Server 29
Rename the Microsoft SQL Server 2000/2005 Rename the Microsoft SQL Server 2000/2005 If you run SQL Server 2000/2005, the new name is recognized during the SQL service startup. There is no need to run Setup again or to reset the server name. If there are any remote logins to the SQL Server, sp_dropserver may generate an error. To resolve the error, you may need to drop remote logins and rerun the procedure. Note: In order to see the new SQL server in the Enterprise Manager, you need to delete an old server registration, and register the new name. 30 Operations Guide
Chapter 4: Chapter 4: Switching Back to the Master Server This chapter describes how to switch back to the original master server. It is assumed that after switchover, the master server can be reinstalled or restored from a backup, and has the same SQL Server configuration as it had prior to the failure. Note: After the master server is restored from backup, it may have the same IP address as the replica server. Do not connect the master server to the network as that will lead to an IP collision. Chapter 4: Switching Back to the Master Server 31
Prepare the Servers Prepare the Servers Before connecting the restored master to the network, make sure the subdirectory config_25000 exists under the INSTALLDIR (default C:\Program Files\XOsoft\WANSync). If it does exist, remove it and its contents; then restart the WANSync service. Also cancel the dynamic registration in the DNS. Apply this change in the Advanced TCP/IP Settings window under the DNS tab. This option appears when you uncheck the Register This Connection s Address in the DNS option at the bottom of the window. 32 Operations Guide
Switch Back to the Original Master Server Switch Back to the Original Master Server To switch back to the original master server 1. Build a reverse synchronization scenario (you can do this in advance) that synchronizes changes from the replica to the master. 2. Start the reverse scenario. 3. When synchronization is completed the events window displays: All modifications during synchronization period are replicated. 4. Before redirecting users back to the master, stop SQL service on the replica to ensure updates are stopped; then stop the backward WANSync scenario. 5. Modify the master s DNS A-records: 6. For DNS redirection, assign the original master server s IP address 7. For IP transfer, remove the original master s IP address from the replica and assign it back to the master 8. Start SQL services on the master (if necessary, attach all databases). At this point SQL is running on the master and clients are redirected. You can start your original Forward scenario from the master to the replica. Chapter 4: Switching Back to the Master Server 33
Appendix A: WANSync Tips This chapter provides you with helpful information concerning the application. Spool Settings The WANSync spool is a folder on disk where data to be replicated is backed up (i.e., spooled) if bandwidth is not sufficient to transfer the amount of changes in real-time. Data can spool due to temporary network disconnections, network congestion, or simply because the network bandwidth is not sufficient to transfer the amount of data changing over on the server. In addition to storing changes waiting on available bandwidth, spool space is also used as part of the normal synchronization process. Thus, some spool build up during synchronization is normal. Place the WANSync spool folder on a drive with relatively low use such as a dedicated volume or boot/system volume. Do not place the spool folder on a volume containing frequently accessed system (OS), user, or application data. Examples include volumes containing databases, shared files, or the system pagefile. By default, the spool folder is located in the tmp folder under the WANSync installation directory. The spool parameters, located in the properties tab (on both master and replica) or set with the New Scenario Wizard, determines how much disk space is available for the spool. In most cases the default values are sufficient. However, if you choose to change this value, it should be at least 10% of the total dataset size. For example, if you are replicating 50GB of data on a server you should ensure that at least 5GB of space is available for spool. Please note that this space is not pre-allocated. Important! If you change the spool location, please remember to remove the new path from file level antivirus scans: both scheduled and real time. WANSync Tips 35
Read Only Web GUI Read Only Web GUI The primary WANSync Manager may only be used by one Administrator at a time. Opening the GUI locks it for the current user making simultaneous use impossible. This is required to prevent conflicts. To allow simultaneous monitoring by any number of administrators WANSync also offers a read only Web GUI. 1. To access the Web GUI open your browser to http://masterservername:25000. 2. Enter a user account and password with administrative permissions on the master server. 36 Operations Guide
Read Only Web GUI Important! There is no need to refresh the browser; the GUI refreshes automatically. You can monitor all parameters, statistics, and events from this window. WANSync Tips 37
Index A administrative permissions 36 assured recovery 19 C client 9 configure 9, 19 D databases for replication 8 DNS A-record 33 DNS redirection 33 dynamic registration 32 G Getting Started 5 H high availability 27 I install 13, 14, 18 Install WANSync Manager 13 Installation 13, 14, 18 installation wizard 13, 14, 18 M Manager, WANSync 10 master server to standalone replica server, Switchover from sta 29 N Non-intrusive installation 9, 11 P Prepare 14 Prepare, servers 14 properties 10, 19 R Rename Microsoft SQL Server 2000 30 rename server 29 Replica server 18 replica server, Switchover from standalone master server to sta 29 Requirements 7, 11 Running the scenario from outside the wizard 27 S scenario 9, 13, 19, 27 scenarios master 27 Select databases for replication 8 server 9, 10, 13, 14, 18, 19, 27 server to standalone replica server, Switchover from standalone 29 server, Switchover from standalone master server to standalone 29 servers, prepare 14 setup 14 Software installation 13, 14, 18, 27 SQL Master Database 8 standalone master server to standalone replica server, Switchov 29 standalone replica server, Switchover from standalone master se 29 Supported SQL server versions 7 switch back 33 Switch back to original master server 33 Switchover from standalone master server to standalone replica 29 U user-created databases 8 W WANSync Manager 9, 10, 13, 14, 19, 27 Web GUI 36 wizard installation 13, 14, 18, 27 Read only,web GUI 36 remote 13, 14, 18 remote installation wizard 13, 14, 18 Index 39