---
title: "Database issue :MS SQLServer stuck in “Restoring” state"  
description: "Database issue :MS SQLServer stuck in “Restoring” state"  
author: "Takeshi Okada"  
published: 2015-09-05  
updated: 2015-09-05  
canonical: https://www.mindstick.com/forum/33442/database-issue-ms-sqlserver-stuck-in-restoring-state  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 2 minutes  

---

# Database issue :MS SQLServer stuck in “Restoring” state

[backed up](https://answers.mindstick.com/qa/41054/in-three-decisions-in-the-early-1800s-whose-powers-were-backed-up-by-the-supreme-court) a [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax):

```
BACKUP DATABASE MyDatabaseTO DISK = 'MyDatabase.bak'WITH INIT --overwrite existing
```

And then tried to [restore](https://yourviews.mindstick.com/story/1480/ways-to-restore-ecosystems-and-heal-the-planet) it:\

```
RESTORE DATABASE MyDatabase   FROM DISK = 'MyDatabase.bak'   WITH REPLACE --force restore over specified database
```

And now the database is stuck in the [restoring state](https://www.mindstick.com/forum/33467/model-db-in-restoring-state-can-t-start-sql-server).\
Some [people](https://www.mindstick.com/news/2295/more-people-need-to-monitor-this-crucial-metric-for-heart-health) have theorized that it's because there was no [log file](https://www.mindstick.com/articles/327201/create-log-file-in-c-sharp) in the [backup](https://www.mindstick.com/interview/1205/what-is-the-command-to-take-backup-and-restore-for-sharepoint-site), and it needed to be rolled [forward](https://www.mindstick.com/forum/33488/in-webview-disabling-uitoolbar-s-back-and-forward-butttons) using:\

```
RESTORE DATABASE MyDatabaseWITH RECOVERY 
```

[Except](https://www.mindstick.com/blog/144/union-intersection-and-except-operator-in-sql-server) that, of course, fails:\

```
Msg 4333, Level 16, State 1, Line 1The database cannot be recovered because the log was not restored.Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.
```

And exactly what you want in a catastrophic situation is a restore that won't work.\
The backup contains both a [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) and log file:\

```
RESTORE FILELISTONLY FROM DISK = 'MyDatabase.bak'Logical Name    PhysicalName=============   ===============MyDatabase    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\MyDatabase.mdfMyDatabase_log  C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\MyDatabase_log.LDF
```

## Replies

### Reply by Anonymous User

You need to use the WITH RECOVERY option, with your database RESTORE command, to bring your database online as part of the restore process.\
This is of course only if you do not intend to restore any transaction log backups, i.e. you only wish to restore a database backup and then be able to access the database.\
Your command should look like this,\

```
RESTORE DATABASE MyDatabase   FROM DISK = 'MyDatabase.bak'   WITH REPLACE,RECOVERY
```

You may have more sucess using the restore database wizard in SQL Server Management Studio. This way you can select the specific file locations, the overwrite option, and the WITH Recovery option.


---

Original Source: https://www.mindstick.com/forum/33442/database-issue-ms-sqlserver-stuck-in-restoring-state

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
