Link to home
Start Free TrialLog in
Avatar of amitabh04
amitabh04

asked on

Sqlserver 2008 restore

Hi,
  How to do a restore of sqlserver 2008 database if multi user are logged in.

Thanks a lot.
Avatar of Wizilling
Wizilling
Flag of New Zealand image

do you have a enterprise edition of sql2008. if yes they you can do an online restore.

if you dont have a enterprise version then - first you have to kick all the users out and then do a restore.
do a sp_who2  and kill the active connections to the db

Avatar of amitabh04
amitabh04

ASKER

Hi,
  How do I know what are active connections after running sp_who2? What is the command to kill active connections?

Thanks.
Avatar of Anthony Perkins
>>How do I know what are active connections after running sp_who2?<<
You identify all the spids that have the dbname you are attempting to restore.
>>What is the command to kill active connections?<<
That would be KILL

find the connections to your DBname when you run sp_who2
find the corresponding spid

to kill ... exec

KILL spid_here

or you can just ask the users to log off while you restore.
Hi,
   Do I kill  process in 'sleeping' status for my DBname.

Thanks.
yes... as they hold a connection to ur db
Hi,
  So no matter what the status is kill all connections to my DB. Is that right?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Wizilling
Wizilling
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial