DATABASE corrupt

  • Hi,

    i have a database that seems offline or corrupt.

    The problem is i cannot browse through the Database's objects because the Database appears to be not having any objects to browse when i check using SSMS.

    pls assist.

  • Query sys.databases, what's the state_desc for that database?

    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
  • RECOVERY_PENDING

  • Look through the SQL error logs, there will be messages saying why the DB could not be opened. Post all of those messages here.

    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
  • when i run ALTER DATABASE DBNAME SET ONLINE command, i get the following result:-

    Msg 5120, Level 16, State 101, Line 1

    Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\dbname.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".

    Msg 945, Level 14, State 2, Line 1

    Database 'dbname' 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

    ALTER DATABASE statement failed.

    when i run SELECT state_desc FROM sys.databases WHERE name=dbname;

    i get the state as RECOVERY_PENDING.

    help?

  • I didn't say set the DB online. I said read through the SQL error logs and find all the errors relating to that database.

    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
  • Hi,

    my bed.....

    the db is not online. still

  • Date8/16/2011 12:24:45 PM

    LogSQL Server (Archive #2 - 8/17/2011 7:43:00 PM)

    Sourcespid147

    Message

    FCB::Open failed: Could not open file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\bdname.mdf for file number 1. OS error: 32(The process cannot access the file because it is being used by another process.).

    Date8/16/2011 10:35:14 AM

    LogSQL Server (Archive #2 - 8/17/2011 7:43:00 PM)

    Sourcespid261

    Message

    FCB::Open failed: Could not open file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\bdname.mdf for file number 1. OS error: 32(The process cannot access the file because it is being used by another process.).

    Date8/16/2011 10:35:14 AM

    LogSQL Server (Archive #2 - 8/17/2011 7:43:00 PM)

    Sourcespid261

    Message

    During upgrade, database raised exception 945, severity 14, state 2, address 017195C8. Use the exception number to determine the cause.

  • Ok....

    Has this database has worked before on this server?

    Is there another instance of SQL on this server?

    Is there an anti-virus running?

    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
  • Hi,

    According to the customer the Database was working before +- 24-48 hours ago.

    There is another instance on the erver running but i have no access to that instance.

    Microsoft forefront is the antivirus.

  • Make sure that the exclusions in the anti-virus are correct. It should exclude a,, mdf, ndf, ldf, bak and trn files.

    Also, download sysinternals process explorer and use that to see what has a handle on that file. Some other process other than SQL has it open. The antivirus is a likely cause.

    Lastly, find out from the server admin what has changed in that 24-48 hours. Speak to the person responsible for the other instance too.

    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

Viewing 11 posts - 1 through 10 (of 10 total)

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