The method of setting the automatic synchronization MSSQL

With several of their servers to do under the synchronizing convenient data transfer and backup
MSSQL automatically synchronized 
here with 117 and 75 as an example: 117 publishing & distribution server 75 Subscriber 

First, the preparatory work: 
to establish sqlagt user on 1,117 & 75, belonging to the administrators group, used to start Sqlserveragent service (boot from the start), local system account local, will not have the network function, an error occurs 

on the 2,117 / 75 in the SQL enterprise Manager must be registered native name, can not be local or ip 

3, registered in the establishment of SQL 75 117 

4 117/75 changed the name of the machine if the MSSQL installation, you need to modify MSSQL register the host name: 
4.1 sql check the registration of 
use master 
the SELECT srvid, srvname, datasource from the sysservers 
If srvid field = 0, the value of the datasource is not servname Like, the steps required to run at 
4.2 modify the registration name 
the USE Master 
the GO 
the DECLARE @serverproperty_servername VARCHAR (100), 
@ servername VARCHAR (100) 
the SELECT = @serverproperty_servername the CONVERT (VARCHAR (100), the SERVERPROPERTY ( 'ServerName')) 
= @ Servername the CONVERT the SELECT (VARCHAR (100), @@ SERVERNAME) 
SELECT serverproperty_servername @, @ ServerName 
EXEC sp_dropserver Server @ = @ ServerName 
EXEC sp_addserver @ = @ serverproperty_servername Server, local @ = 'local' 
4.3 Run 3.1, servname again with datasource the same as the value 

5, the system needs to expand storage procedure exists (if there is no need to be restored): 
the sp_addextendedproc 'xp_regenumvalues', @ dllname = 'Xpstar.dll' 
Go 
the sp_addextendedproc 'xp_regdeletevalue', @ dllname = 'Xpstar.dll' 
Go 
the sp_addextendedproc 'xp_regdeletekey', @ dllname = 'Xpstar.dll' 
Go 
the sp_addextendedproc the xp_cmdshell, @ dllname = 'Xplog70.dll' 
Go 

6, synchronization through the network, the network can not close the 1433 port, you can not turn off file sharing, you can not delete the default shares such as D $ E $ 


Second, synchronization configuration 
117 Role: publishing, distribution server 117 host name is "117" 
75 Role: Subscriber server name 75 "75" 

1, Enterprise Manager -> Select the node 117 
Tools -> Copy -> Configure Publishing, Subscribers, and distribution 
Next -> make "117" has become its own distribution server -> snapshot folder (\\ 117 \ d $ \ mssql \ ReplData) -> Yes -> No, the following default settings -> completion 
after completion will prompt the success of the "117" enable as "117" distribution server 
will be established distribution library 117 is completed, will see the replication monitor item 

2, tools -> replication -> create and manage Publications such as synchronization KBOX 
selected to be synchronized database -> click to create a publication -> next -> select the database to be synchronized -> Next -> transactional publication -> run SQLServer2000 server -> 
choose what to sync the table (table structure of the table must have a primary key can be selected synchronous) -> Next -> Next -> name (optional) -> Next -> Finish 

3 on 75 KBOX create an empty database with the same name to be synchronized 

4, in the creation and management of publishing interface 
expansion has created a publication Database KBOX -> choose to publish in the library -> select a new mandatory subscription -> select 75 -> subscription database name (default) -> shortest lag time continuously -> 



5. Click Replication Monitor, for the first time will be asked if you want to automatically refresh Replication Monitor, select Yes, check Do not prompt 

6, expand Replication Monitor Publisher -> 117 -> KBOX: KBOX 
point Refresh button see 75: KBOX state is running 
to KBOX library on 75, you can see the table structure, content updates are synchronized to complete 
the test insert a data 117KBOX any database table, on 75 will see the same data synchronization over 

Note: KBOX new library table, table structure changes, you need to manually delete and re-enforce subscribe

Guess you like

Origin www.cnblogs.com/SyncNavigator8-4-1/p/10977483.html