Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in...

Preview:

Citation preview

Tips and Tricks for Successful Database Mirroring Deployments with Microsoft SQL Server Paul Filmalter

PFEMicrosoftDAT313

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Setting the Scene

Witness

Principle Mirror

Setting it updemo

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Improvements in 2008Log Stream Compression

Works with both async and syncGood network, local = minimal/no improvementWill see more improvements with “bad” networks, distanceReduces send queueFunction of the transactions, not the networkTradeoff: CPU hit on principal and mirrorOn by default (Trace Flag 1462 to turn off)

Log Stream CompressionLog Stream Compression

MeasuringDatabase Mirroring: Log Bytes Sent/sec (uncompressed)Database Mirroring: Log Compressed Bytes Sent/secDatabases: Transactions/secSQL Statistics: Batch Requests/secProcessor: % Processor

Log stream compressiondemo

Improvements in 2008Data Page Corruption Recovery

823, 824, 829 error encounteredSQL Server will read partnerGood copy of page will replace bad copy

Recovery from corruption with database mirroring

demo

Improvements in 2008Backup Compression

Enterprise Edition only, but can restore compressed backups on all editionsReduces initialization time

File sizes smallerQuicker copy time

Watch the CPU

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Number of Databases …

10 DBs is a recommendation, not a limitationCustomers ARE doing more than that

Will depend on workloadsI/OThreadsCPUMemory

More headroom with 64-bit

Failover Clustering and Database Mirroring

Compliment each otherInstance vs. database protectionAge old question: asynchronous or synchronous?Considerations

Most want clustering to be the primary HA feature Challenge: database mirroring failover is generally faster than a cluster failover (Timeout)

Using a Mirror for Reporting

Done via snapshotsMust be refreshed

Can make the mirror more useful – not just a standbyDownside: licensingGeneral tip: watch I/O use – do not want to impact the mirror if your main goal is availability

Creating snapshots with database mirroring

demo

Using DBM to Upgrade 2005->2008

Minimal downtimeUnconfigure WitnessMust be synchronous (no automatic failover)Use SQL Server 2005 SP2 CU5 (or later)

Upgrading from SQL Server 2005 to 2008 using database mirroring

demo

Gotchas/Tips/Tricks 1

ApplicationWatch transaction sizeFailover Partner in connection string

Make sure you have good networksUse aliases in connection string if using failover partnerRestoring the principal database

Cannot happen while in a mirroring session either from a backup or a snapshot

Gotchas/Tips/Tricks 2

Initial configurationPossibly configure log shipping, then convert to DBM

Transactional replication stops if DBM pausedPrevents Subscriber from getting ahead of mirrorTrace flag 1448 (2008) – overrides behavior2005 – KB937041 (hotfix for SP2, then TF)

T-log growth and backup affected

Gotchas/Tips/Tricks 3

Disk configurationNeed good I/O performance; can be a bottleneckI/O on mirror may be higher than principal (by design)

Trace Flag 3499 to alter I/O behavior (DO NOT USE UNLESS TEST THOROUGHLY) – will delay failover

Logged operations and maintenance – effect on principal’s log

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Summary

Database mirroring can improve a database’s availability with minimal to no loss of dataDatabase mirroring has improved with SQL Server 2008

Log stream compression can be helpfulDo proper monitoringNeed good configurations and hardware (esp. network and disk)

question & answer

South African SQL Server Usergroup

Meet monthly, 3rd Tuesday evening at Microsoft’s Offices in BryanstonCurrent leads: Paul Filmalter and Gail Shaw

www.microsoft.com/teched

International Content & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources Tech·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.za

Additional Resources

External ResourcesSQL Server Customer Advisory Team blog2005 Database Mirroring Best Practices and Performance Considerations whitepaperConfiguring Database Mirroring with SQL Server 2008 PowerShellConfiguring SharePoint and Database Mirroring whitepaperDatabase Mirroring and Log shipping Working Together whitepaperImplementing Application Failover with Database Mirroring whitepaperSQL Server Replication: Providing High Availability using Database Mirroring whitepaper

SQL Server 2008 Business Value Calculator: www.moresqlserver.com

SQL Server Community Resources

Become a FREE PASS Member: www.sqlpass.org/RegisterforSQLPASS.aspxLearn more about the PASS organization www.sqlpass.org/

Additional Community ResourcesSQL Server Community Center www.microsoft.com/sqlserver/2008/en/us/community-center.aspxTechNet Community for IT Professionalshttp://technet.microsoft.com/en-us/sqlserver/bb671048.aspxDeveloper Center http://msdn.microsoft.com/en-us/sqlserver/bb671064.aspxSQL Server 2008 Learning Portalhttp://www.microsoft.com/learning/sql/2008/default.mspx

• Connect: Local Chapters, Special Interest Groups, Online Community• Share: PASSPort Social Networking, Community Connection Event• Learn: PASS Summit Annual Conference, Technical Articles, Webcasts

• More about the PASS organization www.sqlpass.org/

The Professional Association for SQL Server (PASS) is an independent, not-for-profit association, dedicated to supporting, educating, and promoting the Microsoft SQL Server community.

Complete a session evaluation and enter to win!

10 pairs of MP3 sunglasses to be won

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Recommended