场景:
主服务器: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. Python实践练习:电话号码和 E-mail 地址提取程序

    题目: 假设你有一个无聊的任务,要在一篇长的网页或文章中,找出所有电话号码和邮件地址.如果手动翻页,可能需要查找很长时间.如果有一个程序,可以在剪贴板的文本中查找电话号码和 E-mail 地址,那你就 ...

  2. TCP粘包拆包基本解决方案

    上个小节我们浅析了在Netty的使用的时候TCP的粘包和拆包的现象,Netty对此问题提供了相对比较丰富的解决方案 Netty提供了几个常用的解码器,帮助我们解决这些问题,其实上述的粘包和拆包的问题, ...

  3. Rhythmk 一步一步学 JAVA (18) Axis2 创建 WebService

    一 > 环境配置 1.下载Axis2: 目前版本为 1.6.2 下载地址: http://axis.apache.org/axis2/java/core/ 下载 axis2-1.6.2-bin. ...

  4. [转] C# 获取程序运行目录

    来自 莫等闲也,原文 // 获取程序的基目录.  System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. System.Diagnosti ...

  5. Itext读取PDF模板文件渲染数据后创建新文件

    Maven导入依赖 <properties> <itextpdf.version>5.5.0</itextpdf.version> <itext-asian. ...

  6. AddComponentMenu

    [AddComponentMenu] The AddComponentMenu attribute allows you to place a script anywhere in the " ...

  7. 61. Rotate List(List)

    Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given ...

  8. H5 css学习

    p{text-indent:2em;}段前空两格   段落排版--行间距(行高) p{line-height:1.5em;} 段落排版--中文字间距.字母间距  h1{    letter-spaci ...

  9. controller,service,repository,component注解的使用对比

    项目中的controller层使用@controller注解 @Controller 用于标记在一个类上,使用它标记的类就是一个SpringMVC Controller 对象.分发处理器将会扫描使用了 ...

  10. GRUB使用说明

    从Red Hat Linux 7.2起,GRUB(GRand Unified Bootloader)取代LILO成为了默认的启动装载程序.相信LILO对于大家来说都是很熟悉的.这次Red Hat Li ...