Repairing the System Table Index

Repairing a corrupted system table index is a multi-step process; running sp_fixindex is one of those steps.

To perform the repair:

  1. Get the object name, object ID, and index ID of the corrupted index. If you only have a page number, refer to “How to Find an Object Name from a Page Number”.

  2. If the corrupted index is on a system table in the master database, put Adaptive Server in single-user mode. Refer to “How to Start Adaptive Server in Single-User Mode” for details.

  3. If the corrupted index is on a system table in a user database, put the database in single-user mode and reconfigure to allow updates to system tables:

    1> use master
    2> go
    

    1> sp_dboption database_name, "single user", true
    2> go
    

    1> sp_configure "allow updates", 1
    2> go
    

  4. Issue the sp_fixindex command:

    1> use database_name
    2> go
    

    1> checkpoint
    2> go
    

    1> sp_fixindex database_name, object_name, index_ID
    2> go
    

    NoteTo run sp_fixindex, you must possess “sa_role” permissions.

  5. Run dbcc checktable to verify that the corrupted index is now fixed.

  6. Disallow updates to system tables:

    1> use master
    2> go
    1> sp_configure "allow updates", 0
    2> go
    

  7. Turn off single-user mode:

    1> sp_dboption database_name, "single user", false
    2> go
    

    1> use database_name
    2> go
    

    1> checkpoint
    2> go