场景:
主服务器:Server1
从服务器:Server2
订阅服务器: Server3
镜像DB: RepDB
配置:
1>配置SERVER3为分发服务器,在Server3上指定发布服务器SERVER1和SERVER2
2>在SERVER1和SERVER2上配置订阅服务器为Server3,并制定相同的快照文件夹
3>如果需要建立多种类型的复制,需要在SERVER1上运行
exec sp_replicationdboption @dbname='<PublicationDatabase>', @optname='publish', @value=true
exec sp_replicationdboption @dbname='<PublicationDatabase>', @optname='mergepublish', @value=true
4>为下列代理设置–PublisherFailoverPartner
快照代理(对于所有发布)
日志读取器代理(对于所有事务发布)
队列读取器代理(对于支持排队更新订阅的事务发布)
合并代理(对于合并订阅)
SQL Server 复制侦听器(replisapi.dll:用于使用 Web 同步进行同步的合并订阅)
SQL 合并 ActiveX 控件(对于与控件同步的合并订阅)
 
 
删除镜像后的维护
1>如果移除镜像数据库,复制继续在住数据库上运行,则无需做任何设置
2>如果移除主数据库,复制在镜像数据库上运行,则建议重新搭建复制

可以使用一下脚本来设置publisherfailoverpartner
DECLARE @publisherfailoverpartner NVARCHAR(30)
SET @publisherfailoverpartner='@publisherfailoverpartner'
IF @publisherfailoverpartner='@publisherfailoverpartner'
BEGIN
PRINT 'Please change the value of @publisherfailoverpartner'
RETURN
END

DROP TABLE #profiles
CREATE TABLE #profiles (
profile_id INT,
profile_name sysname,
agent_type INT,
[TYPE] INT,
description VARCHAR(3000),
def_profile BIT)
--snapshot agent
INSERT INTO #profiles (profile_id, profile_name,
agent_type, [TYPE],description, def_profile)
EXEC sp_help_agent_profile @agent_type = 1;
--log reader agent
INSERT INTO #profiles (profile_id, profile_name,
agent_type, [TYPE],description, def_profile)
EXEC sp_help_agent_profile @agent_type = 2;
--Replication Merge Agent
INSERT INTO #profiles (profile_id, profile_name,
agent_type, [TYPE],description, def_profile)
EXEC sp_help_agent_profile @agent_type = 4;
--Replication Queue Reader Agent
INSERT INTO #profiles (profile_id, profile_name,
agent_type, [TYPE],description, def_profile)
EXEC sp_help_agent_profile @agent_type = 9;

--add parameter PublisherFailoverPartner
SELECT 'exec sp_add_agent_parameter @profile_id='+CAST(profile_id AS VARCHAR(10))+', @parameter_name=publisherfailoverpartner,@parameter_value=['+@publisherfailoverpartner+']' FROM #profiles WHERE def_profile=1
--check the result
SELECT 'exec sp_help_agent_parameter @profile_id='+CAST(profile_id AS VARCHAR(10)) FROM #profiles WHERE def_profile=1

参考:
http://www.cnblogs.com/stswordman/archive/2011/04/22/2024544.html

Replication--镜像+复制的更多相关文章

  1. replication set复制集

    replication set复制集  介绍 replicattion set 多台服务器维护相同的数据副本,提高服务器的可用性,总结下来有以下好处: 数据备份与恢复 读写分离 MongoDB 复制集 ...

  2. 17.1.1 How to Set Up Replication 设置复制:

    17.1.1 How to Set Up Replication 设置复制: 17.1.1.1 Setting the Replication Master Configuration 17.1.1. ...

  3. 17.1 Replication Configuration 复制配置

    17.1 Replication Configuration 复制配置 17.1.1 How to Set Up Replication 17.1.2 Replication Formats 17.1 ...

  4. Advanced Replication同步复制实验(基于Trigger&基于Materialized View)

    1. 高级复制和流复制介绍 1.1 高级复制(Advanced Replication) 高级复制也称为对称复制,分为多主体站点复制(Multiple Master Rplication).物化视图站 ...

  5. 17.1.2?Replication Formats 复制格式:

    17.1.2?Replication Formats 复制格式: 17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Ba ...

  6. 17.2?Replication Implementation 复制实施:

    17.2?Replication Implementation 复制实施: 17.2.1 Replication Implementation Details 17.2.2 Replication R ...

  7. 17.1 Replication Configuration 复制:

    17.1 Replication Configuration 复制: 17.1.1 How to Set Up Replication 17.1.2 Replication Formats 17.1. ...

  8. python Tricks —— list 镜像复制与 list comprehension 列表解析的顺序

    0. 对 list 镜像复制,a = [1, 2, 3] ⇒ [1, 2, 3, 3, 2, 1] a*2 ⇒ a = [1, 2, 3, 1, 2, 3] a.extend(reversed(a)) ...

  9. SQLServer 数据库镜像+复制方案

    目标: 主机做了Mirror和Replication,当主机出现问题时,Replication和Mirror实现自动的故障转移(Mirror 和Replication都切换到备机,而当主机 重新启动后 ...

  10. SQLServer 数据库镜像+复制切换方案

    目标: 主机做了Mirror和Replication,当主机出现问题时,Replication和Mirror实现自动的故障转移(Mirror 和Replication都切换到备机,而当主机 重新启动后 ...

随机推荐

  1. WinForm多线程+委托防止界面卡死

    1.当有大量数据需要计算.显示在界面或者调用sleep函数时,容易导致界面卡死,可以采用多线程加委托的方法解决 using System; using System.Collections.Gener ...

  2. 【图片】机器学习--名画风格 neural-style

    neural-style 学习画作风格,将风格施加到另外一张图片中 例如将名画<星夜>的风格施加到一副建筑照片中: 源码 https://github.com/jcjohnson/neur ...

  3. c# var的含义与用法

    VAR 是3.5新出的一个定义变量的类型其实也就是弱化类型的定义VAR可代替任何类型编译器会根据上下文来判断你到底是想用什么类型的至于什么情况下用到VAR 我想就是你无法确定自己将用的是什么类型就可以 ...

  4. objective c to pas

    https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol ...

  5. Lists、Sets、Maps和Collections2的使用

    1.Lists //Lists System.out.println("### Lists ###"); ArrayList<String> arrayList = L ...

  6. Dev的双击Gridview的DoubleClick

    注意: 是GridView的Double而不是GridControlprivate void gridView1_DoubleClick(object sender, EventArgs e){    ...

  7. Android 重写EditText回车事件

    之前遇到的问题没来得及记录下来,趁今晚有空就重新回忆并写下了. 我们在用到EditText这个空间时经常需要重写软键盘中的回车事件以配合我们接下来的响应,比如点击回车变成搜索.发送.完成等. Edit ...

  8. Servlet小案例总结

    亮点: 没有使用任何框架,视图层和业务层使用Servlet技术进行交互,持久层用java的jdbc工具类进行数据交互 较为底层,比较基础的工具类比较多,比如: BeanFactory工具类使用dom4 ...

  9. mysql的GTID复制和多源复制

    配置基于GTID的复制--------------------------------------------在参数文件/etc/my.cnf增加下面内容:主库master_info_reposito ...

  10. ROS Learning-032 (提高篇-010 Launch)Launch 深入研究 --- (启动文件编程)ROS 的 XML语法简介

    ROS 提高篇 之 Launch 深入研究 - 01 - 启动文件的编程 - ROS 的 XML语法简介 我使用的虚拟机软件:VMware Workstation 11 使用的Ubuntu系统:Ubu ...