Sql-server – Restarting database server or just the database

configurationsql serversql-server-2012

I am an application programmer. We have a SQL Server 2012 instance that hosts many related databases (around 12 databases). The vendors did some changes to one of the database and the application and they want us to reboot the database server. I did some research and found out that rebooting a db server is always not a great option unless changes have been made in the server configuration. Is there a way to restart just that database? Would that help?

Best Answer

You can cycle the database by doing:

alter database YourDatabase
set offline
with rollback immediate; -- this line will rollback ongoing transactions
go

And then to bring the database back online you can do:

alter database YourDatabase
set online;
go

This is a way to "restart" the database itself directly within SQL Server, without bouncing either the SQL Server service(s) or the server operating system itself.

As for the question of "would that help?", there is no way for us to answer that. You should be asking the vendor why do I need to restart the database server? Oftentimes people that don't know what they are particularly doing will cycle an entire environment after a migration/upgrade/change. Why? "Just in case".

If the vendor made a change directly to the database (DDL/DML, whatever) then that change takes effect immediately. So you really need to follow up with the vendor to find out why they want the database server restarted.