{"id":28375,"date":"2018-11-27T11:13:33","date_gmt":"2018-11-27T11:13:33","guid":{"rendered":"https:\/\/www.stellarinfo.com\/blog\/?p=28375"},"modified":"2026-03-26T06:48:58","modified_gmt":"2026-03-26T06:48:58","slug":"fix-sql-database-restore-failed-error","status":"publish","type":"post","link":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/","title":{"rendered":"[Error Solved]: SQL Database Restore Failed, Database in Use"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><?xml encoding=\"utf-8\" ?><p>When trying to&nbsp;<a href=\"https:\/\/www.stellarinfo.com\/restore-sql-database.php\" target=\"_blank\" rel=\"noreferrer noopener\">restore SQL Server database from backup<\/a>, you can experience different errors. The &ldquo;SQL database restore failed, database in use&rdquo; is one such error that occurs when you try to execute queries that require exclusive access to the database but it is currently in use. The complete error message reads as follows:<\/p><p><em>Msg 3101, Level 16, State 1, Line 2<\/em><\/p><p>Exclusive access could not be obtained because the database is in use.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"176\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Error.png\" alt=\"SQL Database Restore Failed Error Message\" class=\"wp-image-189967 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Error.png 626w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Error-300x84.png 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/figure><p>This error indicates that the database cannot be restored as it is in use. Let&rsquo;s understand the reasons that can lead to this error in SQL Server and see how to resolve it.<\/p><h2 class=\"wp-block-heading\" id=\"what-are-the-reasons-behind-&lsquo;sql-database-restore-failed,-database-is-in-use&rsquo;-error?\"><strong>What are the Reasons behind &lsquo;SQL Database Restore Failed, Database is in Use&rsquo; Error?<\/strong><\/h2><p>Below are some possible reasons that can result in this error:<\/p><ul class=\"wp-block-list\">\n<li>Some users are connected to the database you are trying to restore.<\/li>\n\n\n\n<li>There are multiple windows of SQL Server Management Studio (SSMS) are open during the database restore.<\/li>\n\n\n\n<li>Some users are connected to the master database.<\/li>\n\n\n\n<li>The backup (.BAK) file you are trying to restore is corrupted.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"how-to-fix-&lsquo;database-restore-failed,-database-is-in-use&rsquo;-error-in-sql-server?\"><strong>How to Fix &lsquo;Database Restore Failed, Database is in Use&rsquo; Error in SQL Server?<\/strong><\/h2><p>The error message itself indicates that the database is in use by some users or there are active connections to the database. So, you need to first check and disconnect all existing connections to the database. You can use the <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/system-stored-procedures\/sp-who-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">sp_who Transact-SQL<\/a> command to check the users who are currently using the database. This command will also provide information about current sessions and processes in an instance of the SQL Server database engine. If the database is in use by some users, you need to disconnect them and then try to restore the database. To disconnect the active users, you can follow the below-given methods.<\/p><h3 class=\"wp-block-heading\"><strong>Method 1: Select &ldquo;Close Existing Connections to Destination Database&rdquo; Option when Restoring the Database via SSMS<\/strong><\/h3><p>When restoring the database using the SSMS, you can select the &ldquo;Close existing connections to destination database&rdquo; option to close the existing connections to the SQL database. To do so, follow these steps:<\/p><p><strong>Step 1:<\/strong>&nbsp;Open&nbsp;<strong>SSMS<\/strong>&nbsp;and connect to the SQL Server instance.<\/p><p><strong>Step 2: <\/strong>In the<strong> Object Explorer&nbsp;<\/strong>panel, right-click&nbsp;<strong>Databases<\/strong>, and then select&nbsp;<strong>Restore Database<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"334\" height=\"461\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Restore-DataBase.png\" alt=\"Restore Database\" class=\"wp-image-189968 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Restore-DataBase.png 334w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Restore-DataBase-217x300.png 217w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/figure><p><strong>Step 3:&nbsp;<\/strong>In the&nbsp;<strong>Restore Database<\/strong>&nbsp;dialog box, do the following:<\/p><ul class=\"wp-block-list\">\n<li>Select the database you want to restore.<\/li>\n\n\n\n<li>In the left panel, click&nbsp;<strong>Options<\/strong>.<\/li>\n<\/ul><p><strong>Step 4:<\/strong>&nbsp;On the&nbsp;<strong>Options<\/strong>&nbsp;page, check the checkbox labeled, &lsquo;Close existing connections to destination database&rsquo;.<\/p><blockquote class=\"note_alert\">\n<p><strong><em>Note:<\/em><\/strong><em> <\/em><em>This will set the database to single-user mode and then again to multi-user mode once the restore process is complete.<\/em><em><\/em><\/p>\n<\/blockquote><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"651\" height=\"88\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Close-Existing-Connections.png\" alt=\"Close Existing Connections\" class=\"wp-image-189969 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Close-Existing-Connections.png 651w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Close-Existing-Connections-300x41.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/figure><p><strong>Once the SQL Server connections are closed, proceed with the <\/strong><a href=\"https:\/\/www.stellarinfo.com\/article\/restore-sql-server-database-from-bak-file.php\">restore operation<\/a><strong> using WITH RECOVERY. &nbsp;It restores a database by,<\/strong><\/p><ul class=\"wp-block-list\">\n<li>Completing the recovery phase.<\/li>\n\n\n\n<li>Calling forward committed transactions.<\/li>\n\n\n\n<li>Rolling back incomplete transactions.<\/li>\n<\/ul><h3 class=\"wp-block-heading\"><strong>Method 2: Set the Database to Single-User Mode<\/strong><\/h3><p>You can set the database to single-user mode from multiple-user mode. This will disconnect all the connected users. To set the database to single-user mode, follow these steps:<\/p><p><strong>Step 1:<\/strong>&nbsp;Open&nbsp;<strong>SSMS<\/strong> and connect to the SQL Server instance.<\/p><p><strong>Step 2:&nbsp;<\/strong>In the&nbsp;<strong>Object Explorer<\/strong>&nbsp;window, select&nbsp;<strong>New Query<\/strong>. Copy and paste the below T-SQL code into the query window, and then click&nbsp;<strong>Execute<\/strong>.<\/p><pre class=\"wp-block-code command_container\"><code>USE master;\nGO\nALTER DATABASE AdventureWorks2012\nSET SINGLE_USER\nWITH ROLLBACK IMMEDIATE;\nGO<\/code><\/pre><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"442\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SSMS-Query-Editor.jpg\" alt=\"SSMS Query Editor\" class=\"wp-image-189971 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SSMS-Query-Editor.jpg 1024w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SSMS-Query-Editor-300x129.jpg 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SSMS-Query-Editor-768x332.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><p>Executing the above code will change the database to single-user mode.<\/p><h3 class=\"wp-block-heading\"><strong>Method 3: Take the Database Offline<\/strong><\/h3><p>You can also remove the existing connections by taking the SQL database offline. To do so, follow these steps:<\/p><p><strong>Step 1: <\/strong>In <strong>SSMS<\/strong>, under <strong>Object Explorer<\/strong>, right-click on the database you need to take offline.<\/p><p><strong>Step 2: <\/strong>Click <strong>Tasks<\/strong> and then select <strong>Task Offline<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"988\" height=\"682\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Microsoft-SQL-Server-Mangement-Studio.png\" alt=\"Select Task Offline\" class=\"wp-image-189972 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Microsoft-SQL-Server-Mangement-Studio.png 988w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Microsoft-SQL-Server-Mangement-Studio-300x207.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Microsoft-SQL-Server-Mangement-Studio-768x530.png 768w\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" \/><\/figure><h3 class=\"wp-block-heading\"><strong>Method 4: Restart the SQL Server Services<\/strong><\/h3><p>Restarting the SQL services can also disconnect all the connections to the database. You can restart the service by using the SQL Server Configuration Manager. Here are the steps:<\/p><blockquote class=\"note_alert\">\n<p><strong><em>Note<\/em><\/strong><em>: Restarting the SQL Server services will kill connections to all the databases.<\/em><\/p>\n<\/blockquote><p><strong>Step 1:&nbsp;<\/strong>Launch the SQL Server Configuration Manager. You can find it at the following locations:<\/p><p id=\"block-50f48311-a76a-4595-ac27-d8fe520da37b\">SQL Server 2022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\\Windows\\SysWOW64\\SQLServerManager16.msc<\/p><p>SQL Server 2019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\\Windows\\SysWOW64\\SQLServerManager15.msc<\/p><p>SQL Server 2017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\\Windows\\SysWOW64\\SQLServerManager14.msc<\/p><p>SQL Server 2016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\\Windows\\SysWOW64\\SQLServerManager13.msc<\/p><p>SQL Server 2014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\\Windows\\SysWOW64\\SQLServerManager12.msc<\/p><p>SQL Server 2012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\\Windows\\SysWOW64\\SQLServerManager11.msc<\/p><p><strong>Step 2:&nbsp;<\/strong>In the left pane of SQL Server Configuration Manager window, click&nbsp;<strong>SQL Server Services<\/strong>. <\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"270\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-1-1024x270.png\" alt=\"click&nbsp;SQL Server Services\" class=\"wp-image-189973 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-1-1024x270.png 1024w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-1-300x79.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-1-768x202.png 768w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-1.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>Step 3:<\/strong> In the right pane, right-click the SQL Server service, and Stop and Start it.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1018\" height=\"448\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-2.jpg\" alt=\"click&nbsp;SQL Server Services\" class=\"wp-image-189974 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-2.jpg 1018w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-2-300x132.jpg 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Step-2-768x338.jpg 768w\" sizes=\"auto, (max-width: 1018px) 100vw, 1018px\" \/><\/figure><p><strong>Step 4:&nbsp;<\/strong>Click<strong>&nbsp;OK&nbsp;<\/strong>to exit the SQL Server Configuration Manager.<\/p><h3 class=\"wp-block-heading\"><strong>Method 5: Check and Disable Replication and Log Shipping<\/strong><\/h3><p>You may encounter the &ldquo;Database Restore Failed &ndash; Database in use&rdquo; error while restoring a database that is a part of Replication or Log Shipping. In these processes, the server keeps your database connected for synchronization and logs in the background. You can first check if the database you&rsquo;re trying to restore is configured for replication or log shipping. You can temporarily disable these processes. Follow these steps:<\/p><p><strong>To disable replication,<\/strong><\/p><ul class=\"wp-block-list\">\n<li>Connect to the <strong>Publisher or Distributor<\/strong> you need to disable in SQL Server Management Studio (SSMS).<\/li>\n\n\n\n<li>Now, expand the server node.<\/li>\n\n\n\n<li>Right-click the <strong>Replication <\/strong>folder and then click <strong>Disable Publishing and Distribution.<\/strong><\/li>\n\n\n\n<li>In the <strong>Publishing and Distribution<\/strong> wizard, follow the on-screen steps.<\/li>\n<\/ul><p><strong>To disable log shipping,<\/strong><\/p><ul class=\"wp-block-list\">\n<li>In your SSMS instance, right-click on the primary database and click <strong>Properties.<\/strong><\/li>\n\n\n\n<li>In database <strong>Properties<\/strong> window, click <strong>Transaction Log Shopping <\/strong>and then unselect &ldquo;Enable this as a primary database in a log shipping configuration&rdquo; option. Click <strong>OK.<\/strong><\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1021\" height=\"688\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Properties-window.png\" alt=\"database Properties window\" class=\"wp-image-189976 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Properties-window.png 1021w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Properties-window-300x202.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Properties-window-768x518.png 768w\" sizes=\"auto, (max-width: 1021px) 100vw, 1021px\" \/><\/figure><p>Once the database is free from dependencies, try to restore the backup.<\/p><p>When the restore is complete, reconfigure replications or log shipping if required.<\/p><h2 class=\"wp-block-heading\" id=\"what-if-the-problem-still-persists?\"><a><\/a><strong>What if the problem still persists?<\/strong><\/h2><p>If the issue still persists, it means there is a problem with the backup file. There are chances that there is corruption in the database backup file. In such a case, you need to take the help of a specialized SQL database repair tool, such as <a href=\"https:\/\/www.stellarinfo.com\/restore-sql-database.php\">Stellar Repair for MS SQL Technician<\/a>. It is Microsoft MVPs recommended tool to repair corrupt database files and backup files. It can restore all the data from corrupt SQL database backup (.BAK) files and save them in a new database with complete precision. The tool works with SQL Server 2022, 2019, and earlier versions.<\/p><p>To restore database from corrupt SQL Server backup (.bak) file by using the software, follow these steps:<\/p><p><strong>Step 1:<\/strong>&nbsp;Download, install, and launch&nbsp;<strong>Stellar Repair for MS SQL Technician <\/strong>software.<\/p><p><strong>Step 2:<\/strong>&nbsp;From the software&rsquo;s user interface, select&nbsp;<strong>Extract from MS SQL Backup<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1002\" height=\"645\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Extract-from-MS-SQL-Backup.png\" alt=\"select&nbsp;Extract from MS SQL Backup\" class=\"wp-image-189977 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Extract-from-MS-SQL-Backup.png 1002w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Extract-from-MS-SQL-Backup-300x193.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Extract-from-MS-SQL-Backup-768x494.png 768w\" sizes=\"auto, (max-width: 1002px) 100vw, 1002px\" \/><\/figure><p><strong>Step 3:&nbsp;<\/strong>In&nbsp;<strong>Stellar Backup Extractor for MS SQL<\/strong>&nbsp;window, click&nbsp;<strong>Browse <\/strong>to choose the .bak file.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"527\" height=\"363\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/choose-the-.bak-file-1.png\" alt=\"Stellar Backup Extractor for MS SQL&nbsp;window\" class=\"wp-image-189984 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/choose-the-.bak-file-1.png 527w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/choose-the-.bak-file-1-300x207.png 300w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/figure><blockquote class=\"note_alert\">\n<p><strong><em>Note<\/em><\/strong><em>: Choose the &lsquo;Search in Folder&rsquo; option, if you do not know the file location.<\/em><\/p>\n<\/blockquote><p><strong>Step 4:<\/strong>&nbsp;After selecting the .bak file, click&nbsp;<strong>Scan<\/strong>.<\/p><p><strong>Step 5:<\/strong>&nbsp;You will see two options &ndash; <strong>Standard Scan<\/strong> and <strong>Advanced Scan<\/strong> to scan the file. Select the Standard Scan mode. If the database file is highly corrupted, then click on Advanced Scan. Click <strong>OK<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"591\" height=\"253\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/scan-mode-1.png\" alt=\"Select the Standard Scan mode\" class=\"wp-image-189985 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/scan-mode-1.png 591w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/scan-mode-1-300x128.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/figure><p><strong>Step 6:<\/strong>&nbsp;In Select Backup Set, select the <strong>backup set<\/strong>, and then click&nbsp;<strong>Next&nbsp;<\/strong>to proceed with the scanning process.<\/p><p><strong>Step 7:&nbsp;<\/strong>Once scanning is complete, a <strong>Repair Complete<\/strong> dialog box will appear. Click <strong>OK<\/strong>. The software shows a preview of the repaired file.<\/p><p><strong>Step 8:<\/strong>&nbsp;To save the recovered .bak file, click&nbsp;<strong>Save&nbsp;<\/strong>on the&nbsp;<strong>File<\/strong>&nbsp;menu.<\/p><p><strong>Step 9:<\/strong>&nbsp;In the window that pops up, choose one of the below saving options:<\/p><ul class=\"wp-block-list\">\n<li>New Database<\/li>\n\n\n\n<li>Live Database<\/li>\n\n\n\n<li>Other formats<\/li>\n<\/ul><p><strong>Step 10<\/strong>: Click <strong>Next.<\/strong><\/p><p><strong>Step 11: <\/strong>Next, specify the required details in the&nbsp;<strong>Connect To Server&nbsp;<\/strong>section. Also, select a location to save the repaired file (if you&rsquo;re saving it as a new database) and then click&nbsp;<strong>Next.<\/strong><\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"733\" height=\"443\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/save-database.jpg\" alt=\"select a location to save the repaired file \" class=\"wp-image-190000 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/save-database.jpg 733w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/save-database-300x181.jpg 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/figure><p><strong>Step 11:<\/strong>&nbsp;In Save Database, select the <strong>Save Mode<\/strong> and click <strong>Save<\/strong>.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"348\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Save-Mode.jpg\" alt=\"Recovery Complete Message Box\" class=\"wp-image-190003 apply-gradient-on-post-images\" style=\"aspect-ratio:2.059783270424936;width:732px;height:auto\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Save-Mode.jpg 731w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/Save-Mode-300x143.jpg 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure><p>To know how this tool works, watch this video:<\/p><figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Stellar Repair MS SQL: Restore SQL Database from Corrupt Backup File, SQL Backup Recovery Software\" width=\"750\" height=\"422\" src=\"https:\/\/www.youtube.com\/embed\/cezAhyUdipU?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure><h2 class=\"wp-block-heading\" id=\"conclusion\"><a><\/a><strong>Conclusion<\/strong><\/h2><p>The <strong>SQL database restore failed, database is in use<\/strong> error can prevent you from restoring the SQL database. To fix this error, follow the methods explained above. If this error has occurred due to corruption in the SQL database backup file, you can use Stellar Repair for MS SQL Technician. It can help resolve the issue by recovering data from corrupt SQL Server database backup file and saving it in a new database file.<\/p><p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When trying to&nbsp;restore SQL Server database from backup, you can experience different&hellip; <a class=\"more-link\" href=\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\">Continue reading <span class=\"screen-reader-text\">[Error Solved]: SQL Database Restore Failed, Database in Use<\/span><\/a><\/p>\n","protected":false},"author":82,"featured_media":171728,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-28375","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-recovery","entry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Error Solved]: SQL Database Restore Failed, Database in Use<\/title>\n<meta name=\"description\" content=\"To fix Database Restore Failed, Database is In Use - Close all active connections, Set database to single-user mode ,Restart SQL Server service, Disable Log Shipping\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Error Solved]: SQL Database Restore Failed, Database in Use\" \/>\n<meta property=\"og:description\" content=\"To fix Database Restore Failed, Database is In Use - Close all active connections, Set database to single-user mode ,Restart SQL Server service, Disable Log Shipping\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Stellar Data Recovery Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-27T11:13:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-26T06:48:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Monika Dadool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monika Dadool\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\"},\"author\":{\"name\":\"Monika Dadool\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd\"},\"headline\":\"[Error Solved]: SQL Database Restore Failed, Database in Use\",\"datePublished\":\"2018-11-27T11:13:33+00:00\",\"dateModified\":\"2026-03-26T06:48:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\"},\"wordCount\":1488,\"commentCount\":6,\"image\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg\",\"articleSection\":[\"SQL Database Repair\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\",\"name\":\"[Error Solved]: SQL Database Restore Failed, Database in Use\",\"isPartOf\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg\",\"datePublished\":\"2018-11-27T11:13:33+00:00\",\"dateModified\":\"2026-03-26T06:48:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd\"},\"description\":\"To fix Database Restore Failed, Database is In Use - Close all active connections, Set database to single-user mode ,Restart SQL Server service, Disable Log Shipping\",\"breadcrumb\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg\",\"contentUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg\",\"width\":1000,\"height\":600,\"caption\":\"SQL Database Restore Failed, Database in Use\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stellarinfo.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Error Solved]: SQL Database Restore Failed, Database in Use\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#website\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/\",\"name\":\"Stellar Data Recovery Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stellarinfo.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd\",\"name\":\"Monika Dadool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g\",\"caption\":\"Monika Dadool\"},\"description\":\"Monika Dadool is a Senior Content Writer at Stellar with over 5 years of experience in technical writing. She is a tech enthusiast and expert who specializes in writing about SQL Server, MySQL Server, MariaDB Server, Microsoft Access, Active Directory, email recovery, Microsoft 365, pattern recognition, machine learning, data recovery, file repair, and operating systems like Linux, Windows, and Mac. She also writes about accounting software such as QuickBooks and Sage 50, as well as web-scripting languages like HTML, JavaScript, Python, PHP, Visual Basic, ASP.NET, and AJAX. Monika is passionate about researching and exploring new technologies, and she enjoys developing engaging technical blogs that help organizations and database administrators resolve various issues. When she's not creating content, you can find her on social media, watching web series, reading books, or exploring new food recipes.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/monika-dadool-105a87163\/\"],\"url\":\"https:\/\/www.stellarinfo.com\/blog\/author\/monika\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Error Solved]: SQL Database Restore Failed, Database in Use","description":"To fix Database Restore Failed, Database is In Use - Close all active connections, Set database to single-user mode ,Restart SQL Server service, Disable Log Shipping","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/","og_locale":"en_US","og_type":"article","og_title":"[Error Solved]: SQL Database Restore Failed, Database in Use","og_description":"To fix Database Restore Failed, Database is In Use - Close all active connections, Set database to single-user mode ,Restart SQL Server service, Disable Log Shipping","og_url":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/","og_site_name":"Stellar Data Recovery Blog","article_published_time":"2018-11-27T11:13:33+00:00","article_modified_time":"2026-03-26T06:48:58+00:00","og_image":[{"width":1000,"height":600,"url":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg","type":"image\/jpeg"}],"author":"Monika Dadool","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Monika Dadool","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#article","isPartOf":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/"},"author":{"name":"Monika Dadool","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd"},"headline":"[Error Solved]: SQL Database Restore Failed, Database in Use","datePublished":"2018-11-27T11:13:33+00:00","dateModified":"2026-03-26T06:48:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/"},"wordCount":1488,"commentCount":6,"image":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg","articleSection":["SQL Database Repair"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/","url":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/","name":"[Error Solved]: SQL Database Restore Failed, Database in Use","isPartOf":{"@id":"https:\/\/www.stellarinfo.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage"},"image":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg","datePublished":"2018-11-27T11:13:33+00:00","dateModified":"2026-03-26T06:48:58+00:00","author":{"@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd"},"description":"To fix Database Restore Failed, Database is In Use - Close all active connections, Set database to single-user mode ,Restart SQL Server service, Disable Log Shipping","breadcrumb":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#primaryimage","url":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg","contentUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2018\/11\/SQL-Database-Restore-Failed-Database-in-Use-1.jpg","width":1000,"height":600,"caption":"SQL Database Restore Failed, Database in Use"},{"@type":"BreadcrumbList","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-sql-database-restore-failed-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stellarinfo.com\/blog\/"},{"@type":"ListItem","position":2,"name":"[Error Solved]: SQL Database Restore Failed, Database in Use"}]},{"@type":"WebSite","@id":"https:\/\/www.stellarinfo.com\/blog\/#website","url":"https:\/\/www.stellarinfo.com\/blog\/","name":"Stellar Data Recovery Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stellarinfo.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd","name":"Monika Dadool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g","caption":"Monika Dadool"},"description":"Monika Dadool is a Senior Content Writer at Stellar with over 5 years of experience in technical writing. She is a tech enthusiast and expert who specializes in writing about SQL Server, MySQL Server, MariaDB Server, Microsoft Access, Active Directory, email recovery, Microsoft 365, pattern recognition, machine learning, data recovery, file repair, and operating systems like Linux, Windows, and Mac. She also writes about accounting software such as QuickBooks and Sage 50, as well as web-scripting languages like HTML, JavaScript, Python, PHP, Visual Basic, ASP.NET, and AJAX. Monika is passionate about researching and exploring new technologies, and she enjoys developing engaging technical blogs that help organizations and database administrators resolve various issues. When she's not creating content, you can find her on social media, watching web series, reading books, or exploring new food recipes.","sameAs":["https:\/\/www.linkedin.com\/in\/monika-dadool-105a87163\/"],"url":"https:\/\/www.stellarinfo.com\/blog\/author\/monika\/"}]}},"_links":{"self":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/28375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/comments?post=28375"}],"version-history":[{"count":55,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/28375\/revisions"}],"predecessor-version":[{"id":191120,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/28375\/revisions\/191120"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/media\/171728"}],"wp:attachment":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/media?parent=28375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/categories?post=28375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/tags?post=28375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}