AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题 / 335152
Accepted
Shivkumar Mallesappa
Shivkumar Mallesappa
Asked: 2024-01-24 18:09:37 +0800 CST2024-01-24 18:09:37 +0800 CST 2024-01-24 18:09:37 +0800 CST

事务复制 - 可用性组中的问题

  • 772
这个问题是从 Stack Overflow 迁移来的,因为它可以在 Database Administrators Stack Exchange 上找到答案。昨天迁移了 。

我们有 3 节点 SQL Server 集群(Always On 可用性组)。

我想在配置为异步的第三个节点上实现事务复制。

当我尝试创建 Publisher 时,最初出现错误: 

This database is not enabled for publication.
Unable to execute procedure. The database is not published. Execute the procedure in a database that is published for replication.
Changed database context to 'prod'. (.Net SqlClient Data Provider)

然后我尝试使用以下命令添加用于发布的数据库。

USE prod
EXEC sp_replicationdboption @dbname = 'prod',
@optname = 'publish',
@value = 'true'
GO

我收到另一个错误:

Msg 3906, Level 16, State 2, Procedure sys.sp_MSdrop_pub_tables, Line 6 [Batch Start Line 0]
Failed to update database "prod" because the database is read-only.

上述错误令人惊讶,因为我可以在数据库选项中看到“只读”选项为“假”。

在此输入图像描述

然后我尝试使用以下命令修复更新问题:

USE prod GO
ALTER DATABASE [prod] SET READ_WRITE WITH NO_WAIT
GO

现在我面临错误:

Msg 1468, Level 16, State 3, Line 9
The operation cannot be performed on database "prod" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.
Msg 5069, Level 16, State 1, Line 9
ALTER DATABASE statement failed.

我尝试在节点 2 上进行“prod”数据库发布,但出现以下错误:

Msg 976, Level 14, State 1, Line 1
The target database, 'prod', is participating in an availability group and is currently not accessible for queries.
Either data movement is suspended or the availability replica is not enabled for read access. 
To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group.  
For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.

以下是我的集群配置: 在此输入图像描述

为了在节点 3 或节点 2 上启用事务复制,我必须执行哪些步骤或配置?

我在这里做错了什么或错过了什么?

sql-server
  • 1 1 个回答
  • 27 Views

1 个回答

  • Voted
  1. Best Answer
    GAURAV RATHOD
    2024-01-25T13:29:39+08:002024-01-25T13:29:39+08:00

    您无法在只读副本上创建发布。您只能在可读写的主设备上执行此操作。

    • 1

相关问题

  • SQL Server - 使用聚集索引时如何存储数据页

  • 我需要为每种类型的查询使用单独的索引,还是一个多列索引可以工作?

  • 什么时候应该使用唯一约束而不是唯一索引?

  • 死锁的主要原因是什么,可以预防吗?

  • 如何确定是否需要或需要索引

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve