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都切换到备机,而当主机 重新启动后 ...
随机推荐
- Visual Studio 进行Excel相关开发,Microsoft.Office.Interop.Excel.dll库
1. Interop.Excel.dll 的查找 本文中将 Microsoft.Office.Interop.Excel.dll库简称为Interop.Excel.dll库 其实在使用Visual S ...
- Halcon学习(三)赋值与数组操作
assign : 对数据赋值,对数组的初始化.但不能对数组中的某一个值进行赋值. 举例:Tuple1 := [1,0,3,4,5,6,7,8,9] // 对数组进行初始化 Val := sin( ...
- 用letsencrypt搭建免费的https网站--nginx篇
环境:阿里云服务器centos7.3,nignx,letsencrypt做免费的https证书 Let’s Encrypt官网:https://letsencrypt.org/ 1.服务器开放端口:4 ...
- Git Hook 同步服务器代码
参考并转载自: http://www.embbnux.com/2014/09/05/git_server_let_code_auto_deploy/ http://www.chenyudong.com ...
- 全部物料的交期都要加上两天 V_OUT_PR
DUE_DATETIME加上两天就可以,如果只是部分物料的话,就要根据物料组或者别的一些条件去判断
- 前Forward / 延时Deferred
本章节描述了延时光照的渲染路径的细节,如果想了解延迟光照技术,请查阅Deferred Lighting Approaches article. Deferred Lighting is renderi ...
- 安装了Anaconda之后,Maya运行报错,Python 找不到 Maya 的 Python 模块
以前Maya用的好好地,结果安装了Anaconda之后,maya启动以后,日志就会报错(如下),只能自主建模,不能打开以前创建的模型,也不能导入fbx,错误提示就是Maya找不到Python模块,在网 ...
- 136. Single Number唯一的数字
[抄题]: Given an array of integers, every element appears twice except for one. Find that single one. ...
- sqlserver镜像相关资料
本文出处:http://blog.csdn.net/dba_huangzj/article/details/35995083 镜像(Mirroring) SQL Server镜像简介 计划搭建SQL ...
- debian 9 更换源 使用国内源 配置方法
配置前请先参考: https://wiki.debian.org/SourcesList https://www.debian.org/mirror/list https://mirrors.tuna ...