+ All Categories
Home > Documents > SQL Server 2005 & High Availability

SQL Server 2005 & High Availability

Date post: 03-Feb-2016
Category:
Upload: indra
View: 31 times
Download: 0 times
Share this document with a friend
Description:
SQL Server 2005 & High Availability. By George Squillace New Horizons of Michigan MCT, MCSE, MCDBA CompTIA A+, Network+ MCITP – Database Administration MCITP – Enterprise Messaging. v2.1. What Does a Database Server Contain ?. System Databases Created Automatically - PowerPoint PPT Presentation
Popular Tags:
26
SQL Server 2005 SQL Server 2005 & High & High Availability Availability By By George Squillace George Squillace New Horizons of New Horizons of Michigan Michigan MCT, MCSE, MCDBA MCT, MCSE, MCDBA CompTIA A+, Network+ CompTIA A+, Network+ MCITP – Database Administration MCITP – Database Administration MCITP – Enterprise Messaging MCITP – Enterprise Messaging v2.1 v2.1
Transcript
Page 1: SQL Server 2005 & High Availability

SQL Server 2005SQL Server 2005& High Availability& High Availability

By By George SquillaceGeorge SquillaceNew Horizons of MichiganNew Horizons of Michigan

MCT, MCSE, MCDBAMCT, MCSE, MCDBACompTIA A+, Network+CompTIA A+, Network+

MCITP – Database AdministrationMCITP – Database AdministrationMCITP – Enterprise MessagingMCITP – Enterprise Messaging

v2.1v2.1

Page 2: SQL Server 2005 & High Availability

What Does a What Does a Database ServerDatabase Server ContainContain??

• System DatabasesSystem Databases• Created AutomaticallyCreated Automatically• Contain the Configuration Contain the Configuration

of the Database Server of the Database Server InstallationInstallation

• User DatabasesUser Databases• Databases that Serve the Databases that Serve the

Purpose of the Database Purpose of the Database Server InstallationServer Installation

Page 3: SQL Server 2005 & High Availability

Description of the Files that Description of the Files that Support a Microsoft SQL Server Support a Microsoft SQL Server 2005 Database2005 Database

• Primary Data FilePrimary Data File• .mdf extension.mdf extension• .ndf extension if I have more than 1 Data .ndf extension if I have more than 1 Data

FileFile• Log FileLog File

• .ldf extension.ldf extension

Page 4: SQL Server 2005 & High Availability

What is a What is a TransactionTransaction??• A Transaction is a Change Made to Data or to A Transaction is a Change Made to Data or to

the Database Systemthe Database System• InsertInsert• UpdateUpdate• DeleteDelete• Creation/Deletion/Alteration of a Defined Object in Creation/Deletion/Alteration of a Defined Object in

the Databasethe Database• SQL Server Ensures that Transactions Complete SQL Server Ensures that Transactions Complete

Successfully or are not Applied Successfully or are not Applied WhatsoeverWhatsoever

Page 5: SQL Server 2005 & High Availability

Description of the Transaction Description of the Transaction Logging ProcessLogging Process1.1. Data Changes Are Made in SQL Data Changes Are Made in SQL

Server Server MemoryMemory FIRST! FIRST!2.2. Periodically Changed Data is Written Periodically Changed Data is Written

SEQUENTIALLY to the Log File SEQUENTIALLY to the Log File (.ldf(.ldf))3.3. Changes in the Log File are Rolled Changes in the Log File are Rolled

Forward into the Database File or Forward into the Database File or Files Files (.mdf(.mdf, possibly , possibly .ndf.ndf files) files)

Page 6: SQL Server 2005 & High Availability

What Does a What Does a DatabaseDatabase ContainContain??• TablesTables

• Rows & ColumnsRows & Columns

• Other Other ObjectsObjects that that are defined:are defined:• ViewsViews• Stored ProceduresStored Procedures• TriggersTriggers• ……other stuffother stuff

Page 7: SQL Server 2005 & High Availability

How Do I Define a How Do I Define a Database?Database?

• DemoDemo creation of a creation of a DatabaseDatabase

• DemoDemo creation of a creation of a TableTable• Insert a Row of DataInsert a Row of Data• Query the TableQuery the Table

Page 8: SQL Server 2005 & High Availability

How Does Someone Interact with a How Does Someone Interact with a SQL Server, Retrieving and Changing SQL Server, Retrieving and Changing

Data?Data?• Description of the Client/Server InteractionDescription of the Client/Server Interaction

• Client Submits Request to Database ServerClient Submits Request to Database Server• Database Server Responds to RequestDatabase Server Responds to Request• Very Different from Interacting with a File-Based Database Very Different from Interacting with a File-Based Database

like Microsoft Accesslike Microsoft Access• Microsoft Microsoft Office ApplicationOffice Application, such as Access, Excel , such as Access, Excel

or Wordor Word• Custom Custom WindowsWindows ApplicationApplication, i.e., an app created , i.e., an app created

with Visual Studio using a programming language with Visual Studio using a programming language like VB .NETlike VB .NET

• Custom Custom Web ApplicationWeb Application through a Web Browser through a Web Browser (ASP Pages)(ASP Pages)

See examples of Windows & Web Applications on Subsequent Slides

Page 9: SQL Server 2005 & High Availability

Example of a Database-Oriented Example of a Database-Oriented Custom Windows ApplicationCustom Windows Application

Page 10: SQL Server 2005 & High Availability

Example of a Example of a Database-OrientedDatabase-Oriented Web ApplicationWeb Application

Page 11: SQL Server 2005 & High Availability

How Many How Many DatabasesDatabases Might a Might a SQL Server Contain?SQL Server Contain?• Insert the Standard Answer Posed to Insert the Standard Answer Posed to

a Consultant…a Consultant…• …”…”It It depends!”depends!”

• One of Our Recent Customers Had One of Our Recent Customers Had Six Clustered SQL Servers Each Six Clustered SQL Servers Each Hosting Around 200 - 260 Databases!Hosting Around 200 - 260 Databases!

Page 12: SQL Server 2005 & High Availability

How Many How Many TablesTables Might a SQL Might a SQL Server Database Contain?Server Database Contain?• Insert the Standard Answer Posed to Insert the Standard Answer Posed to

a Consultant…a Consultant…• …”…”It It depends!”depends!”

• Some of Our Recent Customers Had Some of Our Recent Customers Had Databases of 3,000 And 6,000 Databases of 3,000 And 6,000 Tables!Tables!

Page 13: SQL Server 2005 & High Availability

What is What is AvailabilityAvailability , , What is What is High AvailabilityHigh Availability & Why Do I Care?& Why Do I Care?• AvailabilityAvailability = Whether Or Not = Whether Or Not

Clients/Users Can Connect to a Resource Clients/Users Can Connect to a Resource or Service That They Require. A Resource or Service That They Require. A Resource is Available, or Not.is Available, or Not.

• HighHigh Availability Availability = Building Redundancy = Building Redundancy into a System or Service So As To into a System or Service So As To MAINTAIN AVAILABILITY in the Event of a MAINTAIN AVAILABILITY in the Event of a Certain Failure or FailuresCertain Failure or Failures

Page 14: SQL Server 2005 & High Availability

How is Availability How is Availability Measured?Measured?• One way Availability is Measured is One way Availability is Measured is

According to “the Nines”According to “the Nines”• 99% Available 99% Available • 99.9% Available99.9% Available

• Less than nine hours downtime per yearLess than nine hours downtime per year• 99.99% Available99.99% Available

• Less than 53 minutes downtime per yearLess than 53 minutes downtime per year• 99.999% Available (a.k.a. “Five 9s”)99.999% Available (a.k.a. “Five 9s”)

• Less than six minutes downtime per year, Less than six minutes downtime per year, barelybarely attainableattainable

See the Wikipedia High Availability webpage referenced elsewhere in this presentation.

Page 15: SQL Server 2005 & High Availability

The Trend in the role The Trend in the role SQL Server Database Servers SQL Server Database Servers play is increasingly MISSION play is increasingly MISSION

CRITICALCRITICAL

• SalesSales• ManufacturingManufacturing• Health CareHealth Care• Banking & FinanceBanking & Finance

Page 16: SQL Server 2005 & High Availability

How are Availability & How are Availability & High High Availability Achieved in Availability Achieved in SQL Server?SQL Server?

• Backup & RestoreBackup & Restore• Database CopyDatabase Copy• Failover ClusteringFailover Clustering• ReplicationReplication• Log ShippingLog Shipping• Database Mirroring Database Mirroring

Page 17: SQL Server 2005 & High Availability

Backup & RestoreBackup & Restore• Involves Copying a Database(s) to Tape or Involves Copying a Database(s) to Tape or

Another DiskAnother Disk• StrengthsStrengths

• Portability of BackupPortability of Backup• Can Restore a Backup onto Another ServerCan Restore a Backup onto Another Server

• WeaknessesWeaknesses• Lengthy…Much Potential DowntimeLengthy…Much Potential Downtime• Restore Isn’t AutomatedRestore Isn’t Automated

• Not a Not a HIGHHIGH Availability Solution Availability Solution

Page 18: SQL Server 2005 & High Availability

Database CopyDatabase Copy• Involves Copying a Database(s) to Another Involves Copying a Database(s) to Another

ServerServer• StrengthsStrengths

• Can Copy to a Database in Another LocationCan Copy to a Database in Another Location• WeaknessesWeaknesses

• Configured on a Configured on a Per DatabasePer Database Basis Basis• Doesn’t Protect Against a Complete Doesn’t Protect Against a Complete Site FailureSite Failure

• Not a Not a HIGHHIGH availability Solution availability Solution

Page 19: SQL Server 2005 & High Availability

Diagram Resources Diagram Resources & Web References& Web References

• www.e-Squillace.comwww.e-Squillace.com• /tech/techdiagrams/SQL_High_Availability_Technologies.htm/tech/techdiagrams/SQL_High_Availability_Technologies.htm

• /tech/techreference/sql/tech/techreference/sql

• http://en.wikipedia.org/wiki/High_availabilityhttp://en.wikipedia.org/wiki/High_availability•Description of the “Five 9s”Description of the “Five 9s”

Page 20: SQL Server 2005 & High Availability

Failover ClusteringFailover Clustering

• Configuration Basics…Configuration Basics…• StrengthsStrengths

• Provides Protection Against a Node Failure, Protects the Provides Protection Against a Node Failure, Protects the Entire SQL InstanceEntire SQL Instance

• Automatic Failover SupportedAutomatic Failover Supported• WeaknessesWeaknesses

• Generally Expensive, Requires Specialty HardwareGenerally Expensive, Requires Specialty Hardware• Specialty Hardware RequirementsSpecialty Hardware Requirements• Not Trivial to Configure and ManageNot Trivial to Configure and Manage• Doesn’t Protect Against a Complete Doesn’t Protect Against a Complete Site FailureSite Failure

10.99.99.0/24PRIVATE LAN

External Storage Cabinet or SAN

Q: (Quorum

Resource)

X: (Log Files)W: (Database Files)

Local Operating System(RAID

Protected)

(Optional, boot from

SAN)

192.168.1.0/24Public LAN

IP1 IP2

IP3 IP4

\\SQLClust1 IP5(Portable Failover Cluster Name,

which “sits” on only one node at a time)

\\Srv1(Local OS Name)

\\Srv2(Local OS Name)

Special Host Bus AdapterSpecial Host Bus Adapter

Clients connect to:

Host Bus Adapter Host Bus Adapter

Page 21: SQL Server 2005 & High Availability

Log ShippingLog Shipping

• Configuration Basics…Configuration Basics…• StrengthsStrengths

• Can Ship Logs Across WAN (Wide-Area Network)Can Ship Logs Across WAN (Wide-Area Network)• Protects an Entire DatabaseProtects an Entire Database

• WeaknessesWeaknesses• Configured Configured Per DatabasePer Database• NO AUTOMATIC FAILOVERNO AUTOMATIC FAILOVER

\ \ SQLSrv2 (Same or different subnet,Same or different location)

Made by George SquillaceClient machine

\ \ SQLSrv1

Shared Folder(Stored

locally, or on a

remote share)

Shared Folder(Stored

locally, or on a

remote share)

Schedule 1,Agent Job Backs

up log file on primary database to local or remote

shared folder

Schedule 3,Agent J ob

restores log files to database

Schedule 2,Agent J ob copies

from Shared folder related to the Primary to

destination (local or remote) folder

\ \ SQLSrv3(optional Monitor Server) (Same or different subnet,Same or different location)

\ \ SQLSrv1Client connects originally to:

Page 22: SQL Server 2005 & High Availability

Database Database MirroringMirroring

• Configuration Basics…Configuration Basics…• StrengthsStrengths

• Can Mirror Across WANCan Mirror Across WAN• Automatic Failover, and Nearly Instantaneous, Automatic Failover, and Nearly Instantaneous,

Better than Failover ClusteringBetter than Failover Clustering• Protects an Entire DatabaseProtects an Entire Database

• WeaknessesWeaknesses• Requires Enterprise EditionRequires Enterprise Edition• Must be Configured Must be Configured Per DatabasePer Database

Client machine

\ \ SQLSrv1(Hosts the Principal Database)

(Endpoint: TCP Port 5022)

\ \ SQLSrv1Client connects originally to:

\ \ SQLSrv2(Hosts the Mirrored Database)

(Endpoint: TCP Port 5023)

\ \ SQLSrv3(Witness Server role)

(Endpoint: TCP Port 5024)

Made by George Squillace

May be located on

the same subnet as

Principal or anywhere

TCP/ IP “reachable”

Page 23: SQL Server 2005 & High Availability

ReplicationReplication

• Configuration Basics..Configuration Basics..• PushPush• PullPull

• StrengthsStrengths• Perpetual or on-demand replication of data, local or remotePerpetual or on-demand replication of data, local or remote• Protects (duplicates or merges) the Protects (duplicates or merges) the exactexact portion of the portion of the

database I wantdatabase I want• WeaknessesWeaknesses

• Configured per database, even per tableConfigured per database, even per table• Generally does not protect or duplicate an entire DatabaseGenerally does not protect or duplicate an entire Database

WAN

Client machine

\ \ SQLSrv1(Publisher/Distributor ofSnapshot Publicaton1 andMerge

Publicaton2)

Client machine

\ \ SQLSrv2(SubscriberTo Publicaton1)

\ \ SQLSrv3(SubscriberTo Publicaton2 & Publication3)

HealthCareDBPublication1 Article1 Table1 Table2 View1 TVF1 Article2 Table6Publication2 Article1 Table8

Clinic2DB

Publication2 Article1 Table8

Clinic1DBPublication1 Article1 Table1 Table2 View1 TVF1 Article2 Table6

Client machineClient machine

Publication3 Article1 Table9 Table10 Table11

OLAP_DB

Publication3 Article1 Table9 Table10 Table11

Page 24: SQL Server 2005 & High Availability

Does it Appear Trivial Does it Appear Trivial to Design and Architect to Design and Architect a High Availability Solution?a High Availability Solution?

• Answer = Answer = No!No!• Now what???Now what???

Page 25: SQL Server 2005 & High Availability

Microsoft Course 2788Microsoft Course 2788Designing High Availability Designing High Availability Database Solutions Using SQL Database Solutions Using SQL Server 2005 (3 days)Server 2005 (3 days)• Note: this is not really a hands-on course, Note: this is not really a hands-on course,

it is a it is a designdesign course course(Geo, read p. xv in the 2788 courseware Introduction module)(Geo, read p. xv in the 2788 courseware Introduction module)

• Pay close attention to the pre-requisitesPay close attention to the pre-requisites• This course uses Virtual Server This course uses Virtual Server

as opposed to Virtual PCas opposed to Virtual PC

Page 26: SQL Server 2005 & High Availability

Thank You!Thank You!


Recommended