Monday, October 1, 2012

The database could not be exclusively locked to perform the operation. (Microsoft SQL Server, Error: 5030)

When you try to rename a database, you get the following error message:

Problem:
The database could not be exclusively locked to perform the operation. (Microsoft SQL Server, Error: 5030)

This can be resolved by the following:

sp_who

Check which Process id use your database (dbname) and kill the process:

kill 15

Where spid = 15 is the process that lock the database you are trying to have a lock on.

No comments:

Post a Comment