SQL Server Replication Providing High Availability using Database MirroringWord下载.docx

上传人:b****1 文档编号:5856122 上传时间:2023-05-05 格式:DOCX 页数:27 大小:121.88KB
下载 相关 举报
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第1页
第1页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第2页
第2页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第3页
第3页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第4页
第4页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第5页
第5页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第6页
第6页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第7页
第7页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第8页
第8页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第9页
第9页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第10页
第10页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第11页
第11页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第12页
第12页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第13页
第13页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第14页
第14页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第15页
第15页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第16页
第16页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第17页
第17页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第18页
第18页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第19页
第19页 / 共27页
SQL Server Replication Providing High Availability using Database MirroringWord下载.docx_第20页
第20页 / 共27页
亲,该文档总共27页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

SQL Server Replication Providing High Availability using Database MirroringWord下载.docx

《SQL Server Replication Providing High Availability using Database MirroringWord下载.docx》由会员分享,可在线阅读,更多相关《SQL Server Replication Providing High Availability using Database MirroringWord下载.docx(27页珍藏版)》请在冰点文库上搜索。

SQL Server Replication Providing High Availability using Database MirroringWord下载.docx

DianaSteinmetz

Published:

August 

2008

AppliesTo:

SQLServer2008,SQLServer2005

Summary:

Thiswhitepaperdescribeshowtousedatabasemirroringtoincreasetheavailabilityofthereplicationstreaminatransactionalenvironment.Itcoverssettingupreplicationinamirroredenvironment,theeffectofmirroringpartnershipstatechanges,andtheeffectofmirroringfailoversonreplication.Inaddition,itdescribeshowtouseLSN-basedinitializationtorecoverfromthefailoverofamirroredsubscriberdatabase.

Althoughbriefoverviewsaregivenofbothreplicationanddatabasemirroring,itiseasiertounderstandthiswhitepaperifthereaderhassomeexperiencewithoneorbothofthesetechnologies,andhasatleastarudimentaryknowledgeofdatabaseconceptssuchastransactions.

Copyright

TheinformationcontainedinthisdocumentrepresentsthecurrentviewofMicrosoftCorporationontheissuesdiscussedasofthedateofpublication.BecauseMicrosoftmustrespondtochangingmarketconditions,itshouldnotbeinterpretedtobeacommitmentonthepartofMicrosoft,andMicrosoftcannotguaranteetheaccuracyofanyinformationpresentedafterthedateofpublication.

ThisWhitePaperisforinformationalpurposesonly.MICROSOFTMAKESNOWARRANTIES,EXPRESS,IMPLIEDORSTATUTORY,ASTOTHEINFORMATIONINTHISDOCUMENT.

Complyingwithallapplicablecopyrightlawsistheresponsibilityoftheuser.Withoutlimitingtherightsundercopyright,nopartofthisdocumentmaybereproduced,storedinorintroducedintoaretrievalsystem,ortransmittedinanyformorbyanymeans(electronic,mechanical,photocopying,recording,orotherwise),orforanypurpose,withouttheexpresswrittenpermissionofMicrosoftCorporation.

Microsoftmayhavepatents,patentapplications,trademarks,copyrights,orotherintellectualpropertyrightscoveringsubjectmatterinthisdocument.ExceptasexpresslyprovidedinanywrittenlicenseagreementfromMicrosoft,thefurnishingofthisdocumentdoesnotgiveyouanylicensetothesepatents,trademarks,copyrights,orotherintellectualproperty.

Unlessotherwisenoted,theexamplecompanies,organizations,products,domainnames,e-mailaddresses,logos,people,placesandeventsdepictedhereinarefictitious,andnoassociationwithanyrealcompany,organization,product,domainname,emailaddress,logo,person,placeoreventisintendedorshouldbeinferred.

©

2008MicrosoftCorporation.Allrightsreserved.

Microsoft,SQLServer,andtheServerIdentityLogoareeitherregisteredtrademarksortrademarksofMicrosoftCorporationintheUnitedStatesand/orothercountries.

Thenamesofactualcompaniesandproductsmentionedhereinmaybethetrademarksoftheirrespectiveowners.

TableofContents

Introduction1

Technologies2

TransactionalReplicationArchitecture2

DatabaseMirroringArchitecture3

DeployingDatabaseMirroringandReplicationTogether5

MirroringthePublicationDatabase6

ConfiguringReplicationwithaMirroredPublicationDatabase6

EffectoftheMirroringStateontheReplicationLogReader7

ChangingtheReplicationLogReaderBehaviorbyUsingTraceFlag14488

EffectofaMirroringFailoverontheReplicationLogReader9

LogReaderAgentBehavioriftheMirroringPartnershipisBroken10

MirroringtheSubscriptionDatabase11

ConfiguringtheDistributionRetentionPeriod12

ManualSynchronizationTypesforSubscriptions12

HowDoesInitializingfromanLSNWork?

13

RecoveringtheReplicationStreamFollowingaMirroringFailover15

Conclusion18

Introduction

TransactionalreplicationisthemechanismthatMicrosoft®

SQL 

Server®

providestopublishincrementaldataandschemachangestosubscribers.Thechangesarepublished(thereplicationstream)intheorderinwhichtheyoccur,andtypicallythereislowlatencybetweenthetimethechangeismadeonthePublisherandthetimethechangetakeseffectontheSubscriber.Thisenablesanumberofscenarios,suchasscalingoutaqueryworkloadorpropagatingdatafromacentralofficetoremoteofficesandvice-versa.Thisformofreplicationalwaysusesahierarchicalhubandspoketopology.

Theadditionofpeer-to-peertransactionalreplicationinSQLServer 

2005simplifiestheimplementationofabi-directionaltransactionalreplicationtopology,wherethereplicationstreamflowsbothways.Inthistopology,anyparticipatingnodemayreadorupdatethedata.Properlypartitionedmodificationsarepropagatedbetweenallnodesinafullmeshtopology(asshowninFigure 

1),allowingthedatatobehighlyavailableintheeventthatoneserverisunavailable.ThisfeaturehasbeenfurtherimprovedinSQLServer 

2008withconflictdetectionandonlinechangesforpeer-to-peertopologies.

Figure1:

Fullmeshtopologyforpeer-to-peerreplicationwiththreeandfournodes

Transactionalreplicationtopologiescanbemademoreresilienttoserverfailures,andhencemorehighlyavailable,byaddingredundantcopiesofthevariousdatabasesinvolved.Thisisespeciallyimportantforhubandspoketopologies.Caremustbetaken,however,becausereplicationisreliantontheservernamesoftheserversinthetopology,soanyfailovertoanotherservercanresultinthereplicationstreambeingbroken.

VariousmechanismsinSQL 

Serverprovidedatabase-levelredundancy,suchasbackup/restore,logshipping,anddatabasemirroring(inSQLServer 

2005andlater).Databasemirroringistheonlymechanismthatprovidesareal-time,exactcopyoftheprotecteddatabasewiththeguaranteeofzerodataloss(whenthemirrorissynchronized).

Thiswhitepaperdescribeshowtousedatabasemirroringtoincreasetheavailabilityofthereplicationstreaminatransactionalenvironment.Itcoverssettingupreplicationinamirroredenvironment,theeffectofmirroringpartnershipstatechanges,andtheeffectthatmirroringfailovershaveonreplication.Inaddition,itdescribeshowtouseLSN-basedinitializationtorecoverfromthefailoverofamirroredsubscriberdatabase.

Technologies

TransactionalReplicationArchitecture

Transactionalreplicationandpeer-to-peerreplicationusethesamearchitecturetomovechangesbetweentheserversinareplicationtopology.Thefollowingillustrationisanoverviewofthecomponentsinvolvedintransactionalreplication.

Figure2:

Transactionalreplicationarchitectureoverview

Aminimumofthreeserverrolesarerequiredfortransactionalreplication:

∙Publisher,hostingthepublicationdatabase

∙Distributor,hostingthedistributiondatabase

∙Subscriber,hostingthesubscriptiondatabase

Dependingonthecomplexityofthereplicationtopology,theremaybemultipleSubscriberserversor,inthecaseofpeer-to-peerreplication,multiplepeerserverswiththereplicationstreamflowinginbothdirectionsbetweenthepeers.Furthermore,therolesofthevariousreplicationserverscanbeplayedbyoneserverorbyindividualservers(themorecommoncase),anditispossibleforaservertoplayanycombinationofroles.Regardless,thevariousserversanddatabasesmustbeprotectedtoensurethatthereplicationstreamishighlyavailable.

Transactionalreplicationreliesonvariousagentstoperformthetasksassociatedwithtrackingchangesanddistributingdata.Theseagentsare:

∙SnapshotAgent,whichrunsattheDistributor.Thisagentpreparesschemaandinitialdatafilesofpublishedtablesandotherobjects,storesthesnapshotfiles,andrecordsinformationaboutsynchronizationinthedistributiondatabase.

∙LogReaderAgent,whichrunsattheDistributor.ThisagentconnectstothePublisherandmovestransactionsmarkedforreplicationfromthetransactionlogofthepublicationdatabasetothedistributiondatabase.

∙DistributionAgent,whichrunsattheDistributorforpushsubscriptions,andattheSubscriberforpullsubscriptions.Thisagentappliesthe(optional)initialsnapshottotheSubscribersandmovestransactionsheldinthedistributiondatabasetoSubscribers

∙QueueReaderAgent,whichrunsattheDistributor.ThisagentisonlyusedfortransactionalreplicationwithupdateablesubscriptionsandmoveschangesmadeontheSubscribersbacktothePublisher.

ItshouldbementionedthatthereisalsoaMergeAgent,butitisusedonlyformergereplication,whichisnotcoveredinthispaper.

ThiswhitepaperfocusmainlyontheLogReaderAgentandtheDistributionAgent.

FormoredetailedinformationonSQLServerReplication,seethefollowing"

SQL 

ServerReplication"

topicsinSQL 

ServerBooksOnline:

∙forSQLServer2008

∙forSQLServer2005

DatabaseMirroringArchitecture

Databasemirroringworksatthedatabaselevelandprovidesasinglecopyofthemirroreddatabasethatmustresideonadifferentserverinstance,usuallyonaseparatephysicalserverinadifferentlocation.Oneserverinstanceservesthedatabasetoclients(theprincipalserver).Theotherinstanceactsasahotorwarmstandbyserver(themirrorserver),dependingontheconfigurationofthedatabasemirroringsessionandthemirroringstateofthemirroreddatabases.Thetwoserversaresaidtobepartnersinthemirroringsession.

Whenthemirroreddatabaseissynchron

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2