SQL Server 2005 同步复制技术
SQL Server 2005 同步复制技术实现sql语句。
一、准备工作:1.建立一个 WINDOWS 用户,设置为管理员权限,并设置密码,作为发布快照文件的有效访问用户。
2.在SQL SERVER下实现发布服务器和订阅服务器的通信正常(即可以互访)。打开1433端口,在防火墙中设特例
3.在发布服务器上建立一个共享目录,作为发布快照文件的存放目录。例如:在D盘根目录下建文件夹名为SqlCopy
4.设置SQL 代理(发布服务器和订阅服务器均设置)
打开服务(控制面板---管理工具---服务)
---右击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所建的共享文件夹)------选择发布数据库-------选择发布类型-------选择订阅服务器类型-------选择要发布的对象------设置快照代理-------填写发布名称。
3. 右键本地订阅--------选择发布服务器-------选择订阅方式(如果是在服务器方订阅的话选择推送订阅反之选择请求订阅)-------填加订阅服务器--------选择代理计划(一般选择连续运行)---------其余选择默认项。
至此, SQL SERVER 2005 同步复制就完成了。使用复制技术,用户可以将一份客户端的数据发布到多台服务器上,从而使不同的服务器用户都可以在权限的许可的范围内共享这份数据。复制技术可以确保分布在不同地点的数据自动同步更新,从而保证数据的一致性,就无需编程实现客户端和服务器端数据同步了!大大提高了工作效率!
在安装完Microsoft SQL Server 2005 后,发现从Microsoft SQL Server Management Studio 连接到服务器时,如果在服务器名称处填写的不是机器名,而是IP地址时,连接总是提示失败,提示信息为:
无法连接到10.114.*.*
其他信息:
已成功与服务器建立连接,但是在登录过程中发生错误。(provider:命名管道提供程序,error:0-管道的另一端上无任何进程。)(Microsoft SQL Server,错误:233)
解决方法:打开“开始—所有程序—Microsoft SQL Server 2005 —配置工具—SQL Server 配置管理器”,在弹出的窗体中,找到“SQL Server 2005 网络配置”,把“MSSQLSERVER的协议”下的“Named Pipes”和“TCP/IP”启用,然后重新启动SQL Server 即可。
下面简单的说明
1、在主DB服务器(MASTERDB)上,设置SQL Server 验证方式,登入:aa,密码:aa
2、在备份机上把主服务器中的数据库结构导入。
3、在主服务器上进入SQL Server Management Studio,选择複写节点,右击本机发行集,设定散发。
4、在主服务器上进入SQL Server Management Studio,选择複写节点,右击本机发行集--新增发行集--
下一步-- 选择要同步的资料库--下一步 发行集类型选择交易式发行集(其它的几种类型有其描述,根
据不同需要选择不同类型)--下一步 在发行的物件中选择要同步的资料表 --下一步--下一步选择立即
建立快照集……--下一步 点击安全性设定 选择以SQL Server Agent服务账户执行,连接到发行者选使
用下列的SQL Server登入方式,输入登入名,密码及确认密码--确定--完成 设置发行集名称--
完成。
5、在备份服务器上进入数据库管理平台,选择複写节点,右击本机订阅--新增订阅--下一步 设
置发行者(主服务器)--下一步--在散发者端执行--下一步--下一步--设定属性--确定-
完成。OK!
接下来就可以测试一下,在主服务器上新增一条记录或修改一条记录,在备份服务器上查看相关记
录是否被修改,事实上已被同步修改了。
由于本人使用的是繁体系统,所以都是繁体字,不过简体的就是一些术语更容易理解,一看就明白。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

"Usage of Division Operation in OracleSQL" In OracleSQL, division operation is one of the common mathematical operations. During data query and processing, division operations can help us calculate the ratio between fields or derive the logical relationship between specific values. This article will introduce the usage of division operation in OracleSQL and provide specific code examples. 1. Two ways of division operations in OracleSQL In OracleSQL, division operations can be performed in two different ways.

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

What is Identity in SQL? Specific code examples are needed. In SQL, Identity is a special data type used to generate auto-incrementing numbers. It is often used to uniquely identify each row of data in a table. The Identity column is often used in conjunction with the primary key column to ensure that each record has a unique identifier. This article will detail how to use Identity and some practical code examples. The basic way to use Identity is to use Identit when creating a table.

When Springboot+Mybatis-plus does not use SQL statements to perform multi-table adding operations, the problems I encountered are decomposed by simulating thinking in the test environment: Create a BrandDTO object with parameters to simulate passing parameters to the background. We all know that it is extremely difficult to perform multi-table operations in Mybatis-plus. If you do not use tools such as Mybatis-plus-join, you can only configure the corresponding Mapper.xml file and configure The smelly and long ResultMap, and then write the corresponding sql statement. Although this method seems cumbersome, it is highly flexible and allows us to

How to use SQL statements for data aggregation and statistics in MySQL? Data aggregation and statistics are very important steps when performing data analysis and statistics. As a powerful relational database management system, MySQL provides a wealth of aggregation and statistical functions, which can easily perform data aggregation and statistical operations. This article will introduce the method of using SQL statements to perform data aggregation and statistics in MySQL, and provide specific code examples. 1. Use the COUNT function for counting. The COUNT function is the most commonly used

Solution: 1. Check whether the logged-in user has sufficient permissions to access or operate the database, and ensure that the user has the correct permissions; 2. Check whether the account of the SQL Server service has permission to access the specified file or folder, and ensure that the account Have sufficient permissions to read and write the file or folder; 3. Check whether the specified database file has been opened or locked by other processes, try to close or release the file, and rerun the query; 4. Try as administrator Run Management Studio as etc.
