Database Mirroring: High Availability (HA) and Disaster Recovery (DR) Technology



Similar documents
Install and Configure SQL Server Database Software Interview Questions and Answers

HA/Disaster and Recovery Solution Mirroring Review & Log Shipping

Virtualization and Cloud Computing

SQL Server Mirroring. Introduction. Setting up the databases for Mirroring

MIRRORING: START TO FINISH. Ryan Adams Blog - Twitter

Only for Data Group Students Do not share with outsiders and do not use for commercial purposes.

Administering a Microsoft SQL Server 2000 Database

Implementing Microsoft SQL Server 2008 Exercise Guide. Database by Design

Migrate a Database to Microsoft SQL Server Database

MS-55115: Planning, Deploying and Managing Microsoft Project Server 2013

SQL Server Training Course Content

Configure SQL database mirroring

SQL Server 2012/2014 AlwaysOn Availability Group

Course 55115: Planning, Deploying and Managing Microsoft Project Server 2013

This article Includes:

Administering a Microsoft SQL Server 2000 Database

Module 14: Scalability and High Availability

Planning, Deploying and Managing Microsoft Project Server 2013

Deploy App Orchestration 2.6 for High Availability and Disaster Recovery

GoGrid Implement.com Configuring a SQL Server 2012 AlwaysOn Cluster

SQL Server AlwaysOn Deep Dive for SharePoint Administrators

Application Note 116: Gauntlet System High Availability Using Replication

SQL Server for Database Administrators Course Syllabus

Microsoft SQL Database Administrator Certification

Administering a Microsoft SQL Server 2000 Database

Database Mirroring & Snapshots SQL Server 2008

Contents. SnapComms Data Protection Recommendations

Supporting MS SQL Server Failover Using Database Mirroring

Appendix A Core Concepts in SQL Server High Availability and Replication

McAfee Endpoint Encryption Hot Backup Implementation

Expert Reference Series of White Papers. Unlock the Power of Microsoft SQL Server 2012

Administering and Managing Log Shipping

Load Balancing & High Availability

Data Sheet: Disaster Recovery Veritas Volume Replicator by Symantec Data replication for disaster recovery

Eliminate SQL Server Downtime Even for maintenance

1. Management Application (or Console), including Deferred Processor & Encryption Key 2. Database 3. Website

Availability Guide for Deploying SQL Server on VMware vsphere. August 2009

High Availability with Postgres Plus Advanced Server. An EnterpriseDB White Paper

EISOO AnyBackup 5.1. Detailed Features

Xopero Backup Build your private cloud backup environment. Getting started

SELF SERVICE RESET PASSWORD MANAGEMENT DATABASE REPLICATION GUIDE

Active Directory Infrastructure Design Document

Release Notes. LiveVault. Contents. Version Revision 0

Advanced HA and DR.

Explain how to prepare the hardware and other resources necessary to install SQL Server. Install SQL Server. Manage and configure SQL Server.

SQL Server AlwaysOn (HADRON)

6231A - Maintaining a Microsoft SQL Server 2008 Database

NUTECH COMPUTER TRAINING INSTITUTE 1682 E. GUDE DRIVE #102, ROCKVILLE, MD WEB: TEL:

Rajesh Gupta Best Practices for SAP BusinessObjects Backup & Recovery Including High Availability and Disaster Recovery Session #2747

Chancery SMS Database Split

Course 10751A: Configuring and Deploying a Private Cloud with System Center 2012

Designing Database Solutions for Microsoft SQL Server 2012 MOC 20465

Designing a Data Solution with Microsoft SQL Server 2014

Designing, Optimizing and Maintaining a Database Administrative Solution for Microsoft SQL Server 2008

Technical Notes. EMC NetWorker Performing Backup and Recovery of SharePoint Server by using NetWorker Module for Microsoft SQL VDI Solution

SQL Server on Azure An e2e Overview. Nosheen Syed Principal Group Program Manager Microsoft

Microsoft SharePoint 2010 on VMware Availability and Recovery Options. Microsoft SharePoint 2010 on VMware Availability and Recovery Options

AVLOR SERVER CLOUD RECOVERY

Extending Your Availability Group for Disaster Recovery

MCTS Microsoft SQL Server 2005 Implementation & Maintenance

MS SQL Server DBA Training Course. Table of Contents

Configuring and Deploying a Private Cloud with System Center 2012

Maintaining a Microsoft SQL Server 2008 Database

MS Design, Optimize and Maintain Database for Microsoft SQL Server 2008

Metalogix SharePoint Backup. Advanced Installation Guide. Publication Date: August 24, 2015

DocAve 6 High Availability

Integrating Data Protection Manager with StorTrends itx

126 SW 148 th Street Suite C-100, #105 Seattle, WA Tel: Fax:

Implementing and Managing Windows Server 2008 Clustering

Overview... 1 Requirements Installing Roles and Features Creating SQL Server Database... 9 Setting Security Logins...

SafeCom G2 Enterprise Disaster Recovery Manual

Using Emergency Restore to recover the vcenter Server has the following benefits as compared to the above methods:

Backup Exec Private Cloud Services. Planning and Deployment Guide

PolyServe Understudy QuickStart Guide

Using SQL Database Mirroring to Improve Citrix XenApp Server Farm Disaster Recovery Capabilities

Microsoft SQL Server 2008R2 Mirroring

Designing and Deploying Messaging Solutions with Microsoft Exchange Server 2010 Service Pack B; 5 days, Instructor-led

High Availability and Disaster Recovery for Exchange Servers Through a Mailbox Replication Approach

A SURVEY OF POPULAR CLUSTERING TECHNOLOGIES

Course Syllabus. At Course Completion

Course Syllabus. Maintaining a Microsoft SQL Server 2005 Database. At Course Completion

$99.95 per user. SQL Server 2005 Database Administration CourseId: 152 Skill level: Run Time: 30+ hours (158 videos)

Veritas Replicator from Symantec

Install SQL Server 2014 Express Edition

Installing and Configuring a. SQL Server 2012 Failover Cluster

Microsoft SQL Server Installation Guide

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

PrivateWire Gateway Load Balancing and High Availability using Microsoft SQL Server Replication

How To Upgrade Your Microsoft SQL Server for Accounting CS Version

MS 10751A - Configuring and Deploying a Private Cloud with System Center 2012

Course 2788A: Designing High Availability Database Solutions Using Microsoft SQL Server 2005

$99.95 per user. SQL Server 2008/R2 Database Administration CourseId: 157 Skill level: Run Time: 47+ hours (272 videos)

MOC 5047B: Intro to Installing & Managing Microsoft Exchange Server 2007 SP1

Use of Commercial Backup Software with Juris (Juris 2.x w/msde)

Microsoft SQL Server Installation Guide

DFW Backup Software. Whitepaper DFW Backup Agent

Transcription:

Written by Zakir Hossain, CS Graduate (OSU) CEO, Data Group Fed Certifications: PFA (Programming Foreign Assistance), COR (Contracting Officer), AOR (Assistance Officer) Oracle Certifications: OCP (Oracle Certified Professional), OCA (Oracle Certified Associate), Oracle RAC- Admin, Oracle Backup/Recovery-Admin, Oracle Performance/Monitoring-Admin, Oracle App Server-Admin Microsoft Certifications: MCDBA (Microsoft Certified Database Admin), MCITP: SQL Database Admin, MCITP: SharePoint Admin System Admin Certifications: MCITP: Windows Server 2012 Admin, RHCSA (Red Hat Certified System Admin) Programming Certifications: SCJP (Sun Certified Java Programmer) Other Certifications: Security+, ITIL V3 Please Read License Agreement carefully.. You are allowed to use this document only for your personal and job related purposes. Under no circumstances, you are not allowed to share this document with any institute/organization, individuals, business entity, and students either current or discontinued without written permission. It also prohibited modifying or altering any parts of this document either for commercial or training purposes. It is 100% prohibited and violation of Federal Law of Intelligence Product. A serious action will be taken if it is violated. If you need our books, notes, documents, please contact directly with Zakir Hossain (ZHossain@DataGroupUSA.com, 703-203-2325) Introduction to High Availability Options in SQL Server: Data means everything to a business, a business cannot run without reliable data, have available data when a business need, and the way business requires the data. How we make data always available to users, vendors, employees is a very critical task. This is one of the most important, and critical task of a Database Engineer. Business needs data 99.99% of the time of a day to support their clients and customers. So, after calculation, a database can be down for about 5 minutes a year. This could be tough and very expensive. However, it is not impossible to achieve using SQL Server. Since SQL Server 2008 R2, Microsoft assures six (6) 999999 availability meaning SQL Server 2008 R2 is the only database system that is available for 99.9999% of time comparing other popular databases like Oracle, DB2, MySQL, and Sybase. High availability and Disaster Recovery solutions of database is used for high uptime of a database and be able to distribute data to multiple instances running in different locations regardless of geographical locations. High Availability Technologies/Solutions in SQL Server: VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 1 of 9

1. Log Shipping 2. Replication 3. Database Mirroring 4. Failover clustering 5. AlwaysOn (AlwaysOn Availability Group) Database Mirroring: Database mirroring is a technology in SQL Server that offers high availability (HA) and Disaster Recovery (DR) solution for Databases. Database mirroring technology started from SQL Server 2005. Again, it is a HA/DR solution to maintain two copies of same database on two different servers/instances. To use Database mirroring technology a database must have Full recovery model. The database can be mirrored from one SQL Server instance to another SQL Server instance and it cannot be done within the same instance. So, it must have at least two instances. The source instance is called Principal server and the target instance is called Mirrored server. However, it can have one more server, which is called Witness server. These instances could be on the same machine or on different machines. For production environment, the instances should be on different servers/machines. The principle server sends the active transaction log record to the mirrored server. The mirrored server applies the transaction log record one by one in sequence as they come-in. Database Mirroring Topology: VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 2 of 9

VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 3 of 9

Database Mirroring Advantage: 1. If primary server fails, it can automatically failover onto secondary server (in high safety mode). It depends on operational mode 2. It Increases Database Availability and can be zero downtime 3. Database mirroring can be combined with other high available and disaster recovery technologies such as clustering, log shipping, and replication 4. Failover can be as fast as few seconds 5. Data and database on the target server is a copy of the principal server is in real time 6. May be no loss of data 7. Data synchronization in real time 8. No downtime/can minimize downtime for HD or software upgrade 9. Comparatively easy to configure and manage 10. Does not require expense hardware 11. Does not require additional licensing cost VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 4 of 9

12. It is not limited by geographical distance 13. Database mirroring supports full-text catalogs Database Mirroring Disadvantage/ Limitations: 1. Database mirroring is per database only solution, which means that logins and jobs from the principal Server must be manually recreated on the mirror. That is can have only one Mirrored Database copy of a database 2. If needed to mirror other databases, every database requires separate mirroring configuration 3. There might be a possibility for delay, which can only be reduced with better hardware and network bandwidth 4. Mirrored database is inaccessible to clients/users. It means clients/users cannot use the Mirrored database while the principal database is up and running. That means only one database is accessible at a time 5. Cannot read data from the Mirrored Database Can create Snapshot of Mirrored Database for Reporting/Reading Purposes 6. Does not support FileStream 7. Can have only 1 copy of the primary database 8. If witness fails, the automatic failover will not work 9. Potential data lost is possible in asynchronous operation mode Highlights of Database Mirroring: 1. At least two instances are required to configure Database Mirroring. However, it can use three instances 2. Source server is called principal server 3. Source database is called Principal database 4. Target server is called mirrored server 5. Target database is called Mirrored database 6. The instance is called a witness instance 7. The second instance hosts the copy of the live database 8. Users can access only the principal database and they can read, write, delete, and update records in this database 9. Users cannot access mirrored database. So there are no options for users to be able to read, write, delete, update records in this database VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 5 of 9

10. The 3rd instance monitors the other two instances like activities, performance, applied or not applied logs and that is why it is called witness server 11. If the principal database goes down, 3rd instance will catch it. This will bring the mirrored database online and make it principal database 12. If you do not use the 3rd instance, you can still setup database mirroring. However you need to failover the database manually 13. Witness Server helps for automatic database Failover, Monitor Principal and Mirrored Server and database for mirroring and helps to form quorum/majority Requirements to setup database mirroring: 1. Principal database must have full recovery model 2. Does not support Simple or Bulk-logged Recovery Model 3. Restore the Principal database on the secondary server with no recovery 4. Take full and transaction log backup of the Principal database and restore on the secondary server 5. Database name must be same on both Principal and Target server 6. Service Accounts: Same service accounts for all servers involve in Mirroring (AD: Active Directory) Example: DataGroupUSA1 (AD) Service Account: SQLDBA Complete Account Name: DataGroupUSA1\SQLDBA 7. Database mirroring verification/testing: It is very to verify after setting up a database mirroring. Here are the different ways to verify the setup is working: 1. Verify or count the total number of records in one of the table in principal database Select COUNT (*) from transactions Select * from transactions 2. Insert some records into one of the table in principal database insert into transactions values (20, 59.99) 3. Shutdown the principal database 4. Refresh both principal and mirrored server and watch changes of the database status 5. Start the main sever again VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 6 of 9

6. Now mirror server is principal 7. Main is mirrored database now 8. Verify Transaction: Select * from transactions (run this on current principal db) How to setup mirroring: Ensure Primary Database has FULL Recovery Model Perform Full and Transaction Log Backup local server or network Move the Backup to Target Server/Network Server Restore on Mirror Server NORECOVERY MODE Once connected, we also notice our endpoint name is Mirroring and we are listening on port 5022. Click "Next >" and you'll see the Service Accounts screen. VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 7 of 9

When using Windows Authentication, if the server instances use different accounts, specify the service accounts for SQL Server. These service accounts must all be domain accounts (in the same or trusted domains). If all the server instances use the same domain account or use certificate-based authentication, leave the fields blank. Since my service accounts are using the same domain account, I'll leave this blank. Click "Finish" and you'll see a Complete the Wizard screen that summarizes what we just configured. Click "Finish" one more time. If you see the big green check mark that means Database Mirroring has been configured correctly. However, just because it is configured correctly doesn't mean that database mirroring is going to start... Next screen that pops up should be the Start/Do Not Start Mirroring screen: VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 8 of 9

We're going to click Do Not Start Mirroring just so we can look at the Operating Modes we can use: Since we didn't specify a witness server we will not get the High Safety with automatic failover option, but we still get the High Performance and High Safety without automatic failover options. For this example, we'll stick with synchronous high safety without automatic failover so changes on both servers will be synchronized. Next, click "Start Mirroring" as shown below. VA Office: 5600 General Washington Dr., Suite: B 212, Alexandria, VA 22312 9 of 9