Tuesday, 2 October 2018

Error the database could not be exclusively locked to perform the operation in D365

Recently I had a task to restore Microsoft Dynamics 365 database (AxDB), so for safe side I think I should keep my old database backup by only change it's name. When I done that error occurred that " Error: The database could not be exclusively locked to perform the operation" and it cannot let me rename the database as shown below.

When trying to rename manually it throws this error:

When trying to rename by SQL command it throws this error:

So after some research over internet I have found the reason and solution for this error. The reason of this error is that multiple connection is established with database that is why it cannot let me rename the database so in order to fix the issue I have to kill all the connections to the database. I use the ALTER DATABASE command to resolve the issue.

  1. Set the database to single mode:
    • ALTER DATABASE YourDatabaseName
  2. Try to rename the database:
    • ALTER DATABASE YourCurrentDatabaseName MODIFY NAME = YourChangeDatabaseName
  3. Set the database to Multiuser mode:
    • ALTER DATABASE YourChangeDatabaseName

No comments:

Post a Comment

Set up Online VM for Dynamics 365 Finance and Operation for Technical and Functional Learning Purposes

In this blog, I will discuss how we set up an online VM for D365F&O for Technical and Functional learning purposes for free. Step: 1 Cl...