Friday, May 10, 2013

SQL Server Databases in Recovery Pending state

If you encounter an error database state “Recovery Pending” don’t panic you’re not aloneJThis is because SQL server has encountered improper shutdown or not mounted properly. Possible reason insufficient permission to the DB file folder may prevent the recovery. Follow the steps mentioned below it might help…
 
 
You can see the various state definitions from following link
 
 
 
If you got this error don’t try to delete the database. Following steps may help you to recover.
 
1.      Restart your sql server instance and check the database state. Still if it is not recovered then continue with next step
2.      Wait for some time (5 or 10 mines) probability it will get online, if not it will go to suspended mode.
3.      If it is in suspended state following link will help you to recover
 
4.      If still it continue with pending state run the following command
 
ALTER DATABASE <> SET OFFLINE WITH ROLLBACK IMMEDIATE
Go
ALTER DATABASE <> SET ONLINE WITH ROLLBACK IMMEDIATE
Go
       This command will help you identify the issue
      
       Ex: Sometime you may receive following error
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "Abc.mdf". Operating system error 5: "5(Access is denied.)".
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "Abc_log.ldf". Operating system error 5: "5(Access is denied.)".
Msg 5181, Level 16, State 5, Line 1
Could not restart database "Abc". Reverting to the previous status.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
5.       Try to give proper access rights to the database file folder and restart the SQL Server.
a.       Check if files are in read-only mode or not. 
b.      Check the SQL server service account it is has access to database file folder.
 

5 comments:

  1. I was created a database for my project but sql MDF file becomes deleted from the system but the mdf file was very important to me then i have used the sql database recovery tool to recover mdf file.

    ReplyDelete
  2. Hi friends i wanna share you some more few tricks to resolve this issues. Must visit :- http://www.sqlrecoverysoftware.net/blog/sql-database-in-recovery-mode.html

    ReplyDelete
  3. Better way Sql database recovery which you can use later to recover items from corrupt files like Index Keys, Default Values, Unique Keys, constraint Checks, Triggers, Views, Stored Procedures, Deleted Records and Partly Corrupted Records.

    See at- http://www.recoverydeletedfiles.com/sql-database-recovery-software.html

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. I appreciate the way you have tried to help users to resolve the Recovery pending error in SQL database. I know about a better alternative in the form of a software called SQL Repair Tool which greatly assisted me to solve this problematic solution.

    For more information about this useful utility have a look here:
    http://www.sqlrecoverytool.com/

    ReplyDelete