This article is half-done without your Comment! *** Please share your thoughts via Comment ***
How to SHUTDOWN the SQL Server, is a very common question for all SQL Server beginners. Let me share few thoughts on this.
Whenever people are facing any problem with SQL Server, they only stop/start the SQL Server using Windows services.
Guys, you should not forget about the uncommitted transactions. I know, you don’t have more time to wait for uncommitted transactions but those transactions are crucial for database recovery.
I would suggest one thing; please execute CHECKPOINT before going for shutdown process.
The CHECKPOINT doesn’t care about your state of transactions whether they are COMMITTED or UNCOMMITTED. It just copies all dirty pages from Buffer Pool and writes out to the data files.
When you switch ON your SQL Server Database Server, it performs the crash recovery and brings your database online including those dirty pages, and it makes sure about the database consistency.
Use below T-SQL Script:
1 2 3 4 |
CHECKPOINT GO SHUTDOWN WITH NOWAIT GO |
Leave a Reply