Replication--镜像+复制
场景:
主服务器: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--镜像+复制的更多相关文章
- replication set复制集
replication set复制集 介绍 replicattion set 多台服务器维护相同的数据副本,提高服务器的可用性,总结下来有以下好处: 数据备份与恢复 读写分离 MongoDB 复制集 ...
- 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. ...
- 17.1 Replication Configuration 复制配置
17.1 Replication Configuration 复制配置 17.1.1 How to Set Up Replication 17.1.2 Replication Formats 17.1 ...
- Advanced Replication同步复制实验(基于Trigger&基于Materialized View)
1. 高级复制和流复制介绍 1.1 高级复制(Advanced Replication) 高级复制也称为对称复制,分为多主体站点复制(Multiple Master Rplication).物化视图站 ...
- 17.1.2?Replication Formats 复制格式:
17.1.2?Replication Formats 复制格式: 17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Ba ...
- 17.2?Replication Implementation 复制实施:
17.2?Replication Implementation 复制实施: 17.2.1 Replication Implementation Details 17.2.2 Replication R ...
- 17.1 Replication Configuration 复制:
17.1 Replication Configuration 复制: 17.1.1 How to Set Up Replication 17.1.2 Replication Formats 17.1. ...
- 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)) ...
- SQLServer 数据库镜像+复制方案
目标: 主机做了Mirror和Replication,当主机出现问题时,Replication和Mirror实现自动的故障转移(Mirror 和Replication都切换到备机,而当主机 重新启动后 ...
- SQLServer 数据库镜像+复制切换方案
目标: 主机做了Mirror和Replication,当主机出现问题时,Replication和Mirror实现自动的故障转移(Mirror 和Replication都切换到备机,而当主机 重新启动后 ...
随机推荐
- C# 鼠标穿透窗体与恢复
转自原文 C# 鼠标穿透窗体与恢复 引入user32.dll [DllImport("user32.dll")] public static extern uint SetWind ...
- Android中RelativeLayout各个属性
android:layout_above="@id/xxx" --将控件置于给定ID控件之上 android:layout_below="@id/xxx" ...
- leetcode819
public class Solution { public string MostCommonWord(string paragraph, string[] banned) { //"a, ...
- Pandas透视表处理数据(转)
手把手教你用Pandas透视表处理数据(附学习资料) 2018-01-06 数据派THU 来源:伯乐在线 - PyPer 本文共2203字,建议阅读5分钟.本文重点解释pandas中的函数pivot ...
- Oracle的Spool导出数据
出自:http://wallimn.iteye.com/blog/472182 实践 只能在一个终端上的一个窗口中进行操作 第一步:连接oracle数据库 sqlplus qkp/mm_eft ...
- UNIX网络编程——socket的keep-alive(转)
第一部分 [需求] 不影响服务器处理的前提下,检测客户端程序是否被强制终了. [现状] 服务器端和客户端的Socket都设定了keepalive属性. 服务器端设定了探测次数等参数,客户端.服务器只是 ...
- C++Primer笔记-----day06
================================================================day06=============================== ...
- A Bug's Life(加权并查集)
Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs ...
- AspectJ的通知类型
- python的 pep8 规范(看完你会感谢我的!!!)
1 缩进与换行 每级缩进使用四个空格 2 限制每行的最大长度为79个字符 3 空行 顶层函数和类之间使用两个空行 类的方法之间用一个空行 在函数中使用空行表示不同逻辑段落 4 导入位于文件的顶部 5 ...