SQL Server synchronization self-practice experience and questions

Source: Internet
Author: User

When I started to use SQL Server replication yesterday, I knew nothing about this, but what I wanted to achieve through this function was very clear-to complete data synchronization between the two SQL Server databases, that is, any data changes in database A can be promptly reflected in database B.
So there is a concentrated situation that needs to be confirmed: 1) database A and database B are on one machine
2) database A and database B are on two machines, but in the same network segment.
3) database A and database B are on two machines, but in different network segments.

First, start with your own machine.
As a test, I used the pubs database to generate an SQL script and created a mypubs database.
At the beginning, I registered all SQL servers with IP addresses, so I was unable to configure the release. After checking some information, I found that IP addresses and local names cannot be used. This problem was solved almost one morning.
There is no problem in synchronizing two databases on the same machine. (However, I found that the mypubs database does not have a primary key or a foreign key)

But there is a problem with the two machines. By the end of work yesterday, the synchronization problem between the two servers had not been solved.
This morning, I used two other Windows server operating systems for testing and synchronized them from one pubs to the other machine's mypubs! Happy!
However, if the mypubs of the row to be synchronized to your machine still does not work, I do not know if my operating system is XP.

Conclusion:
1. synchronization between two machine SQL servers can be achieved, and further verification is required for different network segments.
2. (doubt) Are there restrictions on primary keys and Foreign keys in subscribed databases and data tables?
-- It seems that there is no constraint, because if the selected subscription database is the pubs of the system itself, synchronization cannot be completed. Some reminders such as "Table titleauthor cannot be removed because it is used for replication" are prompted, resulting in failure.

Therefore, what you cannot determine is:
1. Is it possible to create a primary key and a foreign key constraint between data tables in the subscription database?
2. Must the operating system be Windows2000 Server?
3. Can databases of different network segments perform such synchronization?

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.