Download SQL Server High Availability en database mirroring

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
SQL Server High Availability
en Database Mirroring
Peter ter Braake
[email protected]
@pbraake
Agenda
• Overview
• Mirroring
– Theorie
– Demo
• Vragen
Availability
• Data moet beschikbaar zijn op het moment dat
het nodig is.
– Tijdens kantooruren
– 24 / 7 (99.999% uptime?)
• Bescherming tegen hardware failures
– Complete server valt uit
– Netwerk(kaart) valt uit
–…
• Installeren Services Packs, Patches, …
• Bescherming tegen rampen (overstroming, ...)
Availability: AlwaysOn
• Online index operations (Enterprise)
• Online restore operations (Enterprise)
• Online system changes
– Hot Add CPU
– Hot Add Memory
• Redundante hardware
– Meer cpu’s
– RAID
– Dubbel netwerk
Strategieën
• Verschillende High Availability strategieën
mogelijk
– SQL Server features, SAN, virtualisatie, …
• Keuze hangt af van
– Budget
– SLA
• Hoeveel downtime is nog OK?
• Hoeveel data-loss is nog OK?
•…
Technieken vergeleken
• Log shipping (per database)
– Down time
– Data loss
– Goedkoop
• Mirroring (per database)
– +- Down time
– +- Data loss
– +- Goedkoop
• Clustering (instance)
– No Down time
– No Data loss
– Duur
• Replicatie (object)
Availability Groups
• Mirroring 2.0 (?)
• Highlights:
– Zelf groep van databases definieren
– Tot 4 secondaries
– Read-only secondaries
– Backup from secondary
• In vergelijking met andere strategieen:
– +- downtime, +- dataloss, +- duur
Agenda
• Overview
• Mirroring
– Theorie
– Demo
• Vragen
Database mirroring
• Beschikbaar vanaf Standard Edition
– Extra SQL Server voor Mirror database
• Geen licentie nodig als geen productieserver
• Full Recovery model vereist
• 3 mogelijke configuraties:
– High Performance (Enterprise edition)
– High Protection
– High Availability
Mirroring: High Performance
Applicatie
2. Succes
1. Transactie
Principal
Database
2. Transactie
Mirror
(Recovering …)
•Mirror database kan achterlopen: data-loss
•Geen automatic failover
•Nagenoeg geen impact op performance van principal
Mirroring: High Protection
Applicatie
4. Succes
1. Transactie
Principal
Database
2. Transactie
3. Succes
Mirror
(Recovering …)
•Mirror database exacte kopie van principal: gegarandeerd
geen data-loss
•Geen automatic failover
•Wel impact op performance van principal
Mirroring: High Availability
Applicatie
4. Succes
1. Transactie
Principal
Database
2. Transactie
3. Succes
Quorum
Witness
(Server)
Mirror
(Recovering …)
•Automatic
database failover
•Automatic client
failover met SQL
native client
principle loss
Mirroring
DEMO
Opzetten mirroring
• Maak mirroring endpoints op alle servers
– SSMS: database properties, Mirroring
– T-SQL:
CREATE ENDPOINT [Mirroring]
AS TCP (LISTENER_PORT = 5022)
FOR DATA_MIRRORING (ROLE = PARTNER)
• Gebruik Full recovery model
• Restore Full database backup op Mirror server
(with norecovery)
– Denk aan server level objects (logins, linked servers, ...)
Starten mirroring
• Op mirror server:
– ALTER DATABASE AdvWorks SET PARTNER =
N'tcp://SQL2008SERVER:5022'
• Op principal server:
– ALTER DATABASE AdvWorks SET WITNESS =
N'tcp://SQL2008SERVER:5024'
– ALTER DATABASE AdvWorks SET PARTNER =
N'tcp://SQL2008SERVER:5023'
• Wel / geen high performance
– ALTER DATABASE AdvWorks SET SAFETY ON
Monitor mirroring
• SSMS mirroring monitor
– Configure tresholds
• Performance counters
– http://www.sqlskills.com/BLOGS/PAUL/post/SQLServer-2008-New-Performance-Counters-forDatabase-Mirroring.aspx
• DMO’s
– sys.dm_db_mirroring_connections
Failover
• Automatisch in geval van Quorum
• High protection:
ALTER DATABASE AdvWorks
SET PARTNER FAILOVER
• High performance:
ALTER DATABASE AdvWorks
SET PARTNER
FORCE_SERVICE_ALLOW_DATA_LOSS
Denk aan:
• Amount of RAM available on the principal and mirror
servers (RAM).
• Processing power of the principal and mirror servers
(CPU).
• Bandwidth available for the I/O subsystem on the
principal and mirror servers
• Network bandwidth between the two servers.
• Volume of transactions on the principal database that
generate transaction log records (i.e. transactions that
change the database in any way).
• See: http://support.microsoft.com/kb/2001270
Agenda
• Overview
• Mirroring
– Theorie
– Demo
• Vragen
VRAGEN ???
Peter ter Braake
[email protected]
@pbraake
BEDANKT !!!
Peter ter Braake
[email protected]
VERGEET NIET:
• DENNY CHERRY – CLUSTERING (NA LUNCH)
• ROBERT HARTSKEERL – ALWAYSON 2012 (LAATSTE
SESSIE)