如何在SQL Server 2008中的不同服务器上同步数据库? [英] How to synchronize databases in different servers in SQL Server 2008?

查看:588
本文介绍了如何在SQL Server 2008中的不同服务器上同步数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个数据库具有相同的结构,一个在本地机器上,一个在公司的服务器上。每一个确定的时间,来自本地数据库的数据应该同步到服务器数据库。



我有一个大致的想法如何做到这一点 - 创建一个脚本以某种方式合并不在服务器DB上的信息,然后使此脚本作为服务器的计划作业运行。然而,我的问题在于我不是很有经验的这个事实。



SQL Server Management Studio提供了一个简单的方法来做这个)并生成这种脚本?这是我从头开始建立的吗?



我做了一些基本的google搜索,发现了术语复制,但我不完全理解它。



谢谢。

复制听起来像是一个很好的选择,但会有一些开销(不是技术开销,但知识需要支持它)。

$

b
$ b

另一个SQL Server选项是SSIS。 SSIS提供了图形工具来设计你想要做什么。如果适当,SSIS包也可以运行SQL语句。可以从SQL Server作业启动并调度SSIS包。



在选择解决方案时,应考虑同步规则的复杂性。例如,在合并数据时是否很难解决冲突,例如重复的键。如果规则很简单,可以很容易地创建SQL脚本。但是,复杂的冲突规则在脚本(或复制)中可能更难实现。


I have 2 databases that have the same structure, one on a local machine and one on the company's server. Every determined amount of time, the data from the local DB should be synchronized to the server DB.

I have a general idea on how to do this - create a script that somehow "merges" the information that is not on the server DB, then make this script run as a scheduled job for the server. However, my problem lies in the fact that I am not very well experienced with this.

Does SQL Server Management Studio provide an easy way to do this (some kind of wizard) and generates this kind of script? Is this something I'll have to build from scratch?

I've done some basic google searches and came across the term 'Replication' but I don't fully understand it. I would rather hear some input from people who have actually done this or who are good with explaining this kind of stuff.

Thanks.

解决方案

Replication sounds like a good option for this, but there would be some overhead (not technical overhead, but the knowledge need to support it).

Another SQL Server option is SSIS. SSIS provides graphical tools to design what you're trying to do. The SSIS package can also run SQL statements, if appropriate. An SSIS package can be started, and therefore scheduled, from a SQL Server job.

You should consider the complexity of the synchronization rules when choosing your solution. For example, would it be difficult to resolve conflicts, such as a duplicate key, when merging the data. A SQL script may be easy to create if the rules are simple. But, complex conflict rules may be more difficult to implement in a script (or, replication).

这篇关于如何在SQL Server 2008中的不同服务器上同步数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆