SQL Server Home
Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit ... not to ...
6/24/2009 1:44:45 AM
User(s) can reproduce this bug
I was building a temporary table to fill with random data to test an udf.
I can only reproduce this using temporary tables. An base table works fine (which was my workaround).
Msg 605, Level 21, State 3, Line 9
Attempt to fetch logical page (1:1273) in database 2 failed. It belongs to allocation unit 7710162566401949696 not to 1801439857176018944.
> select @@version
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1)
SQL Server 2008 - Standard Edition
Windows Server 2008
Operating System Language
Steps to Reproduce
create table #t ( f int ) -- column type does not seem to matter.
insert into #t values ( null ) -- initial row
insert into #t select null from #t t1, #t t2 -- +1 row (total 2 rows)
insert into #t select null from #t t1, #t t2 -- +4 rows (total 6 rows)
insert into #t select null from #t t1, #t t2 -- +36 rows (total 42 rows)
insert into #t select null from #t t1, #t t2 -- +1764 rows (total 1806 rows)
insert into #t select null from #t t1, #t t2 -- crash (should be +3261636 rows, total 3263442 rows)
Msg 605, Level 21, State 3, Line 7
Attempt to fetch logical page (1:1041) in database 2 failed. It belongs to allocation unit 7710162566401949696 not to 2017612639412682752.
Either a "(3261636 row(s) affected)" or, if this is by design, a better error message.
to post a comment.
Please enter a comment.
on 3/28/2014 at 6:35 AM
I just received this same error in SQL Server 2008 R2 SP2.
Anatoly V. Popov
on 2/14/2013 at 3:04 AM
It seems, that issue fixed in Sql Server 2012 SP1 CU2
on 12/6/2012 at 1:37 AM
I encountered this today on my production server. I am using temp tables in report procedures. Clustered Index resolved the issue but it is almost impossible for me to update all report procedures for this. I hope MS soon comes up with a hot fix to resolve this issue.
Anatoly V. Popov
on 5/18/2012 at 12:27 AM
We ran into it in Sql Server 2008 R2 SP1.
on 2/3/2011 at 2:44 PM
We ran into this today, big thanks to Richard Douglas for pointing me the solution. I've filed new bug with a repro for our case. https://connect.microsoft.com/SQLServer/feedback/details/641122/error-605-in-tempdb-on-sql-2008-r2-despite-bug-claims-to-be-fixed
on 2/2/2011 at 4:52 AM
There is still a problem on SQL Server 2008 SP2 with temp tables that do not have a clustered index as I encountered it this morning.
Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64) Sep 16 2010 19:43:16 Copyright (c) 1988-2008 Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2)
on 10/8/2010 at 2:03 PM
I'm encountering this problem as well in both SQL Server 2008 SP1 and SP2.
In my case the workaround did solve the problem.
Some additional info:
The temp table is created in a stored procedure which populates a SQL Server Reporting Services report dataset.
The stored procedure executes without warnings for me when manually running it in SQL Server Management Studio.
However, when trying to run the report (using identical parameters), I see a variant of the reported error message.
on 3/16/2010 at 6:34 AM
Just to add I can't find the source as this is a working production system, maybe 400+ concurrent users; just upgraded from sql 2000 so absolutley no chance to locate cause at this time.
on 3/16/2010 at 6:31 AM
sql 2008 sp1+cu2 ent x64 getting a batch of these errors so obviously not fixed in sp1 - always worrying to get any issues in a production system.
on 2/23/2010 at 6:03 AM
Im getting the same thing with SP1.
Microsoft SQL Server 2008 (SP1) - 10.0.2746.0 (X64) Nov 9 2009 16:37:47 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2) Microsoft SQL Server 2008 (SP1) - 10.0.2746.0 (X64) Nov 9 2009 16:37:47 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2)
on 2/10/2010 at 2:05 AM
In Service Pack 1 the is still occuring. Clustered index helps.
on 1/15/2010 at 11:16 AM
It appears after further investigation that this issue was already identified and was fixed in Service Pack 1.
Thanks again for taking the time to report the issue!
on 10/28/2009 at 4:40 PM
Add a clustered index works. Thanks.
on 7/17/2009 at 9:52 AM
Thanks for taking the time to send us your feedback. We're looking in to the issue, and will get back to you when we know more about it.
to post a workaround.
Please enter a workaround.
on 9/8/2009 at 7:09 AM
Add a clustered index to the temp table. Using the example below, create the table as follows:
create table #t (pk INT IDENTITY(1,1) CONSTRAINT PK_pk PRIMARY KEY CLUSTERED, f int )
© 2014 Microsoft