Upload
rocksolid-sql
View
720
Download
2
Tags:
Embed Size (px)
DESCRIPTION
There are many different disaster recovery and high availability options for SQL Server. Making decisions on the most effective DR & HA strategies can be complex, especially when you throw into the mix various SAN and network topologies. This presentation is focused on the management and operational decisions that are made when planning DR and HA for production SQL Server environments. It is targeted towards Senior DBAs, CIO, IT Manager, database services managers. Topics include: Log Shipping Database Mirroring Always On High Availability groups Replication Clustering Licensing
Citation preview
RockSolid SQL Server Management
DisclaimerWe recommend that you seek further professional advice before deciding on the suitability of any recommendations in this presentation for you. While all care is taken to ensure information is accurate, we do not make any guarantees about the suitability of advice and advice given may contain technical inaccuracies or topographical errors. The answers provided are our own opinions and may differ from advice provided by Microsoft and/or other SQL Server professionals. In no event shall we be liable for any special, incidental, indirect, economic or consequential damages or for loss of profit, revenue or data howsoever caused, regardless of whether we could foresee or was advised of the possibility or likelihood of such loss or damage.
Disaster Recovery & High Availability Technologies (SQL Server 2008, 2008 R2 & 2012 Standard & Enterprise)
Contents
Log Shipping Replication Clustering Database Mirroring Always On High Availability groups Leveraging SQL Server 2012 core licensing for High Availability /
DR implementations
Disaster Recovery & High Availability Technologies
What’s the difference between Disaster Recovery & High Availability?
DR Log Shipping Async database mirroring Async AlwaysOn Availability Groups
HA Clustering Sync database mirroring Sync AlwaysOn Availability Groups
Replication
DR - Log Shipping
Performed at database level Logged operations copied from a primary to secondary offsite
database Consists of 3 operations
• Backup TL at source• Copy of TL from source to destination• Restore TL at destination
Prerequisites• Recovery model of FULL/BULK-LOGGED• Create network share for transaction log backups• SQL Server Agent must be running
DR - Log Shipping continued ….
Generally, failover is manual process Configuration options determine data loss
• Backup/restore schedule
Other options• Compress backups?• How long you want to keep backup files?• Secondary db RECOVERING or STANDBY state?
Demo: Log Shipping Configuration Review
Replication
Performed at database level Distribute & replicate data automatically Integrating data from multiple sources Data warehousing & reporting Typical topology - Publisher, Distributor & Subscriber
One-way or bidirectional depending upon type
Replication continued ..
Options Publication type: Snapshot, Transactional & Merge
• Advantages of replication• Multiple sites have copies of data• Separate applications for read/write operations• Increased performance
• Disadvantages of replication• Can be complicated to manage changes• Multiple SQL licenses
HA - Clustering
Performed at an instance level One virtual server name, multiple nodes Shared storage
Best Practices• Server dedicated to SQL Server• Identical servers• Use static IP address • Plan how to deal with risks - SAN failure & DR options
HA – Clustering continued …
Advantages• Patching SQL Server is easier• Eliminate downtime• Logins, jobs, system db’s all failover• Don’t license passive node
Disadvantages• Is generally not a DR solution• Single copy of db• Shared storage issue• Expensive – x 2 servers and shared storage
DR & HA - Database Mirroring
Performed at a database level Principle, Mirror & optional Witness Cannot mirror master, msdb, tempdb or model Apply stream of database log records to db mirror Used for DR (async) & HA (sync)
Prerequisites• FULL RECOVERY• Principal & Mirror require same edition of SQL Server
Options• Supports automatic failover (witness)• Sync OR async
DR & HA - Database Mirroring continued …
Witness Database• It’s role is to determine availability between Principal & Mirror• Used for HA not DR• Ideally, located in a third datacentre
Advantages• Since SQL Server 2008 -
• The principle compresses the transactions before sending to mirror.
• Automatically detects & attempts to recover storage corruption
Limitations• Can’t read mirror – unless using snapshot• Can only fail over one database at a time• Doesn’t copy SQL logins or jobs
Demo: Database Mirroring Failover & Snapshot
AlwaysOn Availability Groups
SQL Server 2012 Next evolution of db mirroring HA+DR solution
Async – forced
Sync – auto failover
SQL2012PROD1Primary Replica
Read-Write
SQL2012PROD2Secondary ReplicaDisallow connections
SQL2012DR1Secondary ReplicaDisallow connections
Melbourne Primary data centre
Windows Server Failover Clusterlicense license
Sydney DR data centre
<---------RockSolid Availability Group----->
Async – forced
Sync – auto failover
AlwaysOn Availability Groups continued ..
Prerequisites• Windows Server Failover Clustering (WSFC) • SQL Server 2012 Enterprise license• Same instance collation• Advise same drive letters
Options• Failover groups contain multiple db’s• Supports up to 5 availability groups• Supports async & sync failover
AlwaysOn Availability Groups continued ..
Replica Mode – Automatic failover (sync - auto) OR High Safety (sync - manual) OR High Performance (async - manual) Connection Mode in Secondary Role – Disallow connections OR Allow only read-intent connections
AlwaysOn Availability Groups continued ..
Advantages• Recovery of corrupt pages are automatically attempted• HA & DR solution• Replicas can be used for reporting & backup operations
Disadvantages• Enterprise feature• No delay in applying transaction log updates if you want that
control
Leveraging SQL Server licensing for High Availability / DR implementations
SQL Server customers can run one supportive passive instance
• The passive server must be truly passive• One secondary passive server is ONLY allowed• When licensing Per Core you must license the highest number
of core licenses even if this is the passive node
Leveraging SQL Server licensing for High Availability / DR implementations
2008 Enterprise
2008 Standard
2008 R2 Enterprise
2008 R2 Standard
2012 Enterprise
2012 Standard
Log Shipping
Yes Yes Yes Yes Yes Yes
Database Mirroring
Yes Yes sync – full safety only
Yes Yes sync – full safety only
Yes Yes sync – full safety only
Always on High Availability
n/a n/a n/a n/a Yes – requires Windows clustering
No
Clustering Yes Yes – 2 node support
Yes Yes – 2 node support
Yes Yes – 2 node support
Leveraging SQL Server licensing for High Availability / DR implementations
Server 1 – ACTIVE
4 x core VM
Server 2 – PASSIVE
4 x core VM
Server 1 – ACTIVE
4 x core VM Server 2 – PASSIVE
4 x core VM
Server 2 – PASSIVE
4 x core VM
4x core licenses required
8x core licenses required
Leveraging SQL Server licensing for High Availability / DR implementations
Server 1 – ACTIVE
4 x core VMServer 2 – PASSIVE
8 x core VM
Server 2 – PASSIVE
4 x core VM
12x core licenses required
8x licenses required as license requirement based on passive server
Final Q & A