简体   繁体   English

在软件级别复制SQL Server?

[英]SQL Server replication at the software level?

I have a need to make a remote connection through a DSL line (getting about 16k/s) to a SQL Express 2005 instance much faster. 我需要通过DSL线(约16k / s)到SQL Express 2005实例的远程连接要快得多。

I think I can do it by having a SQL Express 2005 instance on the client's local machine and have it be a cached version of the data on the server. 我想我可以通过在客户端的本地计算机上具有SQL Express 2005实例并将其作为服务器上数据的缓存版本来实现。

I'm planning to allow changes to the remote server only and then require the user pull down updates from it occasionally. 我打算只允许更改远程服务器,然后要求用户偶尔从中拉出更新。 It's not ideal, but it'll work. 这不是理想的方法,但是会起作用。

So, does SQL Express support me querying across the network something like: 因此,SQL Express是否支持我在整个网络中进行查询,例如:

INSERT INTO local.dbo.users (id, username, email, timestamp_modified)
    SELECT remote.dbo.users(id, username, email, timestamp_modified) 
        WHERE remote.dbo.users.timestamp_modified > LAST MODIFIED

For one you can use real Replication. 您可以使用一个真正的复制。 You should also look into Service Broker. 您还应该研究Service Broker。 Both allow you to push the data from remote to a SQL Express instance. 两者都允许您将数据从远程推送到SQL Express实例。 Service Broker performs and scales much better, is proven to work over slow DSL connections, but has a steep learning curve. Service Broker的性能和扩展性要好得多,被证明可以在缓慢的DSL连接上工作,但是学习曲线却很陡。 Replicaiton is easy to set up but you'll have to live with it's limitations. Replicaiton易于设置,但您必须忍受其局限性。

Using linked servers like you plan is not going to work. 使用您计划的链接服务器将无法正常工作。 Is unreliable, slow, and doing updates over a linked server requires you to set up distributed transaction. 是不可靠,缓慢的,并且通过链接服务器进行更新需要您设置分布式事务。

Why write something that has already been built and is available to you with the product you already have installed? 为什么要写一些已经构建好的东西,以及已经安装的产品可以使用的东西?

You should look into Log Shipping over your DSL line. 您应该通过DSL线路查看日志传送。 It is a very reliable SQL Server product and has been tested extensively. 它是一种非常可靠的SQL Server产品,并且已经过大量测试。

http://msdn.microsoft.com/en-us/library/ms187103.aspx http://msdn.microsoft.com/en-us/library/ms187103.aspx

Although the express edition does not have SQL Server Agent, there are workarounds that you can use: 尽管快速版没有SQL Server代理,但是您可以使用一些解决方法:

http://blog.willbeattie.net/2009/07/log-shipping-in-sql-server-express-2008.html http://blog.willbeattie.net/2009/07/log-shipping-in-sql-server-express-2008.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM