Sqlserver 2008 restore

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

Thanks a lot.
amitabh04Asked:
Who is Participating?
 
WizillingCommented:
yes.

FYI - spid between 1 - 50 cant be kiiled
0
 
WizillingCommented:
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

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

Thanks.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Anthony PerkinsCommented:
>>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

0
 
WizillingCommented:
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.
0
 
amitabh04Author Commented:
Hi,
   Do I kill  process in 'sleeping' status for my DBname.

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

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.