469,651 Members | 1,676 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,651 developers. It's quick & easy.

Restoring database hangs SQL Server 2005

2
Hello.

Occasionally on my production server when I run an automated script to restore a database from a backup it hangs and the database is put in restoring mode and just stays there, requiring me to delete the database and restore the backup manually and causing everything else to timeout (it's part of an update process that includes database and web files).

The code is called from a VB.Net DLL against the Master database and is as follows:

ALTER DATABASE mydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE mydb FROM DISK='backuppath' WITH KEEP_REPLICATION, REPLACE
ALTER DATABASE mydb SET MULTI_USER WITH ROLLBACK IMMEDIATE

The backuppath is a UNC path somewhere in our production environment. The databases it happens on are high traffic databases.

The thing is that it usually does not hang while restoring, only occasionally and I cannot figure out why this might be happening, so if anyone has any idea please let me know.

Thank you,

Kelly
Dec 19 '07 #1
0 3483

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Loane Sharp | last post: by
1 post views Thread by Robbert van Geldrop | last post: by
3 posts views Thread by jai | last post: by
5 posts views Thread by Troels Arvin | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.