Error 3101

Troubleshooting SQL Server

Troubleshooting

Error 3101

Severity Level 16
Message Text

Exclusive access could not be obtained because the database is in use.

Explanation

This error occurs when you attempt to load a backup while users are accessing the database. This error can occur with RESTORE DATABASE or RESTORE LOG. You cannot use the RESTORE DATABASE statement while the database is in use by any user, including yourself.

Action

Use the ALTER DATABASE SET SINGLE_USER to remove users from the database.

Or, wait until all users have finished using the database, and then use the RESTORE DATABASE statement. Make sure that you are not using the database being loaded when you issue the RESTORE DATABASE statement. Although not required, it is best to run the RESTORE DATABASE statement from the master database.

See Also

Backing Up and Restoring Databases

RESTORE