Hi,
We had 3 nodes SQL Server AlwaysOn, which version are all 12.0.5532.0.
A: Primary
B: Secondary -- Async
C: Secondary --Async
Recently two big databases are in suspended status on server B(which was in sync mode), one database(database2) has accumulated about 2TB log transactions, resume the log will take days and seems it will never catch up. we decided to remove the database from AG and shrink log then add it back.
Run below on node A:
ALTER AVAILABILITY GROUP [AG]
REMOVE DATABASE [database2];
Node A and C looking good, database removed from AG, database2 on node c is restoring status, on node a is normal status.
however on node B, it is in "not syncing/in recovery" status, checking the sql server availability group, error log and availability group health events, there is no log re this database, also check the sys.databases where shows the replica_id of that database2 is not null, checked the task manager, there is heavy reads/writes going on.
I tried to run:
ALTER DATABASE [database2] SET HADR OFF;
GO
but I know it won't help, tried to set to singe user mode, but could not put lock on that database.
Then I restarted the instance on node B, the database2 is in recovery status, and still take days to complete.
Lastly, I have to kill sqlserver.exe, remove database2's data and log files, restart sql server instance, and drop the database. I will make my work done and add the database back to AG later...
My question is I have suspended the database or removed the database from availability group, why it still sticks on one instance and keep doing its own job?
Also found after restarting the sql server instance, I cannot expend "databases" in SSMS, which giving me following message:
"
Skipping the default startup of database 'database1' because the database belongs to an availability group (Group ID: 65539). The database will be started by the availability group. This is an informational message only. No user action is required.
"
which is fine I am not worried about the node B now but wondering how AG behaves in such situation.