I am getting an error 2521 on my SQL Server - what can I do?

Neil Pike

March 4, 1999

2 Min Read
ITPro Today logo

A. Full error is "Msg 2521, Level 16, State 1, Server xxx, TableCorrupt: Page is linked but not allocated; check the following pages and table:alloc page#= extent id=6676856 logical page#=6676856 object id inextent=8 (object name=syslogs) index id in extent=0 Make sure that is a"real" 2521 by running the dbcc in single-user mode as they can bespuriously reported if updates are occuring at the time of the dbcc.

Make sure there are no other errors in the dbcc either.

At this point if you have a good backup and will not lose any data, then nowis the time to use it. If you don't have a good backup then look at your backupprocedures! To try and resolve the problem read on :-

Use DBCC PAGE (doc'd in the Books Online) to determine whether the page is adata or index page. If it is an index you are in luck and you may be able todrop and recreate the index.

If it is not an index page or this does not work then you will need totransfer all the data/objects into a new database. It must be a differentdatabase as otherwise the pages your table is using but aren't allocated may beallocated for the new table and cause more problems. If the transfer fails thenmanually select out data in ranges based on keys above and below the brokenpoint.

Then drop the old table, recreate it and transfer the data back in.

If the above is not possible due to the size of the database or otherreasons then your only alternative is to pay for Microsoft PSS support who maybe able to patch the pointers in the tables/pages directly for you. Howeverthis sort of fix is not guaranteed and is done (if at all) on a best effortsbasis totally at your risk.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like