search
HomeDatabaseMysql TutorialSQL 2000怎么向SQL 2008 R2推送数据?

最近做的一个项目要获取存在于其他服务器的一些数据,为了安全起见,采用由其他服务器向我们服务器推送的方式实现。我们服务器使用的是sql server 2008 R2,其他服务器使用的都是SQL Server 2000,还都是运行在Windows XP上的,整个过程遇到了一些问题,也参

   最近做的一个项目要获取存在于其他服务器的一些数据,为了安全起见,,采用由其他“服务器”向我们服务器推送的方式实现。我们服务器使用的是sql server 2008 R2,其他“服务器”使用的都是SQL Server 2000,还都是运行在Windows XP上的,整个过程遇到了一些问题,也参考了一些文档,最终费了好多事才算搞定。

  【一、配置分发服务器】

  SQLServer 2000的复制服务包括三个角色:发布服务器、分发服务器和订阅服务器,关系如图1所示。

SQL 2000怎么向SQL 2008 R2推送数据? 三联

  图1

  其中发布服务器(数据源服务器)负责将数据的改变(如快照或事务等)传送到分发服务器中,由分发服务器将这些数据的改变分发到订阅服务器(目标服务器)中。其中分发服务器可以与发布服务器配置在一台服务器中。

  在配置分发服务器之前,首先需要打开SQL Server Agent服务并配置为自动启动。除此之外,对于数据库复制操作,SQL Server Agent不能使用系统账户登录,而必须为本地账户 ,可以在“登录”选项卡中,将“登录身份”设置为“此账户”,选择任一管理员账户即可(该管理员账户必须有密码)。

  然后就可以配置分发服务器了。在SQL Server 2000中,打开企业管理器,然后选择已经注册的SQL Server服务器(此处为本机服务器),然后选择“工具”菜单,选择“向导”,出现如图2所示的对话框。

SQL 2000怎么向SQL 2008 R2推送数据?

  图2

  选择“配置发布和分发向导”,确定后点击下一步出现如图3所示的对话框。

SQL 2000怎么向SQL 2008 R2推送数据?

  图3

  如果需要在当前数据库服务器上创建分发服务器,选择第一项即可,否则选择第二项,然后点击下一步,出现如图4所示的对话框。

SQL 2000怎么向SQL 2008 R2推送数据?

  图4

  这里需要注意的是,快照文件夹路径必须为网络路径,即\计算机名盘符默认共享路径,默认系统已经填好该项,直接点击下一步即可。如果出现出错的情况,可以打开cmd,输入“net share”查看当前共享中是否有盘符的默认共享,如果没有的话,使用“net share c$”即可创建默认共享,如果还不行可以访问参考链接2。

  成功后一路下一步即可配置好分发服务器。配置完分发服务器后,在注册的数据库服务器中就会出现“复制监视器一项”。

  【二、配置发布数据库】

  对于SQL Server 2000向2000推送数据,接下来的操作可以继续在企业管理器中完成,而对于SQL Server 2000向高版本SQL Server推送数据,则需要安装相应版本的SQL Server Management Studio,否则在最后一步连接订阅服务器时无法连接(出现“[sql-dmo]必须使用sql server2005 管理工具才能连接到此服务器”粗无)。我们的目标服务器安装的是SQL Server 2008 R2,所以需要安装SQL Server 2008 R2 Management Studio 。

  安装完成后首先连接到本机服务器,注意,服务器名称不能使用“(local)”或者IP,必须使用本机计算机名 ,登录方式使用SQL Server 身份认证。

  要配置待发布的数据库,首先需要确保该数据库的“恢复模式”为“完整”,右键单击数据库,选择属性,然后选择“选项”,在“恢复模式”中设置为“完整”即可。

  接下来就可以创建本地发布了,展开本机数据库,展开“复制”,在“本地发布”右键单击选择“新建发布”,如图5。

SQL 2000怎么向SQL 2008 R2推送数据?

  图5

  点击下一步后选择待发布的数据库,点击下一步即进入选择发布类型的对话框,如图6所示。

SQL 2000怎么向SQL 2008 R2推送数据?

  图6

  其中快照发布适合于表中无主键的数据表,每次复制时将数据全部复制过去;事务发布要求发布的数据表必须含有主键,否则无法复制。显然当数据量较大时,使用后者更好一些。如果数据库可以修改,建议将没有主键的表增加一个自增主键。这里由于源数据表中没有主键,也不能修改数据表结构,只能选择“快照发布”。点击下一步后出现选择要发布的内容的对话框,如果某个表不符合要求(如选择的事务发布但没有主键)则表名前出现禁止符号并且无法选择,如图7所示。

SQL 2000怎么向SQL 2008 R2推送数据?

  图7

  再次点击下一步后出现自定义筛选数据的对话框,如果不需要筛选数据,点击下一步进入设置快照代理时间。快照代理即负责生成数据库的修改,可以设置为按天、周、月重复执行。这里每天推送一次,所以也只需要生成一次快照,如图8所示。如果打算设置完订阅后立即推送一次,可以选择勾选第一个选项。

SQL 2000怎么向SQL 2008 R2推送数据?

  图8

  然后一路下一步即可完成发布的设置。

  【三、配置订阅】

  完成上述两步后就可以配置订阅了,订阅分为两种,分别是推式订阅和拉式订阅,前者由分发服务器连接订阅服务器,向订阅服务器推送数据;后者由订阅服务器连接分发服务器,向分发服务器拉取数据。所以在完成上一步后,“本地发布”中即出现了新创建的发布,右键单击选择“新建订阅”即可出现“新建订阅向导”对话框,点击下一步后已经选择了当前的订阅,继续点击下一步,出现订阅类型设置,如图9。

SQL 2000怎么向SQL 2008 R2推送数据?

  图9

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
MySQL's Role: Databases in Web ApplicationsMySQL's Role: Databases in Web ApplicationsApr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

MySQL: Building Your First DatabaseMySQL: Building Your First DatabaseApr 17, 2025 am 12:22 AM

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.

MySQL: A Beginner-Friendly Approach to Data StorageMySQL: A Beginner-Friendly Approach to Data StorageApr 17, 2025 am 12:21 AM

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

Is MySQL Beginner-Friendly? Assessing the Learning CurveIs MySQL Beginner-Friendly? Assessing the Learning CurveApr 17, 2025 am 12:19 AM

MySQL is suitable for beginners because: 1) easy to install and configure, 2) rich learning resources, 3) intuitive SQL syntax, 4) powerful tool support. Nevertheless, beginners need to overcome challenges such as database design, query optimization, security management, and data backup.

Is SQL a Programming Language? Clarifying the TerminologyIs SQL a Programming Language? Clarifying the TerminologyApr 17, 2025 am 12:17 AM

Yes,SQLisaprogramminglanguagespecializedfordatamanagement.1)It'sdeclarative,focusingonwhattoachieveratherthanhow.2)SQLisessentialforquerying,inserting,updating,anddeletingdatainrelationaldatabases.3)Whileuser-friendly,itrequiresoptimizationtoavoidper

Explain the ACID properties (Atomicity, Consistency, Isolation, Durability).Explain the ACID properties (Atomicity, Consistency, Isolation, Durability).Apr 16, 2025 am 12:20 AM

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL: Database Management System vs. Programming LanguageMySQL: Database Management System vs. Programming LanguageApr 16, 2025 am 12:19 AM

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL: Managing Data with SQL CommandsMySQL: Managing Data with SQL CommandsApr 16, 2025 am 12:19 AM

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft