Protect SQL Server 2012 AlwaysOn Availability Group with Hitachi Application Protector Tech Note Nathan Tran The purpose of this tech note is to show how organizations can use Hitachi Applications Protector to protect their Microsoft SQL Server installation against accidental data deletion or logical and physical corruption to the database file. Test case Pass/fail criteria Result Recovery of an AlwaysOn Availability Group enabled database on Primary Node Recovery of an AlwaysOn Availability Group enabled database on Secondary Node Recover database file from snapshot Recover database file from snapshot Successful Successful Application Protector allows database administrators to schedule or perform backups on an as needed basis of their SQL Server databases with the ability to rapidly restore SQL Server databases in the event of accidental data deletion or data corruption. It leverages Hitachi Thin Image snapshot technology and Microsoft Volume Shadow Copy Server (VSS) to provide application-consistent data protection. Application Protector provides the following: Backup, recovery and data protection software that is easy to use, snapshot based and provides application consistent data protection Off-loaded host server backup overhead with storage snapshots Manages disk-to-disk-based backup and recovery leveraging Microsoft Volume Shadow Copy Service infrastructure and cloning and snapshot features of Hitachi storage systems Ability to schedule single, daily, weekly or monthly snapshots Protect standalone SQL Server and AlwaysOn Availability Group This document provides the following; A proof point of basic functionality of this solution High level technical reference for considering this solution High level reference of the use case implementation is illustrated in Figure 1 2014, Hitachi Data Systems, Inc. Page 1 of 11 pages
Figure 1 2014, Hitachi Data Systems, Inc. Page 2 of 11 pages
Tested Components This section describes both the hardware and software components that were used to build out the Hitachi Application Protector testing environment. Table 1 Hardware Components Hardware Description Version Quantity Hitachi Unified Storage VM Dual controllers 2 8 Gb/sec Fibre Channel ports 256 GB cache memory 16 600 GB SAS disks 73-03-07-00/00 1 Hitachi Compute Blade 500 chassis 8-blade chassis 2 management modules 6 cooling fan modules 4 power supply modules 2 Brocade 5460 Fibre Channel switch modules 2 Brocade 10 GbE DCB switch modules SVP: A0135-D-6829 1 520H B1 server blade Half blade BMC 01-56 2 2 8-core Intel Xeon E5-2680 processor, 2.70 GHz 96 GB RAM Emulex 10GbE CNA onboard network adapter Hitachi 8 Gb/sec Fibre Channel mezzanine Card Table 2 Software Components Software Version Hitachi Application Protector 2.8 Hitachi Dynamic Provisioning Hitachi Thin Image Snapshot Hitachi RAID Manager CCI Microcode Dependent Licensed on Hitachi Unified Storage VM CCI-01-30-03 Hitachi VSS Hardware Provider 4.11 Microsoft Windows Server 2012 R2 Datacenter Edition 2014, Hitachi Data Systems, Inc. Page 3 of 11 pages
Software Microsoft SQL Server Version 2012 Enterprise Edition AlwaysOn Availability Group (AAG) Configuration The tested AAG is called "DEMO_AGG" consisting of two nodes, a primary and a secondary replica. Figure 2 Demo Database Characteristic The demo database was a fully populated sample order entry database with 1000 customers. The database details are as follows: 13 GB size on disk Database partition used 4 data files, 1 log file Default tempdb settings Table Count of Demo Database The demo database used for this test consisted of 38 tables. 2014, Hitachi Data Systems, Inc. Page 4 of 11 pages
Figure 3 Snapshot of Demo Database using Hitachi Application Protector on Both Nodes Snapshot of the demo database was successfully done on the primary and secondary nodes using Hitachi Application Protector. 2014, Hitachi Data Systems, Inc. Page 5 of 11 pages
Figure 4 Figure 5 2014, Hitachi Data Systems, Inc. Page 6 of 11 pages
Recovery of Data Loss Using Hitachi Application Protector This shows how Hitachi Application Protector protects an AAG-enabled database from data loss. The testing uses a database called demo consisting of 38 tables. Deleting of Data from Demo on Primary Node The trade_history table from the demo database is dropped to simulate accidental data loss. Figure 6 shows the drop command ran successfully. Figure 6 The SELECT command shows that the demo database now only has 37 tables since the TRADE_HISTORY table was dropped (Figure 7). Figure 7 Recover Lost Data from the Primary Node Perform recovery of lost data using Hitachi Application Protector on the primary node. Figure 8 shows the recovery on the primary node called UCPPRO-F-B4 using the option Replace Target Database Files Copy. 2014, Hitachi Data Systems, Inc. Page 7 of 11 pages
Figure 8 The Hitachi Application Protector operations event log indicated a successful recovery of the data (Figure 9). Figure 9 Upon completion of the recovery using Application Protector, the demo database now shows 38 tables using the SELECT command, as shown in Figure 10. 2014, Hitachi Data Systems, Inc. Page 8 of 11 pages
Figure 10 Recover the Demo Database Using a Secondary Node This shows the recovery of an AAG-enabled database using a snapshot that was made of the secondary node previously. The secondary node has to be promoted to become the primary node. This test was done from the secondary node (UCPPRO-F-B5). Figure 11 shows that, with the deletion of data from the demo database, a recovery can be made on the secondary node. Figure 11 A failover operation was performed to make UCPPRO-F-B5 the primary node of the AAG, as shown on Figure 12. Figure 12 There was a recovery of the demo database on the new primary node using a snapshot that was created when that node was the secondary node. This shows that the data and snapshot of the previous primary node is not required. Figure 13 shows that the recovery operation was done on UCPPRO-F-B5 using the Replace Target Database Files with File Copy option. 2014, Hitachi Data Systems, Inc. Page 9 of 11 pages
Figure 13 Figure 14 shows the successful recovery from the Application Protector operations logs. Figure 14 As shown on Figure 15, the demo database now shows 38 tables. Figure 15 General Statements These general statements apply to using Hitachi Application Protector: Although Hitachi Application Protector metadata can be hosted on a cluster resource, this may make manual metadata management a complex task. 2014, Hitachi Data Systems, Inc. Page 10 of 11 pages
Hitachi Data Systems recommends hosting metadata privately on a non-shared location, as Hitachi Application Protector is not yet fully cluster-aware. As the command line interface can be used to copy the metadata, it should be possible to script the metadata movement successfully in case of a failover. Hitachi Data Systems does not provide support for such scripts currently, but does support the correct functioning of the command line interface. Hitachi Data Systems Corporation 2014. All rights reserved. HITACHI is a trademark or registered trademark of Hitachi, Ltd. Innovate With Information is a trademark or registered trademark of Hitachi Data Systems Corporation. Microsoft and SQL Server are trademarks or registered trademarks of Microsoft Corporation. All other trademarks, service marks, and company names are properties of their respective owners. 2014, Hitachi Data Systems, Inc. Page 11 of 11 pages