(Reprint) SQL Server AG cluster startup interim self-help is not the big move up

background

Last night a friend encountered AG cluster occurrence of unstable switching back and forth, so he WSFC friends using the command to restart the cluster from the command line

After the restart WSFC result clusters, not only not improved, leading to the AG can not be started, the primary and secondary replicas are in a state of being resolved

 

So the friend called to me for help, asked about the situation and the environment

surroundings

System: Windows2012R2

Database: SQL Server2014 SP2

Three machines, a control field, two database nodes

 


process

So I checked the log and SQL Server logs WSFC did not find useful information, stop seeing more and more time, but to let the recovery business, but AG is resolved in state

Unable to do anything, including: backing up the database, detach the database, delete AG, etc.

 

Continue friends asked about the database backup, the database is a perfect day, every hour a day standby, the situation is from the last day has been prepared 40 minutes

If you restore the database to resume operations, it will result in 40 minutes of data loss

 

At that time Jizhongshengzhi, may direct copy mdf ldf file and attach files and can recover the database, so the SQL Server database nodes of the two services are stopped, and then directly to all databases and file mdf

ldf file copy it, move to another SQL Server server, the SQL Server database server is a stand-alone, and do not have any high-availability cluster

 

After the relocation is completed until all databases, additional database operations one by one, can think of is actually additional success!

After the completion of all the additional databases, create a login account, modify the program to connect, verify the connection, verify the data, re-open the business, business recovery, the whole process took about 2 hours

 


postscript

A day later, AG cluster repaired, and how to re-service database from the current SQL Server on a single machine to rejoin the cluster AG do?

Most people will use a variety of ways to move the library service node AG back from the stand-alone SQL Server, and then redo AG

Today, to go from the king did an experiment, experiment environment with friends in exactly the same environment, we found that just need to all library services on a stand-alone SQL Server separation,

Then the SQL Server service for all nodes in the AG stopped, and then copy the files mdf ldf files back all the nodes AG overwrite the original database files (do pay attention to backup)

Then start each node AG in the SQL Server service, AG not being given, everything is back to normal, of course, this approach downtime will be longer than the average method

 

important point:

1, copy the files to a single SQL Server database when you want to select a secondary copy of the master copy or copies of the synchronous mode

2, from stand-alone SQL Server database files to copy AG node when you want to copy to all of the nodes AG

 


to sum up

SQL Server database should not be validated, that is, whether the database has not been validated cluster, so this approach was a success

 

 

SQL Server2012 just launched from the beginning of AlwaysOn start, AlwaysOn database clustering technology will need to rely on the operating system WSFC do fail, until the SQL Server2017 too

For WSFC problem, even for experienced SQL Server DBA may not be able to get, because it involves deep-seated principles of Windows, some problems have to send dump file to Microsoft analysis allows Microsoft to resolve,

Always feel that Microsoft's technology is too closed, in any case, there is a temporary solution is better than none

 

original

Guess you like

Origin www.cnblogs.com/VicLiu/p/11771628.html
Recommended