Best practices for restart a machine hosting MS SQL Server

%3CLINGO-SUB%20id%3D%22lingo-sub-1388360%22%20slang%3D%22en-US%22%3EBest%20practices%20for%20restart%20a%20machine%20hosting%20MS%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1388360%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20your%20support%20on%20the%20below%20scenario.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMS%20SQL%20SERVER%20instance%20is%20running%20on%20Windows%20Server%202012%20R2.%3C%2FP%3E%3CP%3EDo%20I%20need%20to%20stop%20the%20%E2%80%9DMSSQLSERVER%22%20service%20before%20restarting%20a%20Windows%20Server%20OS%20on%20Windows%20%22shutdown%20%2Fr%22%20command%20or%20Windows%20GUI%20%22Restart%22%20to%20prevent%20data%20corruption%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20the%20OS%20shutdown%20sequense%20runs%20%22net%20stop%20SQL%20Server%20(MSSQLSERVER)%22%20in%20the%20background%20and%20does%20a%20safe%20restart%2C%20is%20that%20correct%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERegards%2C%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1388360%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECompute%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EManagement%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1389350%22%20slang%3D%22en-US%22%3ERe%3A%20Best%20practices%20for%20restart%20a%20machine%20hosting%20MS%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1389350%22%20slang%3D%22en-US%22%3E%3CP%3EGenerally%20speaking%20windows%20will%20wait%2020%20-%2030%20seconds%20for%20services%20to%20gracefully%20close.%20If%20you%20think%20more%20time%20is%20needed%20you%20can%20extend%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CSTRONG%3EWaitToKillServiceTimeout%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fservices%2Fservice-control-handler-function%3Fredirectedfrom%3DMSDN%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fservices%2Fservice-control-handler-function%3Fredirectedfrom%3DMSDN%3C%2FFONT%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%26nbsp%3B%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%26nbsp%3B(please%20don't%20forget%20to%20mark%20helpful%20replies)%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Visitor

Hello Everyone,

 

I need your support on the below scenario.

 

MS SQL SERVER instance is running on Windows Server 2012 R2.

Do I need to stop the ”MSSQLSERVER" service before restarting a Windows Server OS on Windows "shutdown /r" command or Windows GUI "Restart" to prevent data corruption?

 

I think the OS shutdown sequense runs "net stop SQL Server (MSSQLSERVER)" in the background and does a safe restart, is that correct?

 

Regards,

1 Reply

Generally speaking windows will wait 20 - 30 seconds for services to gracefully close. If you think more time is needed you can extend WaitToKillServiceTimeout

  

https://docs.microsoft.com/en-us/windows/win32/services/service-control-handler-function?redirectedf...

  

 (please don't forget to mark helpful replies)

 

 

 

www.000webhost.com