Automatic MSSQL synchronization setting

Source: Internet
Author: User
Tags network function

Automatic MSSQL Synchronization
The following uses 117 and 75 as examples to describe: 117 release & distributor, 75 subscription Server

I. preparations:
1. Create a sqlagt user on 117 & 75, which belongs to the administrators group and is used to start the Sqlserveragent service (which is automatically started upon startup). If the local system account does not have the network function, an error may occur.

2. SQL registration in Enterprise Manager 117/75 must be the name of the local Machine and cannot be local or ip

3. Create 75 SQL registration on 117

4. If MSSQL is installed on 117/75 and the machine name has been changed, you need to modify the MSSQL registration Host Name:
4.1 check for SQL registration problems
Use master
Select srvid, srvname, datasource from sysservers
If the srvid field is 0 and the value of servname is different from that of datasource, run the following
4.2 modify Registration Name
USE master
GO
DECLARE @ serverproperty_servername varchar (100 ),
@ Servername varchar (100)
SELECT @ serverproperty_servername = CONVERT (varchar (100), SERVERPROPERTY ('servername '))
SELECT @ servername = CONVERT (varchar (100), @ SERVERNAME)
Select @ serverproperty_servername, @ servername
EXEC sp_dropserver @ server = @ servername
EXEC sp_addserver @ server = @ serverproperty_servername, @ local = 'local'
4.3 run 3.1 again, and the value of servname and datasource will be the same

5. Whether the extended storage process required by the system exists (if it does not exist, it needs to be restored ):
Sp_addextendedproc 'xp _ regenumvalues ', @ dllname = 'xpstar. dll'
Go
Sp_addextendedproc 'xp _ regdeletevalue ', @ dllname = 'xpstar. dll'
Go
Sp_addextendedproc 'xp _ regdeletekey ', @ dllname = 'xpstar. dll'
Go
Sp_addextendedproc xp_cmdshell, @ dllname = 'loglog70. dll'
Go

6. synchronization is performed through the Intranet, and port 1433 cannot be disabled on the Intranet, file sharing cannot be disabled, and default sharing cannot be deleted, such as D $ E $


Ii. Synchronization Configuration
117 role: the Host Name of the publishing and distribution server 117 is "117"
75 role: subscription server 75 server name "75"

1. Enterprise Manager --> select node 117
Tool --> copy --> Configuration Publishing, subscription server, and distribution
Next --> make "117" its own distributor --> snapshot folder (\ 117 \ d $ \ mssql \ ReplData) --> yes --> NO, use the following default settings --> complete
A message indicating that 117 is enabled as 117 is displayed.
After completion, the distribution library is created in 117, and the replication monitor item is displayed.

2. Tools --> copy --> create and manage Publishing, for example, synchronize KBOX
Select the database to be synchronized --> Click Create release --> next --> select the database to be synchronized --> next --> transaction release --> server running SQLServer2000 -->
Select the table to be synchronized (the table structure must have a primary key to be selected for synchronization) --> next --> release name (random) --> next --> complete

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

4. On the create and manage release page
Expand the database KBOX that has been created to publish --> select publish under this database --> then select force New subscription --> select 75 --> subscribe Database Name (default) --> consecutive shortest latencies -->
Yes. initialize the Architecture and Data. Check the "Start snapshot agent" option to start initialization immediately (for example, if the database and table structure to be synchronized are available on instance 75, select "no") --> next --> finish
After the subscription is completed, a message is displayed, indicating that the subscription is successfully created: 75.

5. Click copy monitor. The first time you will be prompted whether you want to automatically refresh the copy monitor, select Yes, and no longer prompt will be displayed.

6. Expand the replication Monitor and the Publishing Server --> 117 --> KBOX: KBOX
Click the refresh button to see 75: The KBOX status is running.
To the KBOX database on 75, we can see that the table structure and content have been updated synchronously.
Test to insert a data entry to any table in the 117KBOX database. The synchronized data is displayed on the 75 page.

Note: To add tables and change the table structure in the KBOX database, manually delete the table and re-force the subscription.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.