alwayson只讀節點資料檔案的磁碟被寫滿

ywxj_001發表於2017-11-15
環境:
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部落格 ” ,連結:http://blog.itpub.net/22996654/viewspace-2147264/,如需轉載,請註明出處,否則將追究法律責任。

相關文章