Tuesday, April 27, 2010

System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Express.Smo)

I got this error while i was trying to restore SSP SQL Backp from source farm to new target farm SSP DB. Obviously DB by used by different processes which caused this error.

I did following steps to get it working( Make sure you can afford SQL DB outage during the restore )

1) Run the following SQL Query on SSP DB

USE master
GO

ALTER DATABASE   YOUR_SSP_DB_NAME
SET OFFLINE WITH ROLLBACK IMMEDIATE

2) Perform SQL Restore from Backup

3)
ALTER DATABASE    YOUR_SSP_DB_NAME
SET ONLINE


Thats It .

This process is much simpler than the Central Administration Restore process. For some weird reasons i kept on getting errors while trying with Central Administration console .

No comments:

Gray Failures: What is it and how to detect one?

If you are reading this article , i guess you are curious to know about gray failures and different methods to detect gray failures.  Hopefu...