Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
49 views
48 pages
9 Replication
Uploaded by
Dinesh C How Dare I
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save 9.REPLICATION For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
49 views
48 pages
9 Replication
Uploaded by
Dinesh C How Dare I
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save 9.REPLICATION For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save 9.REPLICATION For Later
You are on page 1
/ 48
Search
Fullscreen
Leg shighng Keslicadion ~ Biimag , Secondary gs Moni Prtfiahor , Distaibute Mover q Ririgel , MiSIBLg, estknens Sebscoalen. Module 9Replication in SQL Server Replication introduction: Replication is a set of technologies for copying and distributing data and database objects from ‘one database to another and then synchronizing between databases to maintain consistency. Replication allows you to replicate as little as a single table or only few columns in table or as much asall of the tables in the database. at torah covth opdtable subsniber ® Mowe Replication Training with 6+ real time experience)Page 1REPLICATION COMPONENTS Replication is based on the “Publish and Subscribe” metaphor. Let us look at each of the individual components in detall. Publisher - It is the system that provides the data to be replicated and acts as a source database. It consists of a Windows server running SQL Server database. The Publisher maintains information about which data is configured for replication. 1, Publication - the data to be replicated is grouped in an object called Publication. tt is made up of one or more articles. Publication is created in order to publish data to other systems. i 2. Article = An Article is individual component of data that is to be replicated. It could be an entire table or specific columns in a table or specific rows in a table or a stored procedure. In short an Article isa subset of a table that is being replicated. Subsets are created by using filters. A filter that is used to create a subset of rows is called Horizontal filter. A filter that is used to create a subset of columns is called Vertical filter. 3. Distributor = They are the servers that distribute the replicated data. They store the distribution database, meta data, historical data, transactions. 4, Subscriber -They are the destination servers for replication. They store the replicated date and receive updates. Subscribers can also make changes to the data. You can publish data to multiple subscribers. 5. Subscription - itis a request by a subscriber to receive a publication. It also defines what published data will be sent to the subscriber. 7 6. Push Subscriptions ~ The distributor is responsible for providing updates to the subscribers. Updates are initiated without any request from the subscriber. It can be configured to keep the replication close to real time or to perform updates on a regular schedule, 7. Pull Subscriptions -Ht allows subscribers to specify when the changes are propagated. It is useful if there are large number of subscribers and when the subscribers are not connected to the network. The initiation of the replication is done on the subscriber side. REPLICATION AGENTS ‘The following are the replication agents and let us discuss each one of those in detail + Snapshot Agent - itis used for creating and propagating the snapshots used in snapshot replication. Each Published database has its own Snapshot Agent that runs on the distributor and connects to the publisher and takes a snapshot of the objects. It then Ravinder (SQL DBA Training with 6+ real time experience)Page 2"updates the information in the distribution database. Snapshot Agents are used with all types of replication. + Distribution Agent -it applies the data from snapshot replication or transactions from transactional replication to subscribers. it can run on the distributor or on subscribers. It runs on the distributor for push subscriptions and on subscriber for pull subscriptions. This agent is not used with merge replication. + Merge Agent- The Merge agent is used in Merge replic incremental changes that have occurred since the last reconciliation. in Merge replication there is no distribution or snapshot agent involved instead the Merge agent communicates with both the publisher and distributor. There is one Merge agent for each merge subscription. + Log Reader ~ The Log reader is used for transactional replication. It moves the information from transaction log in the publisher to the distribution database. Each database that is using transaction replication has its own Log reader agent. + Queue Reader Agent: Thisis used in Transaction replication with queued updating option, It takes the changes that has occurred in the subscriber and applies ‘them to the publisher. There is only one Queue reader agent per database, and it merges the Configuring Snapshot Replication 1. Configuring distributor 2. Configuring publisher(Register the publisher server in distributor server) 3. Creating publication of required type 4, Creating subscription(s) Step1: Configuring distributor and publisher a, Take three instances ee Ravinder (SQL DBA Training with 6+ real time experience)Page 3fle Eat Ua Toole Window Communky saLtew Query | Oy | BB G/T uF ot | cormoct | a? os “Y (E) EU SERVER SQh Server 10.0.4000 SCLDBAINE BE Databases, Gia Secuty| 2 Go Server Objects 1B Ga Repteaton BG Management 1B EB, St server Agont Lig SeuvERe (50) Server 10,0.1600 -SQLoBAtec BS Ca) Databases i Ca searey 1 EB Sat Server agort 8 ( SERVERL{TEST (SRL Server 10.0.1600- 510 1 Ca Databases EB seauty © CG Sewer objets 1B Ea Reoteatn b. Goto second instance (1 Right click on Replication (i Configure Distribution... Next {J Select ‘SERVER2’ will act as its own distributor; ST oy | Distributor “Une ths seve ats own Dib o elec another sever a the Disb ‘The Distsse he eyes esponse fo oinaesicatenidornslon wed dara Sees enero pS eaae © Use the loloviing eneyor ag the Dist bxtor (Note: the server you select must ateady be Leosciereb ies esi d. Next tng RT Ravinder (SQL DBA Training with 6+ real time experience)Page 4Ea EEE a Snapshot Folder ‘Specily the ict loetion where snapshot wil be stored ‘To allow Disxution and Merge Agents that nn at Subeerbe to accets the enaprhets of thir publications, you must use # netiere path to ete othe snapshot fol e. f. Next g. Next h, Uncheck the check box present at Server2 (1 Add [Enalde servers to ure the Distibutar whan they became Publahers ublohers Diatibaion Daas TF Senven2 J+ Select instance Servert k. Next 1. Enter strong password. (Automatically one login is created in distributor with the name Distributor_Admin) im. Next ni. Next Ravinder (SQL DBA Training with 6+ real time experience)Page 5(1S) Configuring... a ‘ck Stop ta htenupt tha operation. 3 Tas 0 Ewer @ seovoes 2 Since 0 Wang Deak TActon, ‘Statue [Message @ _Contiguting the Distributor ‘Success @ Saving Disibtor passverd Success | Enobing Publsher SERVER" Succsee ' St0n. Bepott Observations 4. Goto distributor 1 Databases 1 Find the new database “Distribution” 2. Go to Security © Logins “Find a new login “Distributor_admin” 3. Go to Server Objects (i Linked servers Find new linked server “repl_distributor” 4. Right Click on Replication © Select distributor Properties.. Comecty | Be TiS B (Ga Databases: a securty Ea Server Object & Ga Replication 1 Ea HManagernent BB SQ. Server Agent 15 ( SERVER? Sal Server 100.1600 -scuveRt | @ (Databases: ED secutty Ga Server Objects Toe pepeniea, Disable Publishing end Distrib Launch Replication Monitor Generate Scripts Update Replication Passwords. Ravinder (SQL DBA Training with 6+ real time experience)Page 6Din dala == Deuba: ep en Tf Ores 1eheoe = ew] oe ‘* Transactions stored in distribution database are removed after 72 hrs and agents history is removed after 48 hrs. ‘+ Toview snapshot folder path C1 Click on publishers Ci click on browse button } present to right side of publisher name. browse button Ieesonte ie opel eceesecctnd Pad Tp Wa SOL Sees gj | laatenCsabaetia divbaten | IRIE ETN Cogn rection Sat serra. 106 ae oven | Pern ot SL Sonei¥lSSOLIRUSSOLSEAVER | y snot fer * Goto SQL Server Agent (i Jobs Find 6 new jobs are created automatically. Ravinder (SQL DBA Training with 6+ real time experience)Page 71) (Bh Se server Agent 15 Ug} Seema (2a Server 10.0.1690 - SQLDBAacminstrator) [Sa Securey 5 Server Ob arene a rs oes tno tetanon! (eae A Srewed ebscgion ean eo Fekete sobeerpions having data vation Ftares [Bo Repication cents checkup > as Be torte § Soper purge ery ea eens Step2: Creating Snapshot Publication a, Goto publisher (Server) [7 Replication (1 Right Click on Local Publications New publicati 1 (3 Local Subscription (@ (a Management [B 501 server Agent ‘New Oracle Publication. . Big SERVERZ(SOL Server 10) Launch Replication Honor 65 [Gy Databases ee Generate Saiptsn, 5 GG Server objects Configure Distribution.» b. Next Select second option «: Click on Add (1 Select Distributor instance (Server2) Ravinder (SQL DBA Training with 6+ real time experience)Page 82) wioes Distributor ‘Use this sever ae its oun Distr of elect ancther server ae the Dietibutr, ‘The Distbuto isthe sever esponsble or clonng repostion infcmation used dure archronzaters. © SEAVER lot os ts oon Ditduter SO Saves willceae 3 vinton dao and > ke et Use the faking sare athe Diner ot th ewer you east mit ahaa be ‘da “Microzofte ce SQL Server'2008 7 ue 7 Soar Be fiabbseenne ed ‘Server nase: ana Sd Keer conininathe d. Connect ONext ce. Enter password of Distributor admin login which we have mentioned while configuring publisher. Next & Select required database. For example SSISDb the data or obits you want © publish Databoroe Next Select “Snapshot Publication” (i Next Select required tables (1 Next oc Articles : Set er od te bet pubih otis, See clin ter oe ‘Abies to pubis : aa © AE Totes : oe EAE Bi coo __hiceeates | = 2S Ba : SLE Poste oe ae Kk. Next(i Next a HE a renner er Ravinder (SQL DBA Training with 6+ real time experience) Page 9I. Select the check box to create snapshot as follows ma FAIS 1 Snapshot Agent ‘Speci when tunthe Snapshot Ager TET ‘Subscipton ae iad wth » snapshot of pueton shema and data. The Snapshot 1 Agent ates the snapshot WG eplbe sn iotnlielze sebscintong, TT Schechi he Srahot Aget tor athe clown tes: im, Next fn. Click on security settings ©. Select as follows ‘rect ener bei Saas nder wach the Brnahet Aan mene i Penh te Sono ee nan aa neem nha
Grestethe pobieatan {The Publisher ‘SERVER will be configuted with the following options: Je ice SERVER ae the Dishnuer, JA publication wil be created with the following options: Cieate snapshot publcation fom dalabase SSISDB. J+ The Snapshot Agent piocess wi un under the ‘SQL. Server Agent sowvice' account. |+ The publicaion compat lovel wil cuppor Subseries that ae servers uring SOL Server 2008 etter, J+ Publ the flowing tables ae atclos: Fini Creating Publication (lick Stop io Fterupt the operation, 1st v @ success 4 Tow 0 Eno 4 Socore 0 Waring | Bele : | plas Sau elo | ‘Configuring the Distibutor ‘Success: 1 Creating Publication 'SSISDBSP” ‘Success: @ Ads aie 22 success / Siang ie Snapshot Ago Success : | o Observations 1. Go to publisher ( Replication 1 Local publications () Find new publication is created Ravinder (SQL DBA Training with 6+ real time experience)Page 11Comect~ | a7 Boo VS [ig SERVER GOL Server 10.0.4000~ SQLDaMadniniseior a Ostabaces BE Secutty @ Ea Server Objects 5 Ga Repkestion & (Local Pubieatons ag eo 1 C3 Lox subserbtions [Ssis0b} SSISDES> @ [Bb 5A Server Agent 1 [g SERVERZ (Sal Server 10.0.16 Ea Detabases 1 Gi Securty © GD Sever Objects cea Lcimamuptmdien 2. To check snapshot was created or not Li Right click on the publication (SSISDBSP) 1 View Snapshot Agent Status 3. Goto repldata folder as follows Publisher: SERVER lpublcation database: SSISOb 1 Moseatone 6 Serco ar. * universal naming convention Go to sub folders find the snapshot files (.bcp, .sch, idx, .tre) 5. Go to distributor [I SQL Server Agent L Jobs U Find snapshot agent job was, created. © Luh SERVER? (SOL Server 10.0.1600- SQLODA\adninistrator) & [at Databases © GS Secuney El Server Objects & Sal Replication © Gat Management GB Sal server Agent Cat Jobe history dean up: distribution 3 Mitroring Monitor 20 Distribution coon op! eirtribution [Bal Expired cubecrintion clean up Ea] Rerntiaize cubserestons having data Validation Fares [Ba] Reptcation agents cneciass iestion mentor refresher for cstributon. Job FAQ: - How to display database names which consists of publications? Ans: _ Go to publisher Ui take new query 0 Ravinder (SQL DBA Training with 6+ real time experience)Page 12onsys.detabases where is published=1 or ig_subscribed=1 Creating Subscription 1. Go to publisher Replication £) Local Publications | Right Click on SSISDBSP 0 New [SERVER (6Q" Server 10.0.4000- 8q.DBAadmnitra a] [iy Databases © Seanty ES Server Objects B Ga Replication CB Local Publeatons i [Optinze): Optinizes 8 Cy Local Subscrotons 1B a Management Neve Bubation ( 501 Server Agent oo BB {@ SERVER2 (SQL Server 10.0.1¢ Launch Replication Monitor © Ca Databases Generate Serbs. fae ones Reiko Al Subscriptions 2. Next 3. Select the publication name: SSiSDBSP 4. Next 5. Select Push subscriptions EE EER | Distribution Agent Location ‘Choate whee to nan he Disibuon Agente. Th opton makes eave o adit the synctrnization of sbscepons cera © Bun esch agua Suhecibe (ul abecipons) ‘This opin edces the processing overhead ae Dito ard ets each 6. Next 7. Add Subscriber © Select third instance (Server!\test) J Connect Ravinder (SQL DBA Training with 6+ real time experience)Page 13IB New subscriptir Subscribers ‘Choose one or mote Subsoiiners and specily each subscttion database, ‘Subecibeis and subscition dalebeces [I Subsaiber Subscrotion Databare Fy serves TB You soe Suber ard peaye ee 8 Next 9. Under Subscription Database if there is no database exists with same name [i Select New database | Enter Database Name (1 OK “i Next eI a es ‘Subscribers an CCheose one or mate Subscibers and specily each subseipon databace. “Subtesets and subsctnion databases: [Subscibe TF SERVERT I SERVERI\IEST “Refresh database Be Logstipd PAYROLL ‘Add Subeciber > 10. Click on browse button (.) under distribution agent security page. 11. Select “Run under Agent Service Account” and “By impersonating the process account” ‘options as both distributor and subscriber's service accounts are same. If the service account of subscriber is different, then create a login in subscriber with sysadmin privileges then mention that login details. Ravinder (SQL DBA Training with 6+ real time experience)Page 14ae EBs Ry seo ace ees ee trac it © By erpeieonaing te process ecosint Tis pesbess acaocrh rus be 8 nano ot fos Publoaton Asser List rene oe Toloiing SOL Server ose 12. Next 13. Under Agent Schedule Select "Run Continuously”. 14, Under Initialize when select © Immediately 15, Next CI Next D Finish Observations 1, Go to subscriber “i SSISDB Li Tables 5 Find two tables are created. 5B IB SeRVeRIITEST (59L Serer 10.0.1500- Sabet a Databases 1D a system Dotbates 1 Daabare snapsots Eh Ef Logshipob (standby / Read-Only) Ud arrow. = ae TB Fo Catabase Diagrams BE Table {BC System tbls BO cos Cl obo.ewe @ Ea vows 3 Syren 2. Go to distributor Ci SQL Server Agent [1 Find new job is created, related to Distribution Agent Ravinder (SQL DBA Training with 6+ real time experience)Page 153 Up severe (20k server 10.0600 - SQ108A adits) "Ba batabones © a Seow SS Saver Objete repeaton 5 Manager SB oa er ‘osce Netra is dtrtnson Batabare trong Monto ob a Detriston Goan up dtrbgion BB fxcred anserston eon en faints niscrotons hava cota vation ¢ Eid recicaton ovens reco BE retcren enter arener tr tain Verifying Replication 1. Goto publisher perform some changes in any table present in publication. 2. Go to distributor run Snapshot Agent Job {GS Server (51 Server 10.0.1600- SQLDBA\admhnistrator) 1B Ca Databases Eh secuty Gh Server Objects 3 Ga Repication 1 Gp Management 1 EB Sal server agent 15 Cal Jobs {ad Agent history dean un: distri Boe tra tor FE Dierbution clon un: dstrout — [EG] Sxtred subserpton dean up| Stet Job [Be] Retntiatze subscriptions havi Your History Replication agents checkup Eq Repleationmantoring refresh} rable Eel servers-optime-optmaes) Oisable [E|senvens-csisomssimnece' Start PowerShet El eyepotey_purae_hictory ae 7 “Gb Aatity Honitor lasted a 3. Goto subscriber observe the changes in the respective table. Configuring Transactional Replication: Configuring the Distribution Database Ravinder (SQL DBA Training with 6+ real time experience)Page 164. Conneat to the Microsoft SAL Server 2008 Re Management Stud. 2. my Click on the sale node and ects Distribution as shown inthe sereancaplure below: Comecty | a7 2 °F ESD } Ei Ugh SQL TEWSINSTON Gal Server 10.01600 ~
bution and a new window appears on the screen as shown inthe screen capture below: Ravinder (SQL DBA Training with 6+ real time experience)Page 17Fe Conhigore Dtobatier Distributor Usa eso ei nn itr rele ater seeve asthe Dib, | tho iestr ithe rover reporde fo tab ean oman ured ding spsroneatos, FSOLTOVSNSTOT aso eDiaIO EAL Sava cea «wes © eet eins sever ate Dita los the sve Jeu eect ms stead be ‘argued a eDenbeto a oe, [Ea] tet |_| | 6. _Asyou can seein the above screen capture, it gives the user two choice. The rt cholce says that whether the server on which the Replication wil be configured wil be Hosting the dstrbution database. The second choice asks the User tether some other sever wil be Hosting the distrbuion database. The user can salect any one ofthe ether choices are per hisiher raquramenis. I dace fo use the First option, |. the server on which the Replication is configured wil elf be holding the distrbution database. Then Cick onthe Next> button ag shown inthe sereen capture above, 6. Annewwindow appears 8s shown inthe screen capture below: ‘SQL Server Agent Start ‘See tes pusaealy ta te SL Seve Aen sce henthe Seepacts aud Hae _ ne lcaon sh sehen Abeer untied Yo olicnlgae6actenehgen Oat cen Bar ese LSA very SOLTEYSMTO 2 otenanatea olen Ga conan sole 6 iegalga Pasig a Malone tonne rip Ferd cone SL Seve Ager seve ‘comet mut hve pat pane ote ee gore be sone et ‘iniveltae pera ow charg be erga Beohiyl | carat i 4 Ravinder (SQL DBA Training with 6+ real time experience)Page 187. Select th fst option, Yes, corfigur the SOL Server Agent service to start eutomatcally and click onthe Next> button as show inthe sereen capture above. 8. Anew window appears on the screen as shown inthe seraen capture below: ‘Snapshot Folder pect tao wean bare rapa wbe sd bean youn un ae: pai lr ol spas oe root le et wSectonre. une sneboaicpahorseriomctage, hPa ies oak eis | cae | | ‘As you can see in the above soreen capture, you are asked where the Snapshot folder should reside on te Server. Let us rst understand what the Snapshot fldor exact i. “The Snapshot Agent prepares snapshot fles containing schema and data of published tables and datatnase objects, stores the fles inthe snapshot folder, This folder should never be placed on the C eve of the carver Le. the tive which Is hosting the Operating System. ‘Create a folder on any other dive to hold the Snapshot fldor and Cick on the Next> button as shown inthe screen cpture above. ‘8. Anowwindow appears a shown in tho screcn capture below: Ravinder (SQL DBA Training with 6+ real time experience)Page 19Fa contioure Dtrbution Wizard Diowibution DatabSE a Te austin dalabaye teres charges lo vontctons pubieniane i ubscibns can be TESST a ve ce aaa i reat etdcae paler Diitien detabons nae ale oe dil dab Se ‘lis rh un taba og [SRSONTTOATS cu aianeN@eL omar a nt weal ni rl ga i eae 3 Sdon feratanale £} hidcped ave tote end noun pales ec te] pred meres pee ‘As you can see in the above screen capture, i displays information such as what wal be the distribution database name, the location where the data andthe log fle wil reside. Click oa the Next> bution as shown inthe screen capture above. 410, Anew window appears as shown in the sereen capture below: 1 | Publishere nce scvers toute hs Okindr when ny become Pubs ‘Dane bbes 1 savrewswnsTor ‘Senor ‘a ee eee 11. Choken the Next button. 412, Chicken the Next button as shown inthe seresn capture below:(coakias aot © Genesio a sro fe wth steps o conte doen 15, Cheon the Finch button as shown in the geraen capture below Eee tne Sy Seer ages soneson SALTBWSNAISTON Wok oonetcahy Ure aigsG somone ret att tare “14, Ones done, a now datsbase named dletbution gots created. n order to confim itjust expand the System Database ‘ede and you shall be able o view the cisbution database, please refer the screen capture below: Ravinder (SQL DBA Training with 6+ real time experience)Page 21Bi 1p SATEWSNSTOR GOL Server 1 3 a Databares say | me 8 | B a & Creating the Publisher ‘The folowing stops need to be fofowed while creating the publisher 4. Right Glick on Local Publications and select New Publication, ploase refer the soreen capture below Pe) New Publication Wizard 3, Select the database which is going lo act asa publisher. In our case, | select the AdventureWorks database. Pioose refer the seceen capture below and Click an the Nex> button. ee Ravinder (SQL DBA Training with 6+ real time experience)Page 22cation Datahace 1 Seen eth drab yr ith pal 4. Select Transactional Replication fom the available publicalon type and Click an the Next button 2s shown inthe soreen caplure below: oon a Publication Type Choate the p.ticaten ype tha bet supp te eautemae lou ‘teleion eso ace nc ee enemies [Scere recive snvanaeeht 5. _ Select the Objects that you want to publish, In this example, we wil select table named Person which we need to RRepfecale. Select the fable as shown inthe screen capture below and Click on the Next button. One important point to ‘ote Is that Only those tables can be replicated in Teansacton Replication which has a Primary Key column in. ore en nn nn ee tment Ravinder (SQL DBA Training with 6+ real time experience)Page 23Artictos Soe es wel tha ae pia ate, Set ens oe iiss a0 3 oa 8 Og ean SHE mocaea reine Et cmstponn F serch onset neeta 2 ere a I caer I carter cn I congas a I) ceaeas aed Filter Table Rows “iter tesco ranted rom em putes tables Flsed Taba: (ick Heat you dora aedo er eda your pbleaton. ‘Ast Cok Add to besin Reina you pubicaon es 7. Check the first radio button as shown in the screen capture below and Click on the Next> button, Ravinder (SQL DBA Training with 6+ real time experience) Page 24Snapshot Agent ‘SPcoky wherein he Snaphol Agent ‘Susccupllons ate iniiakred vith 9 enepthot of pubsealon schema ard data The Sreoshot Agar) ceates he snapebet (> (Seen cana ata acd ee tie anneal ave a lowing tenes Schedule the Snopshot Agert to nm a 1 ga unto cherie the eneshot popeties dot st he Srnchet Acari ater _Bhonge tha prapetior inthe pubcclisy propany clog bem Heb.
button as shown in the screen capture below. Ravinder (SQL DBA Training with 6+ real time experience)Page 26Agent Sect For each aert pec the eccount unde: nbichit win ands connection Sots Shapsbet Agent [SQL Seve Asertsccout = G Lop Reader Agent : [SGU Save Agertoccout = Secs) Seta 7 selte secu cetinas om the Snapstet Aone 9. Click on the Next> button as shown in the screen capture below. Allmendcl ve wears F icieiaianaiena TT Gererete a sciea fe wih cers to cele he pbtcsion eee er eet | cone 10. Give a suitable name to the publisher ad Click on the Finish button as shown in the screen capture below. Ravinder (SQL DBA Training with 6+ real time experience)Page 27‘Complete the Wizard Vari te chaees mage nthe ceed and ofek Frish Bubliaton name [eavartxevorka_Pubkeat) ‘alk Fini to pafoun the fling actions: FF Creates petition lA publication will be created with the following options: ‘Ciosin sirrtesclional pubsoekan trom databace aventceWee The Shapsnce gers process wll tun under the SOL Server Apert sewview’ account ‘The Log Reader Apert process wil tan unde! the ‘SOL Setva! Agent cevice" seccur. ‘The publication cempatbiky level wil suppor Subscribes that ace teversrerring SOL Server 2008 or ster |. Publish the tetowing tables a entten ‘Accrose |. Create enapshot of this pubietion immeciately ater he publication i erated Creating the Subscriber ‘Once the publisher is created the next step is to create the subseriber for it. The following steps needs to be performed for creating the subscriber. 4. Right Click on the publisher created and select New Subscriptions as shown in the screen capture below. Bi [Gh SRE TEWAUNETON OX Sever 10.6.1600- sa) © (a Databases & (Bw seasty (B Server Objects Replication © Gi Local Publications, © (2 Local Subsergtion & Ea Management fB SOL Server Agont es Launch Replication Monitor Generate Script. Vaidate Subserptons... Reinitalize All Subscriptions 2. Click on the Next button as shown in the screen capture below. 3. Click on the Next> button as shown in the screen capture below. Ravinder (SQL DBA Training with 6+ real time experience)Page 28[= NERERnen Publication ‘Craae the pubieion fr which you want ett one erate ebeo bbe fsa. TawaNNsTor ea ‘Databases and pubicaione: SL Adverhuclots, a Distribution Agent Location “Ee ake tart Been ht “Fat hm eirepos | one wt ‘The shen wea Aes aranitestm vonionl spite cet © Rangecheon baa dase) hi acon dices rocstg aed at labs mae cach Ties SSNS aimee | oe enim ee nls ant i athe Dae wo 5, As shown in the screen capture below, it asks for the Subscriber name as well as the subscription database. The subscriber database can be created by restoring the publisher database at the start itself or by creating a new database as shown in the screen capture: below. Ravinder (SQL DBA Training with 6+ real time experience)Page 29Ifyou have already restored the backup of the database which is a publisher, then the database name will appear in the dropdown as shown in the screen capture below: If we wan't to now create the subscriber database then it can be done as follows: Click on New Database as shown in the screen capture below. Ie Lor ‘Subscribers hose one of ree Subsets and spect each ebrenion dbase Susscdns ed abicigtondlabans, [__].sibecibee Sueapion bade FF salrowsnstor ‘verte W200 ausioe Constr 8 ‘AdsSuovenbol | [i) Yours one a subscoton deabose rane for Subscibe SQLTEWS\NSTOP, Anew window appears as shown below. Give a suitable database name as well as the path where the data and log file are going to reside, Ravinder (SQL DBA Training with 6+ real time experience)Page 30asarnaerets Fase pice re [tii watadoas — | BrtOpncea wettest Click on the OK button. If the subscriber is some other server, then the following steps need to be performed. Click on the down arrow available on the Add Subsoriber button as shown in the screen capture below. Bap new subs ‘Choose one ot mote Subsobers ond epccily each subscfnion databace, “Subscrbats and subseinion dalebaces WF sacrewsvnsTar ([Aasvemureworke:Rerisaion Ravinder (SQL DBA Training with 6+ real time experience)Page 31Click on Add SQL Server Subscriber as shown in the screen capture above, ‘Anew window appears which asks for the SQL Server Name as well as the Authentication neeed to connect to the SQL Server, please refer the screen capture below. ii sect ~~ SQLServer2008 Seaver pe! [Eetahace bean? u ‘Seve name: actawsunstor Aushentioaion, [S01 Sewer Authertoaion = Losin: fe a aesnerd eee FF Remember password SES Subscribers (Choate one et more Subscrbrs and spect each aubsciption database, Sibeeipion Database _Subscibers end aubserovon detabores, Subscibe a WF savrewswNsror Eoin | caesl || 7. — Click on the button as shown in the screen capture below. Here we need to specify Ravinder (SQL DBA Training with 6+ real time experience)Page 32Process account as well as the connection options for the distribution agent. Distribution Agent Security ‘Speciythe paces axcout end conection options ec each Detibuion Age clicker. | [2 ea ess basa clennn fe oscspion oe cones ta jee sete seca cose (aes wea] eee | | 8 Anew window appears as shown inthe screen capture below, © eager nen aeeseen va ein Purp eae flees bee ree ee ree eee oemensroe eee 8. Specify the cistibution agent to run under the SQL Server Agent Service Account. Also connect to the disbutor as ‘well as te subscriber by impersonating the process account. Pease refer the screen capture below. Ravinder (SQL DBA Training with 6+ real time experience)Page 33Gr tipetennina he roca account sng re oloning SAL Eaves 40. Click on the OK button 2s shown inthe sooen capture above 111, Clickon the Next button as shown inthe screen capture below. a (si Distribution Agent Secu ‘eos he pocets Seca na conection pls a each Disibuon Ager ‘Sbseroion ropes: SQUBWELNSTOE Tnpersnate process at. _Inpsrsona recs o Hep] “lack News] ceinss [cancet | y 12, Ensure thatthe Agents scheduled to Run Continuously and then click on the Nex button as shown inthe soreen capture botow. Ravinder (SQL DBA Training with 6+ real time experience)Page 34mma ‘Synchronization Schedule ‘een te secheizaon see x each eer SOLTOWSUNSTOT —Oiaaor vid dh cot | eee | | 18. Ensure that the Subscibe sinllaized immediately and ten click on the Next> button as shown inthe screen copture below. 14, Clickan the Next button as shown inthe sereen capture below. Coe ‘Wizard Actions: ‘roots whet happens when sou fl Fish, feof amet ny [cms 15. (Click onthe Finish button as shown inthe sereen capture below. Ravinder (SQL DBA Training with 6+ real time experience)Page 35,Complete the Wizard "tithe ces stn wi ene heh ick Fah to poi the folowing maton |. Cree bscibis Icwete » subsection to pubiction‘Adventuteb/otke_ Publication fom JPubisher "SGLTBWSUNSTOI loose ssbcintone athe ola Subecrbe Jsacrewswist01 oN Sieroondaboce Addvertaonete Reposfon + Appoint ‘agate: Rum convey ‘aget racers ezount SOLServergent evicw accouet Conectono Ostet Inpeteratepocest accor Inne Inmet | Sees cont || 16, ‘This creates @ subscriber forthe corrosponding publisher. 17. Expand the publisher rade and you shal be able to view the subscriber as shown inthe screen capture [gj SOLTAWS|INSTON GQL Server 10.0.1600- sa) BG Databases 8 a Searty ‘Server Objects: SG Replication © (a Local Publications: 2 Lat Reena & Ca locd rm B (Gj Management 1B 501 sever agent ‘Now the transactional replication setup is completed. Ravinder (SQL DBA Training with 6+ real time experience)Page 36L 3. Merge Replication Configuration Steps Steps: ‘Open SQL Server Management Studio and login with SQL Server Authentication to configure Publishing, Subscribers, and Distribution, ee ee © a Bares Publisher subscriber eee ‘3 theaters / TE mea sensors 7 Saba © Gt secre a Sever Oba 2 La reoeaton © Go tage (hatha evens © B sce seer Agen Configure the appropriate server as the publisher or distributor. ee er Ravinder (SQL DBA Training with 6+ real time experience)Page 37Ste ing acs Siete Sister am ae vee r Sag evan ror S Eaten pono cer sienna Ngboencrrtr eter bm enperéne tt eases ee Create a new local publication from DB-Server --> Replication > Local Publications --> Right lick --> New Pub. Ravinder (SQL DBA Training with 6+ real time experience)Page 38New Publication Wizard Lnaeadeain oer Bk, ep ete sone Coron eral Segre nena tnce mane ag po nbies reso tnt ices oy as eset enews taneapinsnen Publication Database ‘Choose the database that conten the deta or cbjects you went to publish, Choose the replication type and then specify the SQL Server versions that will be used by subscribers to that publication, like SQL Server 2005, SQL Mobile Edition, SQL for WinCE, etc, Ravinder (SQL DBA Training with 6+ real time experience)Page 39pa Subsceber Types ‘eek he Sore yess te wed Sabet paces vee 2ubcaion Type ‘Gece paket thon naps Darwen yr oe bent sone nticion Sturcwursnblee ewe efgaete Bent ee chr agate al spebetabcbetie Eh gesave os Cisesere sasttiesten Seeder matte Oven a. ea topuleartctaind th da, detente ad piesirsustecaeycts. Coste sane terns ct Perit ae cmetesmpatententc a fe geserrainesrva anna lesttendet Siterbasre nt rat de pbioadte. ese rere ve seve Mecsas Pepe, Gente After that, manage the replication articles, data, and database objects by choosing the objects to be replicated. ‘Note: you can manage the replication properties for the selected objects. "ES elon hte seamed “open nding rr ‘Then add filters to the published tables to optimize performance and then configure the snapshot agent. eit einer areca eae Ravinder (SQL DBA Training with 6+ real time experience)Page 40Snapshot Agent Specfy when torun the Snapshot Agent ‘Subscriptions are fiiized with a snapsht of publication schema and dats. The Snenshat Agent creates the snapzhat.. Create a snapshot immediately ‘Schedule the Snapshot Agent to run at the follwing Limes: Occurs avery £4 day(s) at 12:05:00 AM, Schedule wil be used starting on 8/19/2009, {Ifyou plan to change the snapshot propettes, do not stertthe Snapshot Agent unt ‘after you change the properties in the publeation property dialog box, c=) re retest tunennnonennnes menennenentemrnennr rennet te Ravinder (SQL DBA Training with 6+ real time experience) Page 41Peis ono: Sched types Fregseney ens: Recusevery: Doty frequency Doors ove: MOS euantsntenvanwnnn “Wf aimannananunaithbbeseabetpnictan So netatlmpenion iar eee a E 0 tet ct sa gene ase andar re (S tyroemmtnezessunet (Canesten i as aoe, So Ravinder (SQL DBA Training with 6+ real time experience)Page 42Finally, rename the publication and click Finish aie eld Complete the Wizard as ‘aif the choices made nthe ward and dekh. Publication name: [riyPubicatonot ‘ck Finish to perform the Flowing actns: Greate the pubcaion. publication willbe created with the fllowing options: Create a merge pubketion from datebase Rasubscrber ‘The Snapchat Agent process wil run under the 'SQL Server Agent service’ account. Publish the folowing tables as articles: + Employees Create a snapshot ofthis pubtcation inmeciately after the publication Is created, Create a new subscription for the created "MyPublication01” publication by right clicking on MyPublicationOl --> New Subscription, Configure the “Merge Agent" for the replication on the subscriber database, Ravinder (SQL DBA Training with 6+ real time experience)Page 43ioe 1A Erne 2 terion cern cto zs gnmorne + Qhatenetan teehxeneee LBteteetn Sarees seen, ese New Subscription Wizard sewanstreyee d recon me oesnenst apatanen pioneer El tan enn tse san 1 Ce Cee? Pubsetion Sonepat trio eee ‘Merge agent Location me tiatbstaae es rerunstioensstostenduveet: sem(pahabeyten) _Byegnnsten tense tw mreaeattaouane oe bi Onneaseectaersterte oka) DOCS rrernatertaraoomhataencareesiteun Esiertnsoerlssnaecnaametonasovss ntepgpdama ne cetnevatio stemmed Choose one or more subscriber databases. You can add new SQL Server subscribers. rr Ravinder (SQL DBA Training with 6+ real time experience)Page 44Coeumeatiniie ic) subscribers CChoose ene or more Subscribers and specify each subscription database, Subserbers and subscription datebaces: Subscriber EGYPT-AEID [Ey] ~ Bibsaeton ak TateSbactber ‘Add SQL Server Subscrber,.. Then specify the Merge Agent security as mentioned above on “Agent Snapshot". And specify the synchronization schedule for each agent. Schedules: Run continuously: add schedule times to be auto run continuously Run on demand only: manually run the synchronization Ravinder (SQL DBA Training with 6+ real time experience)Page 45,PDE eeu) ‘Synchronization Schedule Specify the synchronization schedule For each agent. ‘Agent Location | EGYPT-AEIO Distributor 3 Rieama Run on demand only Define schedule. | | and then next up to the final step, and click Finish, You can check errors from the "Replication Monitor" by right clicking on Local Replication --> Launch Replication Monitor. Ravinder (SQL DBA Training with 6+ real time experience)Page 46Ravinder (SQL DBA Training with 6+ real time experience) Page 47
You might also like
SQL Server Transactional Replication Cheat Sheet
PDF
100% (2)
SQL Server Transactional Replication Cheat Sheet
5 pages
SQL Server DBA Concepts
PDF
100% (1)
SQL Server DBA Concepts
9 pages
DBA - Syllabus
PDF
No ratings yet
DBA - Syllabus
13 pages
Replication Architecture
PDF
No ratings yet
Replication Architecture
17 pages
SQL Server Replication
PDF
No ratings yet
SQL Server Replication
3 pages
SQLServerReplication DeepDive 595
PDF
No ratings yet
SQLServerReplication DeepDive 595
26 pages
SQL Server Replication
PDF
No ratings yet
SQL Server Replication
4 pages
Create Windows Accounts For Replication
PDF
No ratings yet
Create Windows Accounts For Replication
15 pages
BGI SQL Replication V1
PDF
No ratings yet
BGI SQL Replication V1
37 pages
Fundamentals of SQL Server 2012 Replication
PDF
No ratings yet
Fundamentals of SQL Server 2012 Replication
347 pages
Fundamentals of SQL Server 2012 Replication
PDF
No ratings yet
Fundamentals of SQL Server 2012 Replication
359 pages
5.high Availability - 2
PDF
No ratings yet
5.high Availability - 2
34 pages
Configuring Transactional Replication Step by Step
PDF
No ratings yet
Configuring Transactional Replication Step by Step
36 pages
Replication in MS SQL Server
PDF
No ratings yet
Replication in MS SQL Server
11 pages
What Is Transaction Replication in SQL Server?: Advantages or Use Cases For Transactional Replication
PDF
No ratings yet
What Is Transaction Replication in SQL Server?: Advantages or Use Cases For Transactional Replication
15 pages
Replication Q A
PDF
No ratings yet
Replication Q A
16 pages
SQL Replication Basic
PDF
No ratings yet
SQL Replication Basic
22 pages
Replication: SQL Server 2000 - Part 1: (2003-11-10) - Contributed by Mahesh Kodli
PDF
No ratings yet
Replication: SQL Server 2000 - Part 1: (2003-11-10) - Contributed by Mahesh Kodli
5 pages
Replication
PDF
No ratings yet
Replication
16 pages
MSSQL2005 Replication: Author Brijesh Kumar Date of Creation October, 2008 Email Id
PDF
No ratings yet
MSSQL2005 Replication: Author Brijesh Kumar Date of Creation October, 2008 Email Id
69 pages
SQL Server 2000
PDF
No ratings yet
SQL Server 2000
26 pages
Step I. Configure Distribution
PDF
No ratings yet
Step I. Configure Distribution
65 pages
Replication Questions
PDF
No ratings yet
Replication Questions
11 pages
Replication Setup
PDF
No ratings yet
Replication Setup
23 pages
SQL Server Replication
PDF
No ratings yet
SQL Server Replication
8 pages
SQL Server Replication
PDF
No ratings yet
SQL Server Replication
8 pages
A Guide To SQL Server 2000 Transactional and Snapshot Replication
PDF
100% (1)
A Guide To SQL Server 2000 Transactional and Snapshot Replication
86 pages
SQL Server Replication
PDF
No ratings yet
SQL Server Replication
5 pages
SQL Srever 2005 Interview Questions
PDF
100% (2)
SQL Srever 2005 Interview Questions
6 pages
Fdocuments - in Pro SQL Server 2005 Replication
PDF
No ratings yet
Fdocuments - in Pro SQL Server 2005 Replication
21 pages
SQL Server Replication - Full Overview and Step-By-Step Configuration
PDF
No ratings yet
SQL Server Replication - Full Overview and Step-By-Step Configuration
41 pages
SQL Server Database Replication
PDF
No ratings yet
SQL Server Database Replication
9 pages
Database Mirroring and Replication
PDF
No ratings yet
Database Mirroring and Replication
7 pages
Replication
PDF
100% (1)
Replication
625 pages
Replication Important Interview Qus & Ans
PDF
100% (1)
Replication Important Interview Qus & Ans
14 pages
SQL Server Transactional Replication
PDF
100% (1)
SQL Server Transactional Replication
38 pages
Transactional Replication - Beyond The Basics
PDF
No ratings yet
Transactional Replication - Beyond The Basics
41 pages
Replication Publishing Model Overview
PDF
No ratings yet
Replication Publishing Model Overview
14 pages
Replication: Training Division New Delhi
PDF
No ratings yet
Replication: Training Division New Delhi
31 pages
Basics of Replication SQL Server 2000
PDF
No ratings yet
Basics of Replication SQL Server 2000
7 pages
DBA Skills
PDF
No ratings yet
DBA Skills
19 pages
SQL Server System Databases
PDF
No ratings yet
SQL Server System Databases
2 pages
Replication
PDF
100% (1)
Replication
27 pages
SQL DBA CDC Work and How-To's
PDF
No ratings yet
SQL DBA CDC Work and How-To's
61 pages
SQL Server Replication Guide
PDF
No ratings yet
SQL Server Replication Guide
20 pages
Lecture 6 - Replication
PDF
No ratings yet
Lecture 6 - Replication
23 pages
SQL SERVER DBA Class Room Training
PDF
No ratings yet
SQL SERVER DBA Class Room Training
28 pages
8.database Mirroring
PDF
No ratings yet
8.database Mirroring
16 pages
Microsoft SQL Server Architecture
PDF
No ratings yet
Microsoft SQL Server Architecture
18 pages
Untitled Document - 1
PDF
No ratings yet
Untitled Document - 1
5 pages
SQL Complete Notes
PDF
No ratings yet
SQL Complete Notes
82 pages
TSM Cli - TDP For SQL - Backing Up Microsoft SQL Server With IBM Tivoli Storage Manager - Sg246148
PDF
No ratings yet
TSM Cli - TDP For SQL - Backing Up Microsoft SQL Server With IBM Tivoli Storage Manager - Sg246148
296 pages
SQL Server 2012 Database Administration With Alwayson & Clustering Techniques
PDF
No ratings yet
SQL Server 2012 Database Administration With Alwayson & Clustering Techniques
9 pages
05 SCCM 2012 MP Replica
PDF
No ratings yet
05 SCCM 2012 MP Replica
14 pages
SQL Server 2005 Administration
PDF
No ratings yet
SQL Server 2005 Administration
6 pages
SQL 2008 Dba
PDF
100% (1)
SQL 2008 Dba
314 pages