Database in Recovery Pending State

  • One of my databases is in Recovery pending state. I tried to run an Alter command on the database to set it in Online state but it throws the following error.

    Msg 5120, Level 16, State 101, Line 1

    Unable to open the physical file "G:\Data\MSSQL\Database.mdf". Operating system error 3: "3(The system cannot find the path specified.)".

    File activation failure. The physical file name "G:\Data\MSSQL\Data\Database_log.ldf" may be incorrect.

    Msg 945, Level 14, State 2, Line 1

    Database 'Database' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

    Msg 5069, Level 16, State 1, Line 1

    Thanx in advance for any help !

    Sanz
  • santhosh (6/8/2009)


    One of my databases is in Recovery pending state. I tried to run an Alter command on the database to set it in Online state but it throws the following error.

    Msg 5120, Level 16, State 101, Line 1

    Unable to open the physical file "G:\Data\MSSQL\Database.mdf". Operating system error 3: "3(The system cannot find the path specified.)".

    File activation failure. The physical file name "G:\Data\MSSQL\Data\Database_log.ldf" may be incorrect.

    Msg 945, Level 14, State 2, Line 1

    Database 'Database' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

    Msg 5069, Level 16, State 1, Line 1

    Thanx in advance for any help !

    Yes, the server is recovering the database. Was there any sudden shut down of the SQL Server? Just wait till it comes back online again.

    What does your error logs say?

  • Recovery pending means that for some reason SQL cannot run restart recovery on the database. Usually this is because the log is missing or corrupt.

    "G:\Data\MSSQL\Database.mdf".

    "G:\Data\MSSQL\Data\Database_log.ldf"

    Do these files exist? Is the drive online and available? If so, try stopping and restarting the SQL service as it may be that SQL came up before the drive was available. That would have caused this error.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Krishna Potlakayala (6/8/2009)


    Yes, the server is recovering the database. Was there any sudden shut down of the SQL Server? Just wait till it comes back online again.

    That's true of the state RECOVERING. Recovery Pending means that recovery cannot be started. Until the cause is fixed, recovery cannot run and the DB cannot come online.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks, this worked for me!

    Cheers,

    Jeremy.

  • Hello

    Unfortunatelly I am having a simillar issue and waiting for the database to recover seems not to work for me. The database seems to be stuck in RECOVERING state.

    Moreover, if I restart SQL Server, other databases start to have the same issue, meaning they become stuck in RECOVERING mode too, while other database seem to have been recovered.

    Now, even msdb is in RECOVERING state.

    Any help on this would be greatly appreciated.

    Thanks,

    Ioana

  • Please post new questions in a new thread.

    Thanks

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Just as an FYI, in case it helps anyone...

    We recently had this same problem. One of our DBs was stuck in a "Recovery Pending" state following a sudden (and unusual) loss of power. (An onsite electrician was to blame.)

    Anyhow, it turns out that when the server booted back up, the various drives were a little slower to come online. As a result, when SQL Server went to restore the DB, the drives on which the needed data is stored weren't yet available. (The error logs pointed to which drives were needed).

    Once the drives were available, a manual restart of SQL Server fixed the problem and the DB was automatically recovered.

    Cheers

  • Hey Guys Nothin to do....

    Chek firs mdf and ldf is exist or not..

    if exist run below coommand on master DB

    ALTER DATABASE 'DATBASE NAME' SET OFFLINE WITH ROLLBACK IMMEDIATE

    ALTER DATABASE 'DATBASE NAME' SET ONLINE WITH ROLLBACK IMMEDIATE

  • iqbal1258 (10/19/2011)


    Hey Guys Nothin to do....

    Chek firs mdf and ldf is exist or not..

    if exist run below coommand on master DB

    ALTER DATABASE 'DATBASE NAME' SET OFFLINE WITH ROLLBACK IMMEDIATE

    ALTER DATABASE 'DATBASE NAME' SET ONLINE WITH ROLLBACK IMMEDIATE

    Why you want to do this?

    Muthukkumaran Kaliyamoorthy
    https://www.sqlserverblogforum.com/

  • iqbal1258 (10/19/2011)


    Hey Guys Nothin to do....

    Chek firs mdf and ldf is exist or not..

    if exist run below coommand on master DB

    ALTER DATABASE 'DATBASE NAME' SET OFFLINE WITH ROLLBACK IMMEDIATE

    ALTER DATABASE 'DATBASE NAME' SET ONLINE WITH ROLLBACK IMMEDIATE

    Funny you should post this today. I was asked to help with a similar issue this morning. DB would not come online posting error - insufficient disk space or memory. There was plenty of disc space, but memory was a bit over-taxed. One thing I did note was the ldf was 2+ times larger than the mdf at around 58GB which raises other flags. I ended up doing just this, setting the db offline then online. It took over an hour to come up, but did succeed and we were back in business after doing a little clean-up on the DB.

  • I had all databases in "recovery pending" not because of disks nor memory. It was from SQL Server upgrade running into an error. The error was caused by 3rd party software had customized SSRS config (non-microsoft tags in rsreportserver.config). I removed the cause, upgraded the database instance, remove the databases (make sure you don't damage all the data and log files), re-attach them back. Violla, they are working again like brand new.

  • Goodmorning,

    We had a same issue when one of our VM had a problem with the drives and had some maintnenace, but it was resolved after a restart. However there is also a workaround which worked for me through GUI jus change the Recovery model to simple from or vice versa, this will resolve the issue.

    Regards

    Srikanth Reddy Kundur

  • I had tried but it showing in restoring state...

  • Thanks Its working For me

Viewing 15 posts - 1 through 15 (of 67 total)

You must be logged in to reply to this topic. Login to reply