Solved

Sqlserver 2008 restore

Posted on 2011-09-26
8
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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 500 total points
ID: 36673683
yes.

FYI - spid between 1 - 50 cant be kiiled
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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