67
Copyright 2009 all rights reserved Copyright 2009 all rights reserved 1 1 USA & France Database Mirroring Database Mirroring Database Snapshots Database Snapshots SQL Server 2008 SQL Server 2008 Migrating to 2008 Migrating to 2008 Benchmarks 2005 vs 2008 Benchmarks 2005 vs 2008 Benchmarking 2008 on SSD Benchmarking 2008 on SSD

SQL Server 2008 Migration Workshop 04/29/2009

Embed Size (px)

DESCRIPTION

Full blown of useful and highly technical information on SQL Server 2005 and 2008 High Availabilty features.Included benchmarks results on: SQL Server 2005 vs. 2008 and Conventional vs. Solid State Devices.

Citation preview

Page 1: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

11

USA & France

Database MirroringDatabase MirroringDatabase SnapshotsDatabase Snapshots

SQL Server 2008SQL Server 2008

Migrating to 2008Migrating to 2008Benchmarks 2005 vs 2008Benchmarks 2005 vs 2008

Benchmarking 2008 on SSD Benchmarking 2008 on SSD

Page 2: SQL Server 2008 Migration Workshop 04/29/2009

AgendaAgenda

�� Database Mirroring Database Mirroring –– SQL Server 2008SQL Server 2008

�� Database Mirroring 2005 vs 2008 Database Mirroring 2005 vs 2008 benchmarkbenchmark

�� Database Mirroring 2008 SSD Database Mirroring 2008 SSD benchmarkbenchmark

�� Database Snapshots 2008 Database Snapshots 2008 (we might get to it)(we might get to it)

�� SQL Performance & Tuning Tool (SQL Shot)SQL Performance & Tuning Tool (SQL Shot)

Page 3: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

33

Paul BertucciPaul Bertucci�� Founder Database ArchitechsFounder Database Architechs�� Former Chief Data Architect Former Chief Data Architect –– Veritas & SymantecVeritas & Symantec�� Currently Chief Architect Currently Chief Architect -- AutodeskAutodesk�� Author of SQL Server 2000, 2005 & 2008 Unleashed! Author of SQL Server 2000, 2005 & 2008 Unleashed! �� CoCo--Author of ADO.NET in 24 hours Author of ADO.NET in 24 hours �� Author MS SQL Server High AvailabilityAuthor MS SQL Server High Availability�� Author Sybase Performance & TuningAuthor Sybase Performance & Tuning�� Author Sybase Physical DB DesignAuthor Sybase Physical DB Design�� Veritas SQL Server Performance Series Veritas SQL Server Performance Series

[email protected]@dbarchitechs.com

Thierry GerardinThierry Gerardin•• Managing Principal Managing Principal -- Database ArchitechsDatabase Architechs

-- Management, Research and Development, DB Design and P&T for Management, Research and Development, DB Design and P&T for MS SQL Server, Sybase and OracleMS SQL Server, Sybase and Oracle

•• European focus until recently/company growth leader European focus until recently/company growth leader –– multiple yearsmultiple years•• Expanding DB ARCH consulting practices to USA and AsiaExpanding DB ARCH consulting practices to USA and Asia•• Sybase P&T and DBA Certified ProfessionalSybase P&T and DBA Certified Professional•• Contributor to SQL Server 2005 Unleashed!Contributor to SQL Server 2005 Unleashed!

[email protected]@dbarchitechs.com

Database ArchitechsDatabase ArchitechsPrincipals

Page 4: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

44

Database ArchitechsDatabase ArchitechsPrimary ServicesPrimary Services

Database Design

Data Analysis & Modeling

Data Architecture

Performance &Tuning

High Availability

Master Data Management

Distributed Data & Data Replication

Business Intelligence &Data Delivery

Platforms

Database Education& Training

Page 5: SQL Server 2008 Migration Workshop 04/29/2009

Past and CurrentPast and CurrentIntel Applied MaterialsCisco Apple ComputersCharles Schwab PG&EAplia Thomson LearningAGIS SybaseVeritas Symantec CorporationHonda Motors Nissan MotorsToshiba Computers Breg InternationalJuniper Networks CSAASafeway Stores Federal ExpressWells Fargo Bank of AmericaRobert Half Merrill LynchMetalinc many others….

Customers

Page 6: SQL Server 2008 Migration Workshop 04/29/2009

Database Mirroring?Database Mirroring?

A “complete” copy of a database that is created and maintained with as up to the second completenessthat is possible � a mirror image.

Adventure Works DB = Adventure

Works DB

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

66

What’s new or improved?� Compression in log transactions across topology� Various other performance enhancements� 3 years of production execution success!

Page 7: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

77

SQL Server 2008

“Source”

CallOne DB

CallOne DB

SQL Server 2008

SecondaryServer

“Destination”

translog

\Backup\CallOne_tlog_200405141120.TRN

TxnLogbackupsPrimary

Server

TxnLog Copies

\LogShare\CallOne_tlog_200405141120.TRN TxnLog Restores

MSDB DB

SQL Server 2008

MonitorServer

“Monitor”

Last

log

ship

ped

Del

ay A

nsw

er

Delay between logs loaded

Delay Answer

Log ShippingLog Shipping

Don’t build on this, it is being deprecated !

Page 8: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

88

DB DB MirroringMirroring

MSDB DB

SQL Server 2008

SQL Server xyz

WitnessServer

Adventure Works DB

SQL Server 2008

Mirror Server

translog

PrincipalServer

translog

Adventure Works DB

Network

Client Client ClientClient

B

C

A

DD

Page 9: SQL Server 2008 Migration Workshop 04/29/2009

CopyCopy--onon--write Technologywrite TechnologyThe new “copy-on-write” technology that Microsoft has created, is at the core of the database mirroring capability. A transaction from a client connection to the principal server (arrow label A) is written to the adventure works database (label D). Once the transaction is written to the principal servers transaction log, it is immediately copied (arrow label B) and written to the Mirror Server (also labeled D). When this physical log record is written to the mirror server, it sends back an acknowledgement (arrow label C) to the principal of its write success. This is the “copy-on-write” technology. The end result is that the mirror server is in the exact same state as the principal server (when the physical log record has been successfully written on the mirror side).

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

99

Page 10: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring TermsDB Mirroring TermsThe Principal database server - is the source of the mirroring. You can mirror one or more databases on a single SQL Server instance to another SQL Server instance. You cannot mirror a database on one SQL Server instance to itself (the same SQL Server instance).

The Mirror database server - will be the recipient of the mirroring from the principal database server. This mirrored database will be kept in a hot standby mode and cannot be used directly in any way. In fact, once you have configured database mirroring, this database will show its status as in continuous “restore mode”.

The Witness database server - is used when you want to be continuously checking to see if any failures have occurred to the primary database server and to help make the decision to failover to the mirror database server. It is optional, but a sound way to configure database mirroring. If you do not identify a witness server, the principal and mirror are left on their own to decide to fail-over or not.

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1010

Page 11: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring ModesDB Mirroring ModesHigh-availability mode, High-protection mode, and H igh-performance mode.

Synchronous operation - a committed transaction will be committed (written) onboth partners of the database mirroring pair. This obviously adds some latency costto a complete transaction (it is across two servers). High-availability mode and High-protection mode use synchronous operations (termed High safety)

Asynchronous operation - transactions commit without waiting for the mirror serverto write the log to disk. This can speed up performance significantly. High-performance mode uses asynchronous operations.

Whether the operations are asynchronous or synchronous depends on the “transaction safety” setting. This is controlled by the SAFETY option when configuring with Transact-SQL commands (Set to FULL for synchronous operations, set to OFF for asynchronous operations).

[you must sacrifice levels of protection for performance]

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1111

Page 12: SQL Server 2008 Migration Workshop 04/29/2009

FailFail--over methodsover methodsAutomatic failover - is enabled with a three-server configuration; a principal, a mirror, and a witness server. Synchronous operations are required and the mirror database must already be synchronized (in sync with the transactions as they are being written to the principal). Role switching is done automatically. This is for high-availabilit y mode.

Manual failover - is needed when there is no witness server and is also doing synchronous operations. The principal and the mirror are connected to each other and the mirror database must already be synchronized. Role switching is done manually. This is for high-protection mode.

Forced Service - in the case where there is a mirror server available, but it might not be synchronized. It can be forced to take over when the principal server has failed. This will possibly have data loss, since the transactions were not synchronized. This is for either high-protection or high-performance mode.

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1212

Page 13: SQL Server 2008 Migration Workshop 04/29/2009

RuleRule--ofof--ThumbThumb

• If you need to increase the availability of the database layer• If you need to have automatic data protection (redundant storage of data)• If you need to decrease the downtime that would normally be required to

do upgrades

You should use database mirroring:

And very often:• If you need to off load reporting (periodic data snapshots) without impacting the transactional system use database mirroring with database snapshots.• Combo Needs: If you need data distribution, high availability and high data resiliency - use data replication with database mirroring.

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1313

Page 14: SQL Server 2008 Migration Workshop 04/29/2009

Cannot be used with:Cannot be used with:

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1414

Database Mirroring cannot be used for any of SQL Server’s internal databases � TempDB, Master DB, MSDB, or Model DB.

Database Mirroring is NOT supported in SQL Server Workgroup Edition or Express Edition. However, these server editions could be used as Witness servers.

You cannot have database mirroring for databases enabled with FILESTREAM storage.

Page 15: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1515

Example Example ConfiguratioConfiguratio

nn

MSDB DB

SQL Server 2008

SQL Server 2008

WitnessServer

Adventure Works DB

SQL Server 2008

Mirror Server

translog

PrincipalServer

translog

Adventure Works DB

Instance: SQL08DE01 Instance: SQL08DE02

Instance: SQL08DE03

Endpoint name: “EndPoint4DBMirroring1430” Endpoint name: “EndPoint4DBMirroring1440”

Endpoint name: “EndPoint4DBMirroring1450”

TCP: Listener_Port: 1430 TCP: Listener_Port: 1440

TCP: Listener_Port: 1450

Role: PARTNER Role: PARTNER

Role: WITNESS

Page 16: SQL Server 2008 Migration Workshop 04/29/2009

11

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1616

Page 17: SQL Server 2008 Migration Workshop 04/29/2009

22

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1717

Page 18: SQL Server 2008 Migration Workshop 04/29/2009

33

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1818

Page 19: SQL Server 2008 Migration Workshop 04/29/2009

Creating EndpointsCreating Endpoints-- create endpoint for PRINCIPAL server --CREATE ENDPOINT [EndPoint4DBMirroring1430]

STATE=STARTEDAS TCP (LISTENER_PORT = 1430, LISTENER_IP = ALL)FOR DATA_MIRRORING (ROLE = PARTNER,

AUTHENTICATION = WINDOWS NEGOTIATE, ENCRYPTION = REQUIRED ALGORITHM RC4)

01/05/2009 13:17:23,spid55,Unknown,The Database Mirroring protocol transport is now listening for connections.01/05/2009 13:17:23,spid55,Unknown,Server is listening on [ 'any' <ipv4> 1430].

SQL Server Log entry

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

1919

Page 20: SQL Server 2008 Migration Workshop 04/29/2009

Creating EndpointsCreating Endpoints-- create endpoint for MIRROR server --CREATE ENDPOINT [EndPoint4DBMirroring1440]

STATE=STARTEDAS TCP (LISTENER_PORT = 1440, LISTENER_IP = ALL)FOR DATA_MIRRORING (ROLE = PARTNER,

AUTHENTICATION = WINDOWS NEGOTIATE, ENCRYPTION = REQUIRED ALGORITHM RC4)

-- create endpoint for WITNESS server --CREATE ENDPOINT [EndPoint4DBMirroring1450]

STATE=STARTEDAS TCP (LISTENER_PORT = 1450, LISTENER_IP = ALL)FOR DATA_MIRRORING (ROLE = WITNESS,

AUTHENTICATION = WINDOWS NEGOTIATE, ENCRYPTION = REQUIRED ALGORITHM RC4)

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2020

Page 21: SQL Server 2008 Migration Workshop 04/29/2009

Backup PrincipalBackup Principal�� BACKUP DATABASE [AdventureWorks] BACKUP DATABASE [AdventureWorks]

�� TO DISK = N'C:TO DISK = N'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE01MSSQL10.SQL08DE01\\MSSQLMSSQL\\BackupBackup\\AdventureWorks4Mirror.bak'AdventureWorks4Mirror.bak'

�� WITH FORMATWITH FORMAT

�� GOGO

�� ---- Processed 17672 pages for database 'AdventureWorks', file 'AdveProcessed 17672 pages for database 'AdventureWorks', file 'AdventureWorks_Data' on file 1.ntureWorks_Data' on file 1.

�� ---- Processed 3 pages for database 'AdventureWorks', file 'AdventurProcessed 3 pages for database 'AdventureWorks', file 'AdventureWorks_Log' on file 1.eWorks_Log' on file 1.

�� ---- BACKUP DATABASE successfully processed 17675 pages in 7.718 secBACKUP DATABASE successfully processed 17675 pages in 7.718 seconds (17.890 MB/sec).onds (17.890 MB/sec).

�� BACKUP LOG [AdventureWorks] TO BACKUP LOG [AdventureWorks] TO

�� DISK = N'C:DISK = N'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE01MSSQL10.SQL08DE01\\MSSQLMSSQL\\BackupBackup\\AdventureWorks4MirrorLog.bak' AdventureWorks4MirrorLog.bak'

�� GOGO

�� ---- Processed 1849 pages for database 'AdventureWorks', file 'AdvenProcessed 1849 pages for database 'AdventureWorks', file 'AdventureWorks_Log' on file 1.tureWorks_Log' on file 1.

�� ---- BACKUP LOG successfully processed 1849 pages in 0.862 seconds (BACKUP LOG successfully processed 1849 pages in 0.862 seconds (16.757 MB/sec).16.757 MB/sec).

Page 22: SQL Server 2008 Migration Workshop 04/29/2009

Restore to MirrorRestore to Mirror�� RESTORE FILELISTONLY RESTORE FILELISTONLY

�� FROM DISK = N'C:FROM DISK = N'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE01MSSQL10.SQL08DE01\\MSSQLMSSQL\\BackupBackup\\AdventureWorks4Mirror.bak'AdventureWorks4Mirror.bak'

�� RESTORE DATABASE AdventureWorks RESTORE DATABASE AdventureWorks

�� FROM DISK = N'C:FROM DISK = N'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE01MSSQL10.SQL08DE01\\MSSQLMSSQL\\BackupBackup\\AdventureWorks4Mirror.bak'AdventureWorks4Mirror.bak'

�� WITH NORECOVERY, WITH NORECOVERY,

�� MOVE 'AdventureWorks_Data' TO 'C:MOVE 'AdventureWorks_Data' TO 'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE02MSSQL10.SQL08DE02\\MSSQLMSSQL\\DATADATA\\AdventureWorks_Data.mdf',AdventureWorks_Data.mdf',

�� MOVE 'AdventureWorks_Log' TO 'C:MOVE 'AdventureWorks_Log' TO 'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE02MSSQL10.SQL08DE02\\MSSQLMSSQL\\DATADATA\\AdventureWorks_Log.ldf'AdventureWorks_Log.ldf'

�� GOGO�� ---- Processed 17672 pages for database 'AdventureWorks', file 'AdveProcessed 17672 pages for database 'AdventureWorks', file 'AdventureWorks_Data' on file 1.ntureWorks_Data' on file 1.

�� ---- Processed 3 pages for database 'AdventureWorks', file 'AdventurProcessed 3 pages for database 'AdventureWorks', file 'AdventureWorks_Log' on file 1.eWorks_Log' on file 1.

�� ---- RESTORE DATABASE successfully processed 17675 pages in 6.716 seRESTORE DATABASE successfully processed 17675 pages in 6.716 seconds (20.560 MB/sec).conds (20.560 MB/sec).

�� RESTORE LOG AdventureWorksRESTORE LOG AdventureWorks

�� FROM DISK = N'C:FROM DISK = N'C:\\Program FilesProgram Files\\Microsoft SQL Microsoft SQL ServerServer\\MSSQL10.SQL08DE01MSSQL10.SQL08DE01\\MSSQLMSSQL\\BackupBackup\\AdventureWorks4MirrorLog.bak'AdventureWorks4MirrorLog.bak'

�� WITH FILE = 1, NORECOVERY;WITH FILE = 1, NORECOVERY;

�� GOGO�� ---- Processed 0 pages for database 'AdventureWorks', file 'AdventurProcessed 0 pages for database 'AdventureWorks', file 'AdventureWorks_Data' on file 1.eWorks_Data' on file 1.

�� ---- Processed 1849 pages for database 'AdventureWorks', file 'AdvenProcessed 1849 pages for database 'AdventureWorks', file 'AdventureWorks_Log' on file 1.tureWorks_Log' on file 1.

�� ---- RESTORE LOG successfully processed 1849 pages in 1.083 seconds RESTORE LOG successfully processed 1849 pages in 1.083 seconds (13.338 MB/sec).(13.338 MB/sec).

Page 23: SQL Server 2008 Migration Workshop 04/29/2009

77

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2323

Page 24: SQL Server 2008 Migration Workshop 04/29/2009

99

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2424

Page 25: SQL Server 2008 Migration Workshop 04/29/2009

1111

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2525

Page 26: SQL Server 2008 Migration Workshop 04/29/2009

1212

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2626

Page 27: SQL Server 2008 Migration Workshop 04/29/2009

1313

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2727

Page 28: SQL Server 2008 Migration Workshop 04/29/2009

1414

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2828

Page 29: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

2929

1010

MSDB DB

SQL Server 2008

SQL Server 2008

WitnessServer

AdventureWorksDB

SQL Server 2008

Mirror Server

translog

PrincipalServer

Networ

k

Networ

k

Database Snapshot

Repor

ting

Users

AdventureWorksDB

translogDatabase Snapshot

If th

is s

erve

r no

de

beco

mes

the

mirr

or.

Page 30: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2005 DB Mirroring 2005 versusversus

DB Mirroring 2008DB Mirroring 2008BenchmarksBenchmarks

Page 31: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

3131

Example Example ConfiguratioConfiguratio

nn

MSDB DB

SQL Server 2008

SQL Server 2008

WitnessServer

Adventure Works DB

SQL Server 2008

Mirror Server

translog

PrincipalServer

translog

Adventure Works DB

Instance: SQL08DE01 Instance: SQL08DE02

Instance: SQL08DE03

Endpoint name: “EndPoint4DBMirroring1430” Endpoint name: “EndPoint4DBMirroring1440”

Endpoint name: “EndPoint4DBMirroring1450”

TCP: Listener_Port: 1430 TCP: Listener_Port: 1440

TCP: Listener_Port: 1450

Role: PARTNER Role: PARTNER

Role: WITNESS

Page 32: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2005 BenchmarksDB Mirroring 2005 Benchmarks

Send Rate

Repl_rows stored procedure 9999999

Page 33: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 BenchmarksDB Mirroring 2008 Benchmarks

Send Rate

41% More

Page 34: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2005 BenchmarksDB Mirroring 2005 Benchmarks

Restore Rate

Page 35: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 BenchmarksDB Mirroring 2008 Benchmarks

Restore Rate

52% more

Page 36: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2005 BenchmarksDB Mirroring 2005 Benchmarks

Page 37: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2005 BenchmarksDB Mirroring 2005 Benchmarks

Page 38: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 BenchmarksDB Mirroring 2008 Benchmarks

Page 39: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 BenchmarksDB Mirroring 2008 Benchmarks

Page 40: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

4040

DB Mirroring Benchmark SummaryDB Mirroring Benchmark Summary

Overall send rate 41 % faster (2005 vs 2008)Overall restore rate 52% faster (2005 vs 2008)

Overall availability topology inherits the restore rate ~ 50% more available

Example:743 ms Transaction (in 2005 mirroring configuration)379 ms Transaction (in 2008 mirroring configuration)

In failover, what would have been 20 seconds before mirror becomes principalturns into roughly 8-10 seconds (or 3seconds turns into 1.5 seconds, so on).

Page 41: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008DB Mirroring 2008Solid State DisksSolid State Disks

BenchmarksBenchmarks

** SSD’s courtesy of Solid Data corporation

DB Mirroring 2008 Conventional Disk configuration (SCSI/Raid10)DB Mirroring 2008 Solid State Disk configuration (Stripping/Dynamic Volume)

Page 42: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

4242

Benchmark Benchmark ConfigurationConfiguration

MSDB DB

SQL Server 2008

SQL Server 2008

WitnessServer

Adventure Works DB

SQL Server 2008

Mirror Server

translog

PrincipalServer

translog

Adventure Works DB

Instance: SQL08DE01 Instance: SQL08DE02

Instance: SQL08DE03

Endpoint name: “EndPoint4DBMirroring1430” Endpoint name: “EndPoint4DBMirroring1440”

Endpoint name: “EndPoint4DBMirroring1450”

TCP: Listener_Port: 1430 TCP: Listener_Port: 1440

TCP: Listener_Port: 1450

Role: PARTNER Role: PARTNER

Role: WITNESS

Page 43: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 SSD BenchmarksDB Mirroring 2008 SSD Benchmarks

Page 44: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 Conventional DiskDB Mirroring 2008 Conventional Disk

Page 45: SQL Server 2008 Migration Workshop 04/29/2009
Page 46: SQL Server 2008 Migration Workshop 04/29/2009

Mirroring Conventional DiskMirroring Conventional DiskClient Execution Time 5:11:59 AMQuery Profile StatisticsNumber of transactions 100000

Network StatisticsNumber of server roundtrips 1TDS packets sent from client 1TDS packets received from server 4912Bytes sent from client 92Bytes received from server 20117100

Time StatisticsClient processing time 622782Total execution time 622953Wait time on server replies 171

Conventional Disk DB Mirroring

Page 47: SQL Server 2008 Migration Workshop 04/29/2009

DB Mirroring 2008 SSDDB Mirroring 2008 SSD

Page 48: SQL Server 2008 Migration Workshop 04/29/2009

Send Rate 26% Faster

Restore Rate 17% Faster

Page 49: SQL Server 2008 Migration Workshop 04/29/2009

Mirroring Solid State DiskMirroring Solid State Disk

Client Execution Time 3:53:14 AMQuery Profile StatisticsNumber of transactions 100000

Network StatisticsNumber of server roundtrips 1TDS packets sent from client 1TDS packets received from server 4951Bytes sent from client 92Bytes received from server 20277550

Time StatisticsClient processing time 517844Total execution time 517953Wait time on server replies 109

For Mirroring execution SSD's TO SSD's

Page 50: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

5050

DB Mirroring SSD Benchmark SummaryDB Mirroring SSD Benchmark Summary

Overall send rate 26 % faster (2008 Conventional versus SSD)Overall restore rate 17% faster (2008 Conventional versus SSD)

Overall db mirroring topology garners ~ 20% more availability

10 min 17 seconds to complete> 4:32:37am � 4:43:00am (principal send’s)> 4:32:48 am � 4:43:05am (mirror restore’s)

8 min 38 seconds to complete> 3:45:19am � 3:53:20am (principal send’s)> 3:45:20am � 3:53:20am (mirror restore’s)

100% Transparent (zero db & application changes) !

Page 51: SQL Server 2008 Migration Workshop 04/29/2009

P&T ProductsP&T ProductsDatabase Products

SQL SuperVision SQL SuperVision –– SybaseSybaseSQL SuperVision SQL SuperVision –– OracleOracle

SQL Shot SQL Shot –– MS SQL ServerMS SQL Server

Page 52: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

5252

SnapshotsSnapshots

Page 53: SQL Server 2008 Migration Workshop 04/29/2009

0101SQL Server 2008

AdventureWorks DB

translog

SourceServer

Database Snapshot

Point-i

n-tim

e

Repor

ting

Users

(Rea

d-Only

)

Transactional

Users

--- Reverting --- if needed ---RESTORE DB

AdventureWorksFROM DATABASE_SNAPSHOT = ‘xyz’

CREATE DB ‘xyz’AS SNAPSHOT OF

AdventureWorks

Page 54: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

5454

0202SQL Server 2008

SQLServer

AdventureWorks DB

SnapshotAdventureWork

s DB

Source DataPages

Empty Sparse fileof a Snapshot just created

(no updates to original data pages have occurred yet)

SparseFile

Pages

Source

Page 55: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

5555

0303SQL Server 2008

SQLServer

AdventureWorks DB

SnapshotAdventureWork

s DB

SourceData

Pages

System Catalogof changed pages

Copy of originalpages for snapshot

only when a page is changed(Copy-on-write)

SparseFile

Pages

Source

Page 56: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

5656

0404SQL Server 2008

SQLServer

AdventureWorks DB

SnapshotAdventureWork

s DB

Source DataPages

System Catalogof changed pages

SparseFile

Pages

SELECT …..data…… . FROM AdventureWorks

SNAPSHOT

Snapshot Users

Page 57: SQL Server 2008 Migration Workshop 04/29/2009

0505SQL Server 2008

SQLServer

AdventureWorks DB

SnapshotAdventureWork

s DB

DataPages

System Catalogof changed pages Copy of original

pages for snapshot useonly when a page is changed

(Copy-on-write)

SparseFile

Pages

Transactional Users

translog

Upd

ate

Row

A

B

B

B

B

C

Com

mitt

ed

Page 58: SQL Server 2008 Migration Workshop 04/29/2009

0606SQL Server 2008

AdventureWorksDB

translog

SourceServer

Database Snapshot

AllUsers

Database Snapshot

Database Snapshot

6:00AM Snapshot

12:00PM Snapshot

6:00PM SnapshotRestore fromAny Point-in-time

Snapshot if neededDatabase Snapshot

12:00AM Snapshot

UPDATE AWSource.tableXset xyz = …

FROM AWSnapshot6:00AM.tableX

Page 59: SQL Server 2008 Migration Workshop 04/29/2009

0707SQL Server 2008

AdventureWorksDB

SourceServer

Database Snapshot

Users

SAFEGUARD Snapshot(Before the mass changes)Restore from snapshot

(if changes are not correct)

GeneratingMass Changes

UPDATE AWSource.tableXset xyz = …

FROM AWSafegaurd6:00AM.tableX

Page 60: SQL Server 2008 Migration Workshop 04/29/2009

0808SQL Server 2008

AdventureWorksDB

SourceServer

Database Snapshot

Testing Users

BEFORE TEST Snapshot

Restore from the BEFORE snapshotafter testing cycle is complete and can

continue with next test.

Page 61: SQL Server 2008 Migration Workshop 04/29/2009

0909SQL Server 2008

AdventureWorksDB

translog

SourceServer

Database Snapshot

Transactional

Users

Database Snapshot

Database Snapshot

6:00AM Reporting Snapshot

12:00PM Reporting Snapshot

6:00PM Reporting SnapshotDatabase Snapshot

12:00AM Reporting Snapshot

Point-in-time

Reporting Users

(Read-Only)

Page 62: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

6262

1010

MSDB DB

SQL Server 2008

SQL Server 2008

WitnessServer

AdventureWorksDB

SQL Server 2008

Mirror Server

translog

PrincipalServer

Networ

k

Networ

k

Database Snapshot

Repor

ting

Users

AdventureWorksDB

translogDatabase Snapshot

If th

is s

erve

r no

de

beco

mes

the

mirr

or.

Page 63: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

6363

PH Topology With SnapshotsPH Topology With Snapshots

SQL Server 2008

Adventure Works DB

SQL Server 2008

Mirror Server

translog

PrincipalServer

translog

Adventure Works DB

Instance: SQL2008xyz

Instance: SQL2008zzz

Endpoint Name: “endpoint4mirroring”

Endpoint Name: “endpoint4mirroring”

Role: PARTNER

Role: PARTNER

PH Topology

SQL Server 2008

PrincipalServer

Active

Passive

Clu

ster

ed

OLT

P A

pplic

atio

n

Rep

licat

ion

NetworkNetwork

Reporting Users

Database Snapshot

Page 64: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

6464

DB Mirror and DB Mirror and ReplicationReplicationSQL Server 2008

PrincipalServer

SQL Server 2008

MirrorServer

SQL Server 2008

WitnessServer

SQL Server 2008

PrincipalServer

SQL Server 2008

MirrorServer

SQL Server 2008

Subscriber

SQL Server 2008

Subscriber

Publisher

Distributor

Page 65: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

6565

Distributing DataDistributing DataData Access Latency Autonomy Sites(locations)

Frequency Network Machines Owner Other

Read OnlyReporting short high many high fast/

stable1

server/site1 OLTP

site

Each site only needs regionaldata

Central PublisherTransactional replfilter by region

REPLICATION

Read OnlyReporting long high many low fast/

stable1

server/site1 OLTP

site

Each site only needs regionaldata

Central PublisherSnapshot replfilter by region

Read MostlyA few updates short high < 10 medium fast/

stable1

server/site1 OLTP

site

Regional updateson one table

Central PublisherTransactional replUpdating Subs

Read MostlyA few updates medium high < 10 medium slow/

unreliab1

server/siteAll

update

Regional updateall tables

Central PublisherMerge repl

Inserts (new orders) short high many high fast/

stable1

server/site

1reportsite

Each site only needs regionaldata

Central SubscriberTransactional repl

Hot/WarmSpare

Veryshort

high < 2 high fast/stable

1server/site

1 OLTPsite

Fail-overCentral PublisherRemote DistributorTransactional repl

Read equalEqual updates short high < 10 medium fast/

stable1

server/siteAll

update

Regional updateall tables

Peer-to-PeerTransactional

repl

Database Mirroring

Database Mirroring

Database Mirroring

Page 66: SQL Server 2008 Migration Workshop 04/29/2009

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

QuestionsQuestionsIs there any time left????

Send your questions to: [email protected]

[email protected]

Page 67: SQL Server 2008 Migration Workshop 04/29/2009

Windows 2003 EE

Windows 2003 EE

SQL Server 2008 (Virtual SQL Server) SCSI

LocalBinaries

LocalBinaries

CLUSTER1

SQL Clustering basic configurationSQL Clustering basic configuration

S:

C:

C:

Master DBTempDBAppl 1 DB

CLUSTER2

SQL Server 2008 (physical)

SQL Server 2008 (physical)

SQLConnections

Quorum Disk

Q:VSQLSERVER2008

Cluster GroupResources

MS DTCSQL Agent

MSCS

MSCS

SQL Full TextSearch

Copyright 2009 all rights reservedCopyright 2009 all rights reserved

6767