﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Backups  / Restore failed for Server. (Microsoft.SqlServer.Smo) / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 01:37:45 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>Activity Monitor can be found in the Object Explorer under the Management folder.You can close all the connections prior to your restore, but more than likely SQL Agent is reconnecting immediately after you kill it.Try restoring your database via T-SQL:Use MasterAlter Database [database_name]SET SINGLE_USER With ROLLBACK IMMEDIATE RESTORE DATABASE [database_name] FROM DISK = 'E:\backup\zreports.bak' --location of .bak fileWITH REPLACEGOGood luck!</description><pubDate>Tue, 26 Feb 2013 08:49:56 GMT</pubDate><dc:creator>Meet George Jetson</dc:creator></item><item><title>RE: Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>This may seem silly but where do I find the Activity Monitor?  I am very new to SQL Server.</description><pubDate>Tue, 26 Feb 2013 06:55:48 GMT</pubDate><dc:creator>margo.taylor</dc:creator></item><item><title>RE: Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>Great tip on the Activity Monitor, I did not realize you could use that.  If it is just the test environment, I use this script to kill connections prior to a restore.DECLARE @spid varchar(10)SELECT @spid = spidFROM master.sys.sysprocessesWHERE 	dbid IN (DB_ID('Adventerworks), DB_ID('Northwind'), DB_ID('CCL'))WHILE @@ROWCOUNT &amp;lt;&amp;gt; 0BEGIN	EXEC('KILL ' + @spid)	SELECT @spid = spid	FROM master.sys.sysprocesses	WHERE 		dbid IN (DB_ID('Adventerworks), DB_ID('Northwind'), DB_ID('CCL'))	            AND spid &amp;gt; @spid END</description><pubDate>Tue, 26 Feb 2013 06:46:07 GMT</pubDate><dc:creator>Noetic DBA</dc:creator></item><item><title>RE: Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>Absolutely, activity monitor has a drodown db filter box so select the one you are wanting to restore and then you can see what is happening.  Obviously dont go killing processes unless you're sure!Ditto re the query window :-)</description><pubDate>Mon, 25 Feb 2013 08:59:16 GMT</pubDate><dc:creator>david.alcock</dc:creator></item><item><title>RE: Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>" ... Exclusive access could not be obtained because the database is in use ..."Someone has an open connection to the database.You can use Activity Monitor or sp_who2 to identify it. Sometimes I find out I am the culprit because I forget I had a query window open !</description><pubDate>Fri, 22 Feb 2013 10:49:40 GMT</pubDate><dc:creator>homebrew01</dc:creator></item><item><title>RE: Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>[quote][b]margo.taylor (2/21/2013)[/b][hr]I have been trying to restore a backup to my test server and keep getting the following error.  I am using Microsoft SQL Server Management Studio.Restore failed for Server 'SERVER'. (Microsoft.SqlServer.Smo)Additional information:   System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use.   (Microsoft.SqlServer.Smo)Here are the steps I have been told to follow:- Start &amp;gt; Command Prompt &amp;gt; iisreset &amp;gt; exit (clears &amp; restarts processes)- Start &amp;gt; Computer Management &amp;gt; Services and Applications &amp;gt; Services     o IIS Admin Service &amp;gt; Stop all processes           Make sure SDE processes are also stopped     o IIS Manager &amp;gt; Application Pools           Stop all processes     o Default SMTP Virtual Server           Stop- MS SQL Server Management Studio     o Login     o DB     o Test_sde &amp;gt; Tables &amp;gt; dbo.SMSYSPROCESS (right click)           Delete all entries     o Test_sde &amp;gt; Tasks &amp;gt; Restore &amp;gt; Database           General             • From device &amp;gt; Add (drill down to file .bak file)           Options             • Overwrite the existing database                 o Restore the database file for MagicTSD_Data (drill down to MSSQL.1 &amp;gt; Data &amp;gt; Test_sde.mdf)                 o Restore the dataset file for MagicTSD_Log (drill down to MSSQL.1 &amp;gt; Data &amp;gt; Test_sde_log.ldf)FINISH- Start &amp;gt; Command Prompt &amp;gt; iisreset &amp;gt; exit (clears &amp; restarts processes)I have tried everything I can think of. Do you have any suggestions?[/quote]Why are you using GUI  and restarting IIS ? Instead use scripts ... that will be much faster and more customizable ...[code="sql"]--- kill all connections .. Replace the database_name with your actual database namealter database database_nameset single_user with rollback immediatewaitfor dealy "00:00:05" -- wait for 5 secsalter database database_nameset multi_user with rollback immediatego--- now restore the database ..... restore database database_namefrom disk = 'backup location\file.bak'with replace, recovery, stat = 10 --- since you are replacing the current database[/code]</description><pubDate>Fri, 22 Feb 2013 09:57:12 GMT</pubDate><dc:creator>SQLQuest29</dc:creator></item><item><title>Restore failed for Server. (Microsoft.SqlServer.Smo)</title><link>http://www.sqlservercentral.com/Forums/Topic1422776-357-1.aspx</link><description>I have been trying to restore a backup to my test server and keep getting the following error.  I am using Microsoft SQL Server Management Studio.Restore failed for Server 'SERVER'. (Microsoft.SqlServer.Smo)Additional information:   System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use.   (Microsoft.SqlServer.Smo)Here are the steps I have been told to follow:- Start &amp;gt; Command Prompt &amp;gt; iisreset &amp;gt; exit (clears &amp; restarts processes)- Start &amp;gt; Computer Management &amp;gt; Services and Applications &amp;gt; Services     o IIS Admin Service &amp;gt; Stop all processes           Make sure SDE processes are also stopped     o IIS Manager &amp;gt; Application Pools           Stop all processes     o Default SMTP Virtual Server           Stop- MS SQL Server Management Studio     o Login     o DB     o Test_sde &amp;gt; Tables &amp;gt; dbo.SMSYSPROCESS (right click)           Delete all entries     o Test_sde &amp;gt; Tasks &amp;gt; Restore &amp;gt; Database           General             • From device &amp;gt; Add (drill down to file .bak file)           Options             • Overwrite the existing database                 o Restore the database file for MagicTSD_Data (drill down to MSSQL.1 &amp;gt; Data &amp;gt; Test_sde.mdf)                 o Restore the dataset file for MagicTSD_Log (drill down to MSSQL.1 &amp;gt; Data &amp;gt; Test_sde_log.ldf)FINISH- Start &amp;gt; Command Prompt &amp;gt; iisreset &amp;gt; exit (clears &amp; restarts processes)I have tried everything I can think of. Do you have any suggestions?</description><pubDate>Thu, 21 Feb 2013 13:26:10 GMT</pubDate><dc:creator>margo.taylor</dc:creator></item></channel></rss>