search
HomeDatabaseMysql TutorialSQL 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!
接下来就可以测试一下,在主服务器上新增一条记录或修改一条记录,在备份服务器上查看相关记
录是否被修改,事实上已被同步修改了。
由于本人使用的是繁体系统,所以都是繁体字,不过简体的就是一些术语更容易理解,一看就明白。
Statement
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
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

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

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software