Solved

Unable to restore test database from production database using Enterprise Manager

Posted on 2004-09-23
8
627 Views
Last Modified: 2013-12-03
We are running SQL Server 2000 with both a production and a test database. It is time to restore the test database using the production database backup file that is stored in the default C: folder. However when I try to do this through Enterprise Manager using the select database, right click and select restore, the error message displays "Exclusive access could not be obtained becasue the database is in use. RESTORE DATABASE is terminating abnormally." Have checked that no users are logged into the test database and don't know why or how to fix this problem.
Thanks.
0
Comment
Question by:cawthron
8 Comments
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12139956
If you have the database selected in EM, that's a connection. Another one that catches me sometimes is a connection open from Query Analyzer. Also, if you're trying to restore over an existing database, you have to specify to overwrite/replace.
0
 

Author Comment

by:cawthron
ID: 12140005
Thanks for the prompt response however nothing is running in Query Analyzer and have specified overwrite database. The EM connection shouldn't be an issue should it? otherwise the restore wouldn't be possible anyway?
0
 
LVL 15

Assisted Solution

by:jdlambert1
jdlambert1 earned 80 total points
ID: 12140112
Yes, EM can be an issue. Not that the name appears in the list of databases, but if it's the currently selected database. It doesn't need to be selected to do a restore. Click on any other database name to deselect your target database, then right-click on "Databases" to start the restore wizard.
0
 

Author Comment

by:cawthron
ID: 12140163
Have done as you suggested and still the same error message :(
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 12

Assisted Solution

by:ill
ill earned 80 total points
ID: 12140654
conection could be made before and session is still active, so
1.kill all processes connected to you database from EM
2. or when restoring database switch to option panel and check "force restore over existing database" option.
0
 
LVL 9

Accepted Solution

by:
solution46 earned 90 total points
ID: 12141023
open up QA and connect to the database.

run sp_who2

this will list all current connections to the server and should give you an indication of what is keeping it open.

use kill <process_number> to kill off any processes that shouldn't be running. When you have got rid of any unwanted connections, close QA down and try the restore.

s46.
0
 
LVL 5

Expert Comment

by:aryumin
ID: 12142752
alter database test set single_user with rollback immediate
restore database test ....
0
 

Author Comment

by:cawthron
ID: 12148959
Thank you for your help. Have split the points as each of these answers pointed in the right direction however using solution46's answer I was able to see what was causing the problem. It was a process that was not running but somehow holding a connection. Once that was stopped the restore worked beautifully. Thanks again.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server - Slabs 9 38
T-SQL:  I Want "Summary"--Not "Detail" 6 22
SQL VIEW 7 23
Sql Query with datetime 3 12
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now