SQL Server Data Protection and High Availability Anil Desai.

Slides:



Advertisements
Similar presentations
Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
Advertisements

1EMC CONFIDENTIAL—INTERNAL USE ONLY Overview of SQL Server 2012 High Availability and Disaster Recovery (HADR) Wei Fan Technical Partner Management – Microsoft.
Oracle Data Guard Ensuring Disaster Recovery for Enterprise Data
Module 7 Restoring SQL Server 2008 R2 Databases. Module Overview Understanding the Restore Process Restoring Databases Working with Point-in-time Recovery.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
SQL Server Basics for non-DBAs Anil Desai. Speaker Information Anil Desai –Independent consultant (Austin, TX) –Author of several SQL Server books –Instructor,
Anil Desai SQL Saturday #35 (Dallas, TX).  Anil Desai ◦ Independent consultant (Austin, TX) ◦ Author of several SQL Server books ◦ Instructor, “Implementing.
Keith Burns Microsoft UK Mission Critical Database.
Virtual techdays INDIA │ September 2011 High Availability - A Story from Past to Future Balmukund Lakhani │ Technical Lead – SQL Support, Microsoft.
Microsoft SQL Server Administration for SAP Database Backup and Restore.
Module 5 Understanding SQL Server 2008 R2 Recovery Models.
National Manager Database Services
Introduction to Oracle Backup and Recovery
Session 7 Creating and Managing Databases. RDBMS and Data Management/ Session 7/2 of 27 Session Objectives Describe the system and user-defined databases.
Chapter 2 Administrating DB Engine. Database Engine  The Database Engine is the core service for storing, processing, and securing data.  It provides.
Building Highly Available Systems with SQL Server™ 2005 Vineet Gupta Evangelist – Data and Integration Microsoft Corp.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Implementing Database Snapshot & Database Mirroring in SQL Server 2005 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft.
High-Availability Methods Lesson 25. Skills Matrix.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
1 Chapter Overview Creating a User Database Setting Database Options Managing User Database Size Placing Database Files on Multiple Disks.
It is one of the techniques to create a stand by server. Introduced in SQL 2000,enhanced in It is a High Availability as well as Disaster recovery.
15 Copyright © 2005, Oracle. All rights reserved. Performing Database Backups.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Maintaining a Mirrored Database Tips and Tricks by Paul G. Hiles.
DATABASE MIRRORING  Mirroring is mainly implemented for increasing the database availability.  Is configured on a Database level.  Mainly involves two.
Rajib Kundu Agenda Definitions Failover Cluster Database Snapshots Log shipping Database Mirroring.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
Module 10: Maintaining High-Availability. Overview Introduction to Availability Increasing Availability Using Failover Clustering Standby Servers and.
Overview of high availability in Microsoft SQL Server Szymon Wójcik.
Module 13 Implementing Business Continuity. Module Overview Protecting and Recovering Content Working with Backup and Restore for Disaster Recovery Implementing.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
High Availability in DB2 Nishant Sinha
Oracle DBAs Deploying Highly Available SQL Server Systems
Connect with life Vinod Kumar Technology Evangelist - Microsoft
Enhancing Scalability and Availability of the Microsoft Application Platform Damir Bersinic Ruth Morton IT Pro Advisor Microsoft Canada
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
Course Topics Administering SQL Server 2012 Jump Start 01 | Install and Configure SQL Server04 | Manage Data 02 | Maintain Instances and Databases05 |
Data Disaster Recovery Planning Greg Fibiger 1/7/2016.
Danny Tambs – Senior Consultant Microsoft.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Your Data Any Place, Any Time Always On Technologies.
1 Chapter Overview Using Standby Servers Using Failover Clustering.
Praveen Srivatsa Director| AstrhaSoft Consulting blogs.asthrasoft.com/praveens |
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
What HADR Option(s) Are Right For You?. Where’s The AlwaysOn?
SQL Server High Availability Introduction to SQL Server high availability solutions.
Windows Server Failover Clustering (WSFC) with SQL Server.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
FUN WITH AVAILABILITY GROUPS Christopher Wolff SQL Server Database Engineer, Xero.
SQL Database Management
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
Partial Database Availability
Database Administration
Database Mirroring with SQL Server
Maintaining Windows Server 2008 File Services
ALWAYSON AVAILABILITY GROUPS
Navigating the options for Data Redundancy
Disaster Recovery Where to Begin
AlwaysOn Mirroring, Clustering
Maximum Availability Architecture Enterprise Technology Centre.
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
SQL Server High Availability Amit Vaid.
Your Data Any Place, Any Time
SYED SAJID WASIM SQL SERVER ALWAYS ON Step by Step.
AlwaysOn Availability Groups
Backup & Recovery.
Designing Database Solutions for SQL Server
Presentation transcript:

SQL Server Data Protection and High Availability Anil Desai

Speaker Information Anil Desai –Independent consultant (Austin, TX) –Author of several SQL Server books –Instructor, “Implementing and Managing SQL Server 2005” (Keystone Learning) –Info: or

Overview and Agenda Overview of Data Protection and HA Backup and Recovery Log-Shipping Database Mirroring Database Snapshots Clustering Overview

Data Protection and HA Goals Minimize data loss Minimize costs Minimize performance overhead Simplify implementation and administration Allow fast fail-over Implementing transparency for end-users

Implementing Backups Features –Minimal performance hit –Flexible options Purposes –Protecting against user error –Protecting against hardware failures –Disaster Recovery, Security, Archival –Regulatory Compliance

Planning for Backups Backup plan should be based on recovery requirements Factors: –Type of data / workload –Acceptable downtime –Acceptable data loss –Performance requirements –Administration overhead (manageability)

Database Recovery Models Balances performance vs. recoverability Recovery Model Options: –Full All transactions are logged –Simple Does not allow for point-in-time recovery Automatic log truncation –Bulk-Logged Bulk operations are not logged

Backup Types Full Backups Differential Backups Transaction Log Backups Other Types: –Copy-Only Backups –Partial Backups –File Backups

Restore / Recovery Process Restore order: 1.Full backup 2.Latest differential (if any) 3.Chain of transaction log backups NO RECOVERY / WITH RECOVERY

Restore / Recovery Example

Restore vs. Recovery Restore –Copies data from backup media –Applies committed and uncommitted transactions (“roll forward”) –Uses NORECOVERY clause (DB = offline) Recovery –Rolls backup uncommitted transactions (“undo”) –Brings database online

Database Restore Options Full database restore –Point-in-Time recovery / STOPAT Marker File restore Page-level restore Partial / Piece-meal restore (Ent. Ed.) –Restore read-write filegroups (PARTIAL) –Bring database online –Restore read-only filegroups

Backup and Recovery Commands Transact-SQL –BACKUP DATABASE –RESTORE DATABASE / RESTORE LOG Database Maintenance Plan Wizard Copy Database Wizard Attach / Detach databases

Backup and Recovery Notes Backup history is stored in msdb Can use media sets and families Security: May need to recreate logins, certificates, etc. Can backup to UNC shares

Log Shipping Maintains a “warm” standby server –Update interval can be configured –Requires Full or bulk-logged recovery model Relies on backup/recovery operations No special hardware requirements Can have multiple secondary databases Roles: –Primary, Secondary, Monitor

Log Shipping Details Continuous restore of transaction logs Process: –Transaction log backup is created on the primary server –File is copied to the secondary server Log is restored on the secondary server –NORECOVERY (database remains offline) –STANDBY (database is read-only)

Implementing Log Shipping

Log Shipping Tool Setup from SQL Server Mgmt. Studio: –Prepare the Primary Database –Implement a Monitoring Server –Initialize the Secondary Database –Copy Files –Security Settings / Proxy Accounts –Can schedule the frequency of backup and recovery operations –Create all required jobs

Managing Log Shipping Avoid manual backups (except copy-only) Log-Shipping information (msdb database) –Primary Server (backup details) –Secondary Server (copy and restore details) –Monitor Server (info about both) Transaction Log Shipping Report (SSMS)

Performing a Fail-Over Steps for failing-over: –Disable all log shipping jobs –Primary Database: Backup and copy transaction log files (if possible) –Restore transaction log backups on the secondary server with NORECOVERY Use RECOVERY for last restore –Re-establish log-shipping (optional) Swapping primary and secondary roles –Can be performed by enabling/disabling jobs

Understanding Database Mirroring Maintains a “hot” standby database –Synchronization is managed automatically –Transactions are sent from a Principal to a Mirror database instance Can perform quick fail-over –Can be automatic or manual –Clients are automatically redirected Works at the database level –Multiple mirrored pairs per server are possible

Database Server Roles Principal Database –Active, Read/Write database –Requires the full recovery model Mirror Database –Must be on a separate SQL Server instance –Set in “Restoring” state –Can use snapshots to allow read-only access Witness (optional) –Used for establishing a quorum during automatic failover –Not recommended for High-Protection mode

Database Mirroring Support SQL Server 2005 Standard and Enterprise Ed. –Witness can be SQL Server 2005 Workgroup or Express Editions –For production, should use SP1 or later For SQL Server 2005 RTM: –Must enable Trace flag 1400 –-T1400 startup parameter –SQL Server Configuration Manager  Advanced  Startup Parameters

Database Mirroring Modes Asynchronous (High Performance) –Principal transactions commit without waiting for mirror –Some transactions may be lost Synchronous –Transactions must be committed at mirror –Ensures no data loss –High Protection No Witness server / manual fail-over –High Availability Uses a Witness server; automatic fail-over

Implementing Database Mirroring Database Mirror Pairs are independent –Each set requires own ports –Can use different modes –One server can serve as principal, mirror, and witness for different mirroring pairs Steps: –Back up the Principle database –Restore the database on the Mirror instance with NORECOVERY –Configure Mirroring endpoints and security –Enable Mirroring

Implementing Database Mirroring Configure Database Mirroring Security Wizard –Can include Witness Server –Configures Mirroring Endpoints –Service Accounts SQL Server Management Studio –Allows starting, stopping, and fail-over operations

Database Mirroring Commands ALTER DATABASE can be used to administer database mirroring Setting the Mirroring Mode: –Asynchronous (High Performance): SET SAFETY OFF –Synchronous High Availability: SET SAFETY FULL High Protection: Use SET WITNESS Pausing: SET PARTNER SUSPEND/RESUME Cause fail-over: FAILOVER

Forcing a Fail-Over Should be used in emergencies –Use when mirror is out-of-date –May cause data loss –If Witness is available, it must be able to contact the mirror server ALTER DATABASE … SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS

Monitoring Database Mirroring SQL Server Management Studio –Database Mirroring Monitor System Views / Stored Procedures –Sys.Database_Mirroring –Sys.Database_Mirroring_Endpoints –Sys.DM_DB_Mirroring_Connections –Sp_DbmMonitorResults Other options: –SQL Server Agent Alerts –Windows Event Logs –Windows System Monitor

Database Snapshots Snapshots: –Creates a point-in-time view of a database –Multiple snapshots can be created –Quick to create / Requires minimal disk space –Snapshots are read-only –Databases can be reverted to a snapshot –Stored on same instance as database Can be accessed like a “regular” database

Understanding Snapshots Available in the Enterprise Edition Supports all recovery models Typical Uses –Reporting –Point-in-Time Views / Historical Views –Protecting against user error –Testing Should not be used as a backup or high- availability solution Can be created on a database mirror

Snapshot Architecture Initial snapshot creation –Generates an NTFS Sparse File –File is initially empty Snapshot maintenance –Monitors for changes to data pages –Uses copy-on-write method –Snapshot files will grow based on frequency of data modification

Creating Database Snapshots Creating a new snapshot: CREATE DATABASE ON (NAME = LogicalName, FILENAME = PhysicalFilePath) AS SNAPSHOT OF SourceDatabase Recommendations: –Use a consistent naming scheme –Treat snapshots like read-only databases

Managing Snapshots Dropping snapshots –Deletes sparse files –DROP DATABASE SnapshotName Reverting to a snapshot –Restores a database to the time of the snapshot –Snapshot and primary database will go offline –RESTORE DATABASE DatabaseName FROM DATABASE_SNAPSHOT = SnapshotName

Monitoring Snapshots SQL Server Management Studio –Databases  Database Snapshots System Databases –Sys.Databases –Sys.Database_Files –Sys.Master_Files Viewing File Details –Windows Explorer / DIR command File size vs. “Size on Disk” –fn_VirtualFileStats

Clustering Overview SQL Server Fail-Over Clusters: –Provides automatic fail-over –Multiple nodes that work as a logical unit –Uses a shared-disk configuration Does not protect against disk failures Requirements –Enterprise Ed. and specialized hardware –Distance limitations More difficult to implement and administer

Data Protection and HA Summary Backup and Restore –Standard data protection Log-Shipping –Harder to implement, but more flexible –Manual fail-over Database Mirroring –Easy to implement and manage –Automatic fail-over Clustering –Custom hardware requirements

For More Information Resources from Anil Desai –Web Site ( – –Keystone Learning Course: “Microsoft SQL Server 2005: Implementation and Maintenance (Exam )” –The Rational Guide to Managing Microsoft Virtual Server 2005 –The Rational Guide to Scripting Microsoft Virtual Server 2005