|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 4:55 PM
Points: 1,597,
Visits: 2,770
|
|
I am trying to make a database can only be accessed by myself but not other users for some server migration purpose.
I would like to know when I setup a server to Single -user only, what is exactly is the single user, is it whoever to change the option to single-user?
I just want to make sure I am not accidently doing something no user even myself can ever access the database any more.
Thanks
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 2:33 AM
Points: 180,
Visits: 512
|
|
Limitations and Restrictions
If other users are connected to the database at the time that you set the database to single-user mode, their connections to the database will be closed without warning.
The database remains in single-user mode even if the user that set the option logs off. At that point, a different user, but only one, can connect to the database.
Prerequisites
Before you set the database to SINGLE_USER, verify that the AUTO_UPDATE_STATISTICS_ASYNC option is set to OFF. When this option is set to ON, the background thread that is used to update statistics takes a connection against the database, and you will be unable to access the database in single-user mode.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 4:55 PM
Points: 1,597,
Visits: 2,770
|
|
Mac1986 (10/22/2012)[/b] Limitations and Restrictions
If other users are connected to the database at the time that you set the database to single-user mode, their connections to the database will be closed without warning.
That is fine in our case.
The database remains in single-user mode even if the user that set the option logs off. At that point, a different user, but only one, can connect to the database.
Prerequisites
So, if the other user log on, then I as an adminstrator cannot log on, what to do for me to kick the user off, and relogin by myself?
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 37,640,
Visits: 29,895
|
|
KILL <user's session ID> USE <database in single user mode>
or set it to restricted user first, then single user once all the non-admins are out.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|