.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server


I'm trying to restore a production .bak file over a test db but keep getting this error below however, I don't know how it is in use because I'm the only one logged in.



Msg 3101, Level 16, State 1, Line 8

Exclusive access could not be obtained because the database is in use.

Msg 3013, Level 16, State 1, Line 8

RESTORE DATABASE is terminating abnormally.






TO DISK = 'F:\Back

View Complete Post

More Related Resource Links

Error in RESTORE in LOG FILE. Anyway to exclude it?

I'm trying to install a database (on a SQL Server 2008 machine) with test data sent by a partner company in the form of a .BAK file. (Version of SQL Server they are using unknown). I'm using this script: Use Master RESTORE DATABASE XEMS FROM DISK = 'C:\temp\xemstest6-29.bak' WITH REPLACE, MOVE 'XEMS' TO 'E:\XEMS DATABASE\XEMS.MDF', MOVE 'XEMS_Log' TO 'E:\XEMS DATABASE\XEMS_Log.LDF' The Restore process churns for a while, then I get: Processed 2576 pages for database 'XEMS', file 'XEMS' on file 1. Processed 5 pages for database 'XEMS', file 'XEMS_log' on file 1. Msg 3283, Level 16, State 1, Line 2 The file "XEMS_log" failed to initialize correctly. Examine the error logs for more details. Msg 3013, Level 16, State 1, Line 2 RESTORE DATABASE is terminating abnormally. At this point the database is unusable - trying to do anything with it produces an error indicating the database is still in a Restore state. There is some problem with the LOG portion of the backup, which I really don't need anyway. I'd like to just NOT restore the log. Came across this article which seemed to refer to the exact problem I'm having...  http://support.microsoft.com/kb/915385/en-us They offered this suggestion: "Use the WITH NO_LOG clause during the restore process." However - in checking the RESTORE syntax.... http://msdn.microsoft.com/en-us/libr

restore BD error

I have pulled a copy of the Dot Net Nuke database off the servera nd i want to put it on my local machine.... I am getting this error (Microsoft.SqlServer.SmoExtended) System.Data.SqlClient.SqlError: File 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Childrens.mdf' is claimed by 'CHRBenefitsDNN_log'(2) and 'CHRBenefitsDNN'(1). The WITH MOVE clause can be used to relocate one or more files. (Microsoft.SqlServer.Smo) I have dropped the old DB that was assosiated with DNN any ideas thanks in advance

Stuck during restore process, no error messages

I need to restore a solution (a webpart) from a Sharepoint 2010 backup to another Sharepoint 2010 installation on another server. In CA and exactly in the page _admin/BackupStatus.aspx I see that: A backup or restore is currently in progress. There are no current or recent backup or restore processes to show. If you recently started a backup or restore process, you may need to refresh this page after several minutes for it to appear. Hours have passed since I started the restore process In _admin/ServiceRunningJobs.aspx there is no backup/restore job running. The question is: What can I do to try again a restore if I cannot stop the restore that is "running"? Please Help.  

Error when running an SQL script to restore a database on SQL Server 2008 R2 Express

Hi, At work, I use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. At home, I also use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. Whenever I do work on the database at work, I usually restore the database at home (or vice versa) I have been using the following SQL scripts to back up the database and to restore the same database (at work or at home). BackupRealEstate.sql USE Master BACKUP DATABASE [RealEstate] TO DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH NOFORMAT, INIT, NAME = N'RealEstate-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO RestoreRealEstate.sql USE Master RESTORE DATABASE [RealEstate] FROM DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH  FILE = 1, NOUNLOAD, REPLACE, STATS = 10 GO Everything worked fine until I replaced my 8yo home computer with a newer and faster one. My new home computer is running Windows 7 Home Premium and I use the latest SQL Server 2008 R2 Express. When I tried to run the above restore SQL script, I got the following error message: Msg 3101, Level 16, State 1, Line 2 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 2 RESTORE DATABASE is terminating abnormally. There was no other application/process using this database. Can someone please help me? Regards,

Error during database restore

Hi,I'm trying to restore a database backup but I get this error.  What does it mean exactly?Thanks!TITLE: Microsoft SQL Server Management Studio------------------------------ Restore failed for Server 'WHIDBEY1'.  (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1314.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 ------------------------------ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ The media set has 2 media families but only 1 are provided. All members must be provided.RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3132) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1314&EvtSrc=MSSQLServer&EvtID=3132&LinkId=20476 ------------------------------BUTTONS: OK------------------------------

Restore SQL 2008 db error

hi all, i'm trying to restore a .bak to my laptop using sql express 2008. The .bak file is a backup from sql 2008 server. I get this error: TITLE: Microsoft SQL Server Management Studio ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ ADDITIONAL INFORMATION: The media family on device 'D:\training _evaluation.bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------ Could anybody help me please? Thanks, Paul.

File not found error after restore the sitecollection



I backed up a MOSS sitecollection using "stsadm -o backup" and then restored the same file in the other machine/server. No problems while creating backup and doing restores . But after restore is successfull and try to open the site ..it is giving me an error "File not found".Any idea?

SQL2008 error on restore databse (database is in use) error 3010


We have to do a lot of restore from backups for a development on a production sql 2008 server.

This daily job or by request job will have 3 steps.

Step 1 kill the user that was using such @dbname

declare killprocess_cursor cursor for
select a.spid from sysprocesses a join
sysdatabases b on a.dbid=b.dbid where b.name=@dbname


Step 2 Restore database, from a fixed path using a T-Sql

RESTORE DATABASE db_abc FROM DISK = 'H:\RestoreDB\db_abc_FullBK.bak' with replace

Step 3 restore users


Sometimes the daily job will fail at 2. The by request job will fail at 1.

I am concern with daily job failure now. Error message:

Executed as user: myDomain\myISAgentAcct. Exclusive access could not be obtained because the database is in use. [SQLSTATE 42000] (Error 3101)  RESTORE DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013).  The step failed.


When I use sp_who2, there is none using the db and rerun result with the same error. I have to take it offline, detach, attach again and rerun the job to finish it without error.


What bugs me... the job will run for in most days and fail in other. I already has a kill user step and no one works at the schedule night time.

My last suspicion... either Report service has a hold on

Restore error: specified cast is not valid

I've got a database from a client (SQL 2008) and when I try and restore the database to my server, I get the following error: specified cast is not valid...

I get the error as I browse for and select the backup file.

Please help!!!

database restore remains blocked with no error messages


I'm trying to restore an olap database exported from a remote machine, with an AS instance  with this version:

Microsoft SQL Server Management Studio                        10.0.2531.0
Microsoft Analysis Services Client Tools                        10.0.1600.22
Microsoft Data Access Components (MDAC)                        6.0.6002.18005
Microsoft MSXML                        3.0 6.0
Microsoft Internet Explorer                        8.0.6001.18882
Microsoft .NET Framework                        2.0.50727.4200
Operating System                        6.0.6002


on my machine (Windows Vista Business SP2 32 bit), where I have this version of AS:

Microsoft SQL Server Management Studio &n

I am tring to restore the list from reclycle bin, but i am getting below error


Hi frinds,

I am tring to restore the list from reclycle bin, but i am getting below error,

A list with this name "Research Requests" already exists. To restore the list, move or rename the existing list and try again.   at Microsoft.SharePoint.SPRecycleBinUtility.ThrowAppropriateRestoreException(SPException ex, SPRecycleBinItem lastItem)
   at Microsoft.SharePoint.SPRecycleBinItemCollection.RestoreCore(Guid[] ids)
   at Microsoft.SharePoint.SPRecycleBinItemCollection.Restore(Guid[] ids)
   at Microsoft.SharePoint.ApplicationPages.RecycleBinPage.ProcessAction(String action, String guidString)
   at Microsoft.SharePoint.ApplicationPages.RecycleBinPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Troubleshoot issues with Windows SharePoint Services.

error message trying to restore db on a cluster


Hi.  I'm posting as a favor to one of my co workers.  He is getting the following error trying to "restore" a new database to a server involved in a cluster relationship with other server(s).  Does anybody know what this means?  After getting the error the first time he did try creating a db with the same name first but got the same error.

TITLE: Microsoft SQL Server Management Studio



Restore failed for Server 'x\y'.  (Microsoft.SqlServer.SmoExtended)


For help, click:

Restore a previous version of a document in a document library - error

  When I try to restore a previous version of a document in a document library, I get this error message:

"Updates are currently disallowed on GET requests. To allow updates on a GET, set the AllowUnsafeUpdates' property on SPWeb"

I am NOT running any custom code anywhere on my SharePoint site 

SQL Server 2005 restore error, code 23



I try to restore a MS SQL Server 2005 backup file

     FROM DISK='F:\Munka\NFU\nfudb_20101007\nfudb_20101007.bak'
WITH MOVE    'cstteszt' TO 'F:\Munka\NFU\opten.mdf',
MOVE 'cstteszt_log' TO 'F:\Munka\NFU\opten.ldf'

And this is the error code I get:

Msg 3203, Level 16, State 2, Line 2
Read on "F:\Munka\NFU\nfudb_20101007\nfudb_20101007.bak" failed: 23(error not found)
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.


Can you  pls help?

Do I need to install some patch? Or? Any ideas are welcome!



Backup/Restore 404 File not found error ;Site site created besed on Custom Site Template




I am using SharePoint (Version: 12.0.6318.5000). The scenario is like that;

  • I have created a Site Collection and under that I have 2 sub sites and under each sub sites again I have a sub site (Site Collection [level 1]>>>SubSite+Lists [level 2]>>>SubSite+ Lists [level 3]>>>Lists, Doc. Library and Picture Library

404 error after unsuccessful restore server error message about author.dll


Hi All

I recently tried to restore a section of a site using stsadm. I got a versioning error when i tried to install it. Now i can't access any of the pages at the site level i tried to install //localhost/ anything at //localhost/sites/ works fine. I tried a DB backup/restore. It didn't help.

When i look at the pages in Designer they give me an error "Server Error: The Url "http://localhost/_vti_bin/_vti_aut/author.dll" is not contained within a Windows Sharepoint Service site. Any help would be greatly appreciated. I've been searching forums all day and nothing seems to be working.



P.S. The section of the site i tried to restore was from a different site. It also contained a third party SP application called "K2".

restore 2005 database into 2008 error 3154


I am trying to restore a 2005 database to a 2008 database.  This is the code that was generated by Management studio:




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend