数据库复制.2台服务器,主数据库,第二台是只读的

问题描述:

假设您有 2 个数据库服务器,其中一个数据库是执行所有写入操作的主"数据库,它被视为真实/原始"数据库.另一台服务器的数据库是主数据库(从?)的镜像副本,用于应用程序的某个部分的只读操作.

Say you have 2 database servers, one database is the 'master' database where all write operations are performed, it is treated as the 'real/original' database. The other server's database is to be a mirror copy of the master database (slave?), which will be used for read only operations for a certain part of the application.

你如何设置一个从数据库来镜像主数据库上的数据?据我了解,slave/readonly 数据库是使用master db 的事务日志文件来镜像数据是否正确?
在从数据库镜像数据的频率方面,我有哪些选择?(实时/每 x 分钟?).

How do you go about setting up a slave database that mirrors the data on the master database? From what I understand, the slave/readonly database is to use the master db's transaction log file to mirror the data correct?
What options do I have in terms of how often the slave db mirrors the data? (real time/every x minutes?).

您需要的是 SQL Server 2005 中的事务复制.它将在发布者(即主")数据库更新时近乎实时地复制更改.

What you want is called Transactional Replication in SQL Server 2005. It will replicate changes in near real time as the publisher (i.e. "master") database is updated.

这里有一个很好的设置指南.