Red Gate forums :: View topic - Restoring Database with Ext Stored Proc
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 6
SQL Backup 6 forum

Restoring Database with Ext Stored Proc

Search in SQL Backup 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
philfry



Joined: 04 Jun 2012
Posts: 1

PostPosted: Mon Jun 04, 2012 2:06 am    Post subject: Restoring Database with Ext Stored Proc Reply with quote

I've been trying to figure out how to restore databases with .SQB files. I can run the Ext SP fine but if I try to put the database into single user mode, restore database, and then put it back to multi user, it will fail. Has anyone run into this problem?

When I try to do this, it seems to restore the database but will be stuck in single user mode. I think this is because the alter database statement attempts before the restore is complete. Any thoughts or ideas?
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2299

PostPosted: Mon Jun 04, 2012 3:29 pm    Post subject: Reply with quote

Have you considered using the DISCONNECT_EXISTING option to disconnect all existing users to the database so that the restore can proceed? E.g.

Code:
EXEC master..sqlbackup '-sql "RESTORE LOG AdventureWorks FROM DISK = [g:\backups\AdventureWorks_log_*.sqb] WITH STANDBY = [g:\standby\AdventureWorks.und], DISCONNECT_EXISTING"'

_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group