23
RockSolid SQL Server Management

Sql Server High Availability & DR Technologies

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

Page 1: Sql Server High Availability & DR Technologies

RockSolid SQL Server Management

Page 2: Sql Server High Availability & DR Technologies

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.

Page 3: Sql Server High Availability & DR Technologies

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

Page 4: Sql Server High Availability & DR Technologies

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

Page 5: Sql Server High Availability & DR Technologies

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

Page 6: Sql Server High Availability & DR Technologies

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?

Page 7: Sql Server High Availability & DR Technologies

Demo: Log Shipping Configuration Review

Page 8: Sql Server High Availability & DR Technologies

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

Page 9: Sql Server High Availability & DR Technologies

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

Page 10: Sql Server High Availability & DR Technologies

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

Page 11: Sql Server High Availability & DR Technologies

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

Page 12: Sql Server High Availability & DR Technologies

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

Page 13: Sql Server High Availability & DR Technologies

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

Page 14: Sql Server High Availability & DR Technologies

Demo: Database Mirroring Failover & Snapshot

Page 15: Sql Server High Availability & DR Technologies

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

Page 16: Sql Server High Availability & DR Technologies

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

Page 17: Sql Server High Availability & DR Technologies

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

Page 18: Sql Server High Availability & DR Technologies

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

Page 19: Sql Server High Availability & DR Technologies

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

Page 20: Sql Server High Availability & DR Technologies

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

Page 21: Sql Server High Availability & DR Technologies

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

Page 22: Sql Server High Availability & DR Technologies

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

Page 23: Sql Server High Availability & DR Technologies

Final Q & A