Link to home
Start Free TrialLog in
Avatar of nectarios777
nectarios777Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Restore a database

Hello all,

I'm trying to restore an existing database backup to my new database.
However, I'm getting an error message that the restoration cannot be done
because the database is already in use.
Any ideas how to overpass this problem?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

you have to check the "overwrite" option when restoring, in case you use SQL, include the WITH REPLACE syntax part...
Restore it as another name if you are looking to restore only certain tables... other wise, drop the current DB, and then restore from the backup
it can't be restored over the top of a database if that database has any connections to it. You'll need to determine if these processes are legitimate. They can be SQL Query windows that are open, services that are logged into the the database, etc.

Open Management Studio, Drill down into the server where you are restoring to. go into the Management section and open the Activity Monitor. Look in there for anything with the name of the database you're trying to restore to in the "Database" column. You can right click on that row and kill the process. First make sure that it's ok to kill.

Once there are no rows for that database, try your restore again.
Oh, forgot 2005 has a check box in the restore window to Drop existing connections to the db. That will clear connections of people using the db.
Avatar of nectarios777

ASKER

AngelIII,
I have already checked the overwrite option.
b1ackfox, I am using a new database with a different name. I can't drop the current db because
I'm using it.
Where are these options i2Mental (to drop the connections?) I'm in the restore panel but can't see them
ehh... actually. I think I was thinking of the drop database window for that check box. Restore just restores without a confirmation window.
i2Mental,

for my database there are only 2 processes which are running under the Management
section but they are sleeping. I'm trying to kill them but I get nothing as a response from Mgmt Studio.
I have stopped the server but nothing helped!

Any ideas?
If the database is online you cannot restore on top of it. It will throw an error that you are getting. Put that database in the SINGLE USER MODE.
You can do so by going to the Properties-->Option of the target database and select SINGLE USER MODE. Once thats done Make sure that on the Backup Exec you have selected the correct option to redirect the restore of the Database on this new target database.

Hope this helps.
"Make sure that on the Backup Exec you have selected the correct option to redirect the restore of the Database on this new target database."

How would I do that?
ASKER CERTIFIED SOLUTION
Avatar of Neer_Thadarai
Neer_Thadarai
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial