missing mdf and ldf files

  • I’m not sure if this is a SQL or OS related error but please bare with me.

    So after a server reboot several of my databases are no longer working. When attempting to view the properties of the database I get an error saying:

    “Database cannot be opened due to inaccessible files or insufficient memory or disk space. See SQL server error log for details (Microsoft Server error 945 “

    The SQL error log says:

    FCB::Open: Operating system error 32(error not found) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Sagedata5.mdf'. Diagnose and correct the operating system error, and retry the operation.

    I can’t run a check db or anything on the database as SQL can’t recognise the database I get an incorrect syntax (as expected)

    My first thought was to try and attach the mdf and ldf files but this is where it gets strange. When I use the attach in SQL management studio I cannot see any of the mdf or ldf files in question, but when using windows explorer and I navigate to the directory I can see all of my files both mdf and ldf.

    I only want to resort to a backup as a last resort so any other advice would be very appreciative. I know its not disk space or memory as plenty is available.

    Info

    SQL Server 2005 standard SP3

    OS Server 2003 standard edition SP2

  • OS error 32 means the file is already in use by another process. Could it be anti-virus software, or another SQL Server instance on the same computer? You may have to use something like sysinternals to find out what's accessing the file.

    John

  • You can use handle.exe http://technet.microsoft.com/en-us/sysinternals/bb896655 or Process explorer http://technet.microsoft.com/en-us/sysinternals/bb896653 and find out the handle taken by process on the physical mdf & ldf files.

    Once you remove the handle, you should be able to by pass operating system error 32.

  • I'm curious to know how or if you were able to see those mdf and ldf files again from SSMS. Even if the files were in use by another process, you should still be able to see them from within SSMS. It's as if the SQL Server service account somehow lost access to read the files or folder.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • This was removed by the editor as SPAM

Viewing 5 posts - 1 through 4 (of 4 total)

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