[Text] Three minutes to learn the SQL Server replication function

Source: Internet
Author: User

According to network conditions, the latency may reach about 10 seconds, that is, the content added, deleted, and updated to the primary database can be synchronized to the standby database within 10 seconds.

The three-minute video operation is shown at the bottom. Do not forget to watch it.

1. Configure the distribution server

2. Create a release

3. Transaction Publishing

4. Select the table to be published. Note: Only tables with primary keys can be published.

5. This is a problem because we have this automatic numbering function in many tables, but you can modify the stored procedure to implement this function.

Added the set identity_insert xxxtable on function.

6. After the release is created, we have to force a new subscription to publish. If you want to synchronize to multiple machines, you only need to perform the operation multiple times and select different subscription servers.

7. Select the subscription server. You can select multiple servers at a time.

8. Select the database name on the subscription server.

9. Select whether to initialize or not as required. the initialization process is to create a storage process for transmission on the subscription server, create a table, and synchronize the initial data.

10. For a table created through initialization, structures such as automatic numbers are useless and need to be modified by yourself.

11. There is a stored procedure required for synchronization. You can change it based on your business needs. For example, the automatic numbering function is supported.

I personally use the following operations:

1. Put the Stored Procedure for replication on the primary database, and modify the content of the stored procedure as needed.

2. Do not write data to the primary database or back up the primary database.

3. Restore the database on the backup server

4. Use the copy Function

5. enable primary database write

In this way, the table structure of the primary and standby data is completely consistent.

After reading the picture above, I don't know if it takes three minutes. Of course, if I only read the picture, I may not understand it in ten minutes. I can only perform the operation.
Download video tutorials

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.