Solved

Can't Restore Staging Version of Database (from production backup) on Same Server 2012

Posted on 2014-02-12
4
212 Views
Last Modified: 2014-02-18
I'm having a heck of a time.  I made a backup of my production DB in the hopes of refreshing my staging copy that lives on the same server.  No matter what I do I keep getting an error that the DB is in use (the one I'm restoring to).  I've tried deleting the staging DB, recreating an "empty" one and then doing the restore.  I've tried changing the name of the files it's getting restored to.  I tried NOT deleting it first.  Further, it's only something I've started to encounter on 2012 server.  Previously I never had this issue.

I know I'm doing something simple and quite stupid wrong but I just don't know what.

Please HELP!!!
0
Comment
Question by:cat4larry
[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
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 39855409
hi

1. restart the sql server service.
2. delete the staging db
3. restore the db, make sure that the file your about to restore dont already exist in the destination.
0
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39856014
if you are using SQL Server 2012... and using the restore wizard...

you have option in the wizard (in the options tab), to close the existing connections to the database checkbox, tick this checkbox and click ok.

I faced this issue once and it got resolved by doing this.
0
 

Accepted Solution

by:
cat4larry earned 0 total points
ID: 39857946
Actually, it turned out to be the "take tail log backup before restore" option.  As soon as I flipped that off, it worked no problem.

Thanks for the feedback though.
0
 

Author Closing Comment

by:cat4larry
ID: 39866927
I solved the problem myself.  I had to turn the "take tail-log backup before restore" option off and then the DB restored without issue.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

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