Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Clustered index not in Sys.Partions (The metadata is inconsistent. Run DBCC CHECKDB to check for a metadata corruption) RE: Clustered index not in Sys.Partions (The metadata is inconsistent. Run DBCC CHECKDB to check for a metadata corruption)

  • GilaMonster (1/30/2015)


    If the metadata is corrupt, you're not going to be able to drop the index, no matter what commands you try.

    Before trying any more shotgun approaches...

    Do you have a backup of this database? Do you have log backups?

    What's the downtime and data loss allowances for this database?

    How big is that table? (rows/MB)

    When was the last time you ran an integrity check that came back clean?

    Can you run the following statement and post the full and complete, unedited output?

    DBCC CheckCatalog('elmah') with no_infomsgs

    Thanks for the response Mr. Monster.

    The full unabridged output is:

    - "Command(s) completed successfully."

    The sys.partitions says 256 rows, but I don't think that's accurate for rows size on the table. My guestimate (as I can't query the table) is that there's at least 5k rows.

    It's not a system critical table by any means. This table has been corrupted for about 3 weeks ago, and our backups are only 10 days old. I've detached and restored from a .bak, and get the same results.

    ELMAH is a library to notify of unhandled exceptions in our web apps - we get emails notifications for our website and this db is the logging for these. So if we had to rebuild this db, it's not the best response, but it's an acceptable solution.

    The corruption was caused by our mirroring software (double take).

    I wanted to take this opportunity to learn more about the inner workings of SQLServer, as I'm primarily a developer and our psuedo-DBA.

    **

    I just ran: dbcc checktable ('elmah_error') WITH NO_INFOMSGS

    And get this:

    Msg 602, Level 21, State 30, Line 1

    Could not find an entry for table or index with partition ID 72057594131185664 in database 19. This error can occur if a stored procedure references a dropped table, or metadata is corrupted. Drop and re-create the stored procedure, or execute DBCC CHECKDB.

    In Sys.Databases there's no entry for database_id = 19.