Top Ad unit 728 × 90

SQL Server: Database stuck in "Restoring" state || "RESTORE DATABASE" command with the "WITH RECOVERY" option

SQL Server is a popular relational database management system used by businesses and organizations to manage their data. However, there are times when a database can get stuck in a "Restoring" state, which can prevent users from accessing the data or making changes to the database. In this article, we will discuss what causes a database to become stuck in the "Restoring" state and how to resolve the issue.


Causes of a database getting stuck in the "Restoring" state:

  1. Incomplete restore process: If a restore process was initiated but not completed, it can cause the database to get stuck in the "Restoring" state. This can occur if the restore process was interrupted due to a power failure, network outage, or other unexpected event.
  2. Corrupted backup file: If the backup file used to restore the database is corrupted, it can cause the restore process to fail and the database to become stuck in the "Restoring" state.
  3. Incompatible version: If the database was backed up on a server running a different version of SQL Server than the one being used to restore the database, it can cause the restore process to fail and the database to become stuck in the "Restoring" state.


Resolving the issue:

  • Cancel the restore process: In SQL Server Management Studio (SSMS), you can cancel the restore process by opening the "Activity Monitor" and canceling the restore process. If the cancel option is not available, restarting SSMS may resolve the issue.
  • Run the "RESTORE DATABASE" command with the "WITH RECOVERY" option: This command can be run in the SQL Server Management Studio Query Editor. It will complete the restore process and bring the database back online.


Example:

RESTORE DATABASE dbname WITH RECOVERY

  • Restore the database on a different instance of SQL Server: If the issue cannot be resolved by cancelling the restore process or running the "RESTORE DATABASE" command, restoring the database on a different instance of SQL Server may resolve the issue.


In conclusion, if a database gets stuck in the "Restoring" state, it can prevent users from accessing the data or making changes to the database. However, by cancelling the restore process, running the "RESTORE DATABASE" command with the "WITH RECOVERY" option, or restoring the database on a different instance of SQL Server, the issue can be resolved.

SQL Server: Database stuck in "Restoring" state || "RESTORE DATABASE" command with the "WITH RECOVERY" option Reviewed by Ashok Sen on 21:38:00 Rating: 5

No comments:

Website Design Company at Kolkata All Rights Reserved © 2014 - 2019
Developed by Asenwebmedia

Contact Form

Name

Email *

Message *

Powered by Blogger.