首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >消息“分发服务器未正确安装”

消息“分发服务器未正确安装”
EN

Database Administration用户
提问于 2022-09-28 15:33:51
回答 1查看 287关注 0票数 0

我明白

分发服务器未正确安装,无法启用数据库发布

当尝试执行sp_replicationdboption时。在运行EXEC sp_helpdistpublisher时,将正确显示发布服务器(它位于服务器和分发服务器上),但如果从发布服务器运行sp_get_distributor,则所有字段都为空。

EN

回答 1

Database Administration用户

发布于 2022-10-01 16:35:47

首先,要确保从publisher服务器连接到分发服务器。此外,您还需要设置所有复制帐户,并确保他们有正确的权限 您需要在分发服务器中创建分发数据库。_服务器

有一个例子是这个脚本:

代码语言:javascript
复制
-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables  
-- on the command line and in SQL Server Management Studio, see the 
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".

-- Install the Distributor and the distribution database.
DECLARE @distributor AS sysname;
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
DECLARE @directory AS nvarchar(500);
DECLARE @publicationDB AS sysname;
-- Specify the Distributor name.
SET @distributor = $(DistPubServer);
-- Specify the distribution database.
SET @distributionDB = N'distribution';
-- Specify the Publisher name.
SET @publisher = $(DistPubServer);
-- Specify the replication working directory.
SET @directory = N'\\' + $(DistPubServer) + '\repldata';
-- Specify the publication database.
SET @publicationDB = N'AdventureWorks2012'; 

-- Install the server MYDISTPUB as a Distributor using the defaults,
-- including autogenerating the distributor password.
USE master
EXEC sp_adddistributor @distributor = @distributor;

-- Create a new distribution database using the defaults, including
-- using Windows Authentication.
USE master
EXEC sp_adddistributiondb @database = @distributionDB, 
    @security_mode = 1;
GO

-- Create a Publisher and enable AdventureWorks2012 for replication.
-- Add MYDISTPUB as a publisher with MYDISTPUB as a local distributor
-- and use Windows Authentication.
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
-- Specify the distribution database.
SET @distributionDB = N'distribution';
-- Specify the Publisher name.
SET @publisher = $(DistPubServer);

USE [distribution]
EXEC sp_adddistpublisher @publisher=@publisher, 
    @distribution_db=@distributionDB, 
    @security_mode = 1;
GO

您还可以看看我完成它的方式:调用过程sp_adddistpublisher如下图所示

票数 0
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/317540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档