Occasionally, there are scenarios where you need to relocate database files physically. However, moving operations cannot be performed when dealing with online databases while the database remains in "online" status. To proceed, you must take the database offline.
Here is a step-by-step guide on accomplishing this through the SQL Server Management Studio interface:
Steps to Take MSSQL Database Offline
1. Log in to your SQL Server Management Studio. Please refer to how to connect SQL using management studio for more details.
2. Expand the Databases option and locate the database you wish to take offline.
3. Right-click the database and select Tasks >> Take Offline.
4. Once this is done, it will show you a message as below:
Steps to Bring MSSQL Database Online
1. Once you are done with transferring the database files, you will require to bring the database online again.
2. Again, expand the Databases option and locate your offline database.
3. Right-click the database and select Tasks >> Bring Online.
4. Once the process is done, it will show you a message as below:
That's all.
→ Looking to check the active connection on your MSSQL DB? Please refer to check active MSSQL connection for more details.