ITPub博客

首页 > 数据库 > SQL Server > alwayson只读节点数据文件的磁盘被写满

alwayson只读节点数据文件的磁盘被写满

原创 SQL Server 作者:ywxj_001 时间:2017-11-15 01:31:40 0 删除 编辑
环境:
sqlserver alwayson架构
主节点1个
standby节点1个
辅助只读节点1个

问题:
辅助只读节点的数据文件和日志文件的磁盘被写满。
数据文件和日志文件在一个磁盘上。

解决办法:
增加一块磁盘。

1、修改文件的存放位置下次启动生效
alter database testDb modify file ( name = testDb, filename = 'G:\SQL_DATA\testDb\testDb.mdf');
--alter database testDb modify file ( name = testDb_log, filename = 'G:\SQL_DATA\testDb\testdb_log.ldf'); 

这里只更改数据文件位置。

2、关闭辅助只读节点的sqlserver服务

3、把
辅助只读节点上的数据文件拷贝到新的磁盘上,然后删除老数据文件

4、开启
辅助只读节点的sqlserver服务。
等待辅助只读节点上数据库自动进行recovery

recovery完成后,可以看到alwayson状态还是不正常,数据还是没有同步。

AlwaysOn Availability Groups connection with primary database established for secondary database 'gbs' on the availability replica 'BPM-NEW-DB02' with Replica ID: {b8841279-8139-43f8-ac69-827c302efd43}. This is an informational message only. No user action is required.
The recovery LSN (7249:925328:1) was identified for the database with ID 5. This is an informational message only. No user action is required.
3369 transactions rolled forward in database 'gbs' (5:0). This is an informational message only. No user action is required.
Recovery completed for database gbs (database ID 5) in 970 second(s) (analysis 210572 ms, redo 491239 ms, undo 0 ms.) This is an informational message only. No user action is required.
需要在辅助只读节点上执行:
ALTER DB param option: RESUME

AlwaysOn Availability Groups data movement for database 'gbs' has been resumed. This is an informational message only. No user action is required.
AlwaysOn Availability Groups connection with primary database established for secondary database 'gbs' on the availability replica 'BPM-NEW-DB02' with Replica ID: {b8841279-8139-43f8-ac69-827c302efd43}. This is an informational message only. No user action is required.
The recovery LSN (7249:925328:1) was identified for the database with ID 5. This is an informational message only. No user action is required.

辅助只读节点开始追主节点日志,同步恢复正常。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22996654/viewspace-2147264/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
在零售、金融、互联网行业从事数据库相关工作10余年,有丰富的数据库管理和架构的相关经验。 涉及SQLServer、Oracle、MySQL、PostgreSQL等多种数据库。 目前在一家互联网公司担任DBA经理。 负责整个集团数据库的架构设计和管理工作。

注册时间:2010-01-19

  • 博文量
    247
  • 访问量
    436193