Restore Database

  • I backed up a database on to a tape drive and restoring it from there to another place. All these I have designed a package and put in there!

    I get the backup part successfully executed and when it gets to the restoring section it says " Restore DB is terminating abnormally" " Exclusive access could not be obtained because the DB is in use"

    I have no clue on how to get over this!

    Any suggestions?

    Thanks,

    Ram

  • Is the db in single user mode?

  • Are you sure you are restoring it to the correct server, and the name your trying to restore it as does not exist.

    How are you restoring, with enterprise manager, or thru T-SQL?

    With EM you have to be very careful, because if you don't watch it, you'll overwrite the master database. Don't wanna be doing that.

    If the name your restoring it as does exists, then make sure you clear all connections and restrict access to the db to dbo's or admins, thatway no one can connect until the db is restored

  • Yes it is in Single user mode!

     

    How do I go about doing this? Can you give me a flow?

    "If the name your restoring it as does exists, then make sure you clear all connections and restrict access to the db to dbo's or admins, thatway no one can connect until the db is restored"

  • Hi Ram,

    Check on which derive u installed ur sql server and what is the location od sql data folder if it is right.

    then check on which derive u are restoring the database becasue sql server restores bydefalut at

    c:\program files\microsoft sql server\mssql\data

    so check ur path.

    hope this helps

     

    sufian

  • There can be no open connections into a database when it is being restored.  To ensure this you can run sp_who2 inside of Query Analyzer and note which SPID's are connected into your database.  You can then run the command KILL ## where ## is the SPID number that is connected into the DB.  Once all of the SPID's are killed you can then restore the database.

    You can also do this using the current activity view in query analyzer and right click -> kill on all SPIDS connected into the database you wish to restore.

  • Hi Ram,

    Are u using a restore script or something that is running on a scheduled basis? if you are maintaining a standby server, then you have to check some things like the query analyzer shouldn't be open on the server where you are restoring the database and also check the Enterprise Manager to confirm that you are not browsing the database..becoz here sometimes i too used to get the same error and also if you are maintaining a stand by server, i would recommend to put the norecovery clause...

    HTH

    Regards

    Dilip

  • You could also check EM under "Management" - "Current Activity" to see if there are any processes running against the database that you want to restore. (Locks/Object)







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply