Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sqlserver 2008 restore

Posted on 2011-09-26
8
Medium Priority
?
215 Views
Last Modified: 2012-08-14
Hi,
  How to do a restore of sqlserver 2008 database if multi user are logged in.

Thanks a lot.
0
Comment
Question by:amitabh04
  • 4
  • 3
8 Comments
 
LVL 13

Expert Comment

by:Wizilling
ID: 36638242
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
 

Author Comment

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

Thanks.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 36664587
>>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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 13

Expert Comment

by:Wizilling
ID: 36665660
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
 

Author Comment

by:amitabh04
ID: 36670821
Hi,
   Do I kill  process in 'sleeping' status for my DBname.

Thanks.
0
 
LVL 13

Expert Comment

by:Wizilling
ID: 36671235
yes... as they hold a connection to ur db
0
 

Author Comment

by:amitabh04
ID: 36672105
Hi,
  So no matter what the status is kill all connections to my DB. Is that right?

Thanks.
0
 
LVL 13

Accepted Solution

by:
Wizilling earned 2000 total points
ID: 36673683
yes.

FYI - spid between 1 - 50 cant be kiiled
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question