Set database into single user mode

Today when I need to run DBCC CHECKDB on our customer’s Team Foundation data tier server to repair the affected databases. When I tried to repair the affected database, there is a message “Repair statement not processed. Database needs to be in single user mode.” Single-user mode specifies that only one user at a time can access the database and is generally used for maintenance actions.

To change a database into single user mode, perform the following steps:

Using SQL Server Management Studio.
1. Right click the related database then click Properties.
2. Choose Option page.
3. From Restrict Access option, select SINGLE_USER.
4. Click OK and Open Connections dialog will appear. Click Yes if you want to close all connection connected to the database and change the database on single user mode.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: