Home Database Mysql Tutorial sql2005 数据同步方法

sql2005 数据同步方法

Jun 07, 2016 pm 06:04 PM
data synchronization

复制技术可以确保分布在不同地点的数据自动同步更新,从而保证数据的一致性,就无需编程实现客户端和服务器端数据同步了!大大提高了工作效率!

主要是要注意权限的问题,一般做发布/订阅,建议你做如下准备工作:

1.发布服务器,订阅服务器都创建一个同名的windows用户,并设置相同的密码,做为发布快照文件夹的有效访问用户
我的电脑
--控制面板
--管理工具
--计算机管理
--用户和组
--右键用户
--新建用户
--建立一个隶属于administrator组的登陆windows的用户
2.在发布服务器上,新建一个共享目录,做为发布的快照文件的存放目录,操作:
我的电脑--D:\ 新建一个目录,名为: PUB
--右键这个新建的目录
--属性--共享
--选择"共享该文件夹"
--通过"权限"按纽来设置具体的用户权限,保证第一步中创建的用户具有对该文件夹的所有权限
--确定

3.设置SQL代理(SQLSERVERAGENT)服务的启动用户(发布/订阅服务器均做此设置)
开始--程序--管理工具--服务
--右键SQLSERVERAGENT
--属性--登陆--选择"此账户"
--输入或者选择第一步中创建的windows登录用户名
--"密码"中输入该用户的密码
4.设置SQL Server身份验证模式,解决连接时的权限问题(发布/订阅服务器均做此设置)
企业管理器
--右键SQL实例--属性
--安全性--身份验证
--选择"SQL Server 和 Windows"
--确定
5.在发布服务器和订阅服务器上互相注册
企业管理器
--右键SQL Server组
--新建SQL Server注册...
--下一步--可用的服务器中,输入你要注册的远程服务器名--添加
--下一步--连接使用,选择第二个"SQL Server身份验证"
--下一步--输入用户名和密码
--下一步--选择SQL Server组,也可以创建一个新组
--下一步--完成
6.对于只能用IP,不能用计算机名的,为其注册服务器别名
(在连接端配置,比如,在订阅服务器上配置的话,服务器名称中输入的是发布服务器的IP)
开始--程序--Microsoft SQL Server--客户端网络实用工具
--别名--添加
--网络库选择"tcp/ip"--服务器别名输入SQL服务器名
--连接参数--服务器名称中输入SQL服务器ip地址
--如果你修改了SQL的端口,取消选择"动态决定端口",并输入对应的端口号
##############################################################
补充
以下实现复制步骤(以快照复制为例)

运行平台SQL SERVER 2005

一、准备工作:

1.建立一个 WINDOWS 用户,设置为管理员权限,并设置密码,作为发布快照文件的有效访问用户。

2.在SQL SERVER下实现发布服务器和订阅服务器的通信正常(即可以互访)。打开1433端口,在防火墙中设特例

3.在发布服务器上建立一个共享目录,作为发布快照文件的存放目录。例如:在D盘根目录下建文件夹名为SqlCopy

4.设置SQL 代理(发布服务器和订阅服务器均设置)本篇文章发表于www.xker.com(小新技术网)

打开服务(控制面板---管理工具---服务)

---右击SQLSERVER AGENT---属性---登录---选择“此帐户“

---输入或选择第一步中创建的WINDOWS 用户

---“密码“中输入该用户密码

5.设置SQL SERVER 身份验证,解决连接时的权限问题(发布、订阅服务器均设置)

步骤为:对象资源管理器----右击SQL实例-----属性----安全性----服务器身份验证------选“SQL Server和WINDOWS“,然后点确定

6.开启SQL Server 2005的网络协议TCP/IP和管道命名协议并重启网络服务。

7.在SQL Server中创建步骤1中对应的系统用户登陆名,作为发布数据库的拥有者(设置为dbo_owner和public)。

8.以系统超级用户sa登陆SQL Server建立数据库和表。

9.发布服务器和订阅服务器互相注册

步骤如下:视图----单击以注册服务器----右键数据库引擎----新建服务器注册-----填写要注册的远程服务器名称------身份验证选“SQL Server验证“-----用户名(sa) 密码------创建组(也可不建)-----完成。

10.对于只能用IP,不能用计算机名的,为其注册服务器别名

二、开始:

发布服务器配置(在发布服务器上配置发布和订阅)

1. 选择 复制 节点

2. 右键本地发布 ----下一步---------系统弹出对话框看提示----直到“指定快照文件夹“

----在“快照文件夹“中输入准备工作中创建的目录(指向步骤3所建的共享文件夹)------选择发布数据库-------选择发布类型-------选择订阅服务器类型-------选择要发布的对象------设置快照代理-------填写发布名称。本篇文章发表于www.xker.com(小新技术网)

3. 右键本地订阅--------选择发布服务器-------选择订阅方式(如果是在服务器方订阅的话选择推送订阅反之

选择请求订阅)-------填加订阅服务器--------选择代理计划(一般选择连续运行)---------其余选择默认项。

至此, SQL SERVER 2005 同步复制就完成了。使用复制技术,用户可以将一份客户端的数据发布到多台服务器上,从而使不同的服务器用户都可以在权限的许可的范围内共享这份数据。复制技术可以确保分布在不同地点的数据自动同步更新,从而保证数据的一致性,就无需编程实现客户端和服务器端数据同步了!大大提高了工作效率!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to implement synchronous and asynchronous data processing functions in PHP How to implement synchronous and asynchronous data processing functions in PHP Sep 25, 2023 pm 05:33 PM

How to implement synchronous and asynchronous data processing functions in PHP. With the continuous development of the Internet, real-time updating of web pages and asynchronous processing of data have become more and more important. As a popular back-end development language, PHP also needs to be able to handle synchronous and asynchronous requests for data. This article will introduce how to implement synchronous and asynchronous data processing functions in PHP and provide specific code examples. 1. Synchronous processing of data Synchronous processing of data means that after the request is sent, wait for the server to complete processing and return the data before continuing to the next step. The following is

Use MySQL to implement data replication and synchronization in Go language Use MySQL to implement data replication and synchronization in Go language Jun 18, 2023 am 08:21 AM

With the development of Internet applications and the continuous updating of adopted technologies, data replication and synchronization have become increasingly necessary functions for many systems. In the Golang language, many people hope to use the MySQL database for data replication and synchronization. This article will introduce how to use MySQL to achieve data replication and synchronization in the Go language. Determine the requirements for replication and synchronization Before starting to implement data replication and synchronization, we need to first determine the requirements for data replication and synchronization. For example, we need to know which tables require data

PHP and SOAP: How to achieve synchronous and asynchronous processing of data PHP and SOAP: How to achieve synchronous and asynchronous processing of data Jul 28, 2023 pm 03:29 PM

PHP and SOAP: How to implement synchronous and asynchronous processing of data Introduction: In modern web applications, synchronous and asynchronous processing of data are becoming more and more important. Synchronous processing refers to processing only one request at a time and waiting for the completion of the request before processing the next request; asynchronous processing refers to processing multiple requests at the same time without waiting for the completion of a certain request. In this article, we will introduce how to use PHP and SOAP to achieve synchronous and asynchronous processing of data. 1. Introduction to SOAP SOAP (SimpleObject

How to implement data replication and data synchronization in distributed systems in Java How to implement data replication and data synchronization in distributed systems in Java Oct 09, 2023 pm 06:37 PM

How to implement data replication and data synchronization in distributed systems in Java. With the rise of distributed systems, data replication and data synchronization have become important means to ensure data consistency and reliability. In Java, we can use some common frameworks and technologies to implement data replication and data synchronization in distributed systems. This article will introduce in detail how to use Java to implement data replication and data synchronization in distributed systems, and give specific code examples. 1. Data replication Data replication is the process of copying data from one node to another node.

How to use Redis to achieve distributed data synchronization How to use Redis to achieve distributed data synchronization Nov 07, 2023 pm 03:55 PM

How to use Redis to achieve distributed data synchronization With the development of Internet technology and the increasingly complex application scenarios, the concept of distributed systems is increasingly widely adopted. In distributed systems, data synchronization is an important issue. As a high-performance in-memory database, Redis can not only be used to store data, but can also be used to achieve distributed data synchronization. For distributed data synchronization, there are generally two common modes: publish/subscribe (Publish/Subscribe) mode and master-slave replication (Master-slave).

How to sync data from Xiaomi phone to Alipay How to sync data from Xiaomi phone to Alipay Mar 14, 2024 pm 08:10 PM

Today, the synchronization of mobile phones with various life and financial applications has become increasingly important. Among them, Alipay has a large number of sports welfare activities. You only need to detect users’ sports data to participate in various activities in Alipay and obtain rewards to encourage sports. However, many friends are very confused about how the data in Xiaomi Sports should be. To synchronize with Alipay, in the following article, the editor of this website will provide you with a detailed step-by-step guide, hoping to help everyone in need. Open the Xiaomi Mi Band app on your phone, click "Me" in the lower right corner, then select "Settings" and then click "Check for Updates" to make sure the Mi Sports app has been updated to the latest version. Sometimes, when entering the Xiaomi Sports app, it will automatically prompt that an update is required. Updating

Use Gin framework to implement data synchronization and backup functions Use Gin framework to implement data synchronization and backup functions Jun 22, 2023 am 09:40 AM

As the amount of data continues to increase, data management and backup have become increasingly important. In modern Internet applications, using the Gin framework to implement data synchronization and backup functions has become an important part. The Gin framework is a lightweight Go language web framework that adopts the MVC (Model-View-Controller) design pattern and aims to simplify the development of web applications. Web applications developed using the Gin framework can handle HTTP requests and responses quickly and efficiently, and are highly scalable and scalable.

How to use PHP database connection to achieve data synchronization and replication How to use PHP database connection to achieve data synchronization and replication Sep 08, 2023 pm 02:54 PM

How to use PHP database connection to achieve data synchronization and replication In many web applications, data synchronization and replication are very important. For example, when you have multiple database servers, you may want to ensure that the data on these servers is kept in sync so that users always get the latest data when they access your application. Fortunately, using PHP database connections, you can easily synchronize and replicate your data. This article will introduce the steps to use PHP database connection to achieve data synchronization and replication, and provide corresponding code examples for

See all articles