Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit ... not to ... - by Tant102

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


20
0
Sign in
to vote
ID 469811 Comments
Status Closed Workarounds
Type Bug Repros 13
Opened 6/24/2009 1:44:45 AM
Access Restriction Public

Description

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) 
Sign in to post a comment.
Posted by Rakesh Sharma on 10/19/2014 at 8:28 AM
The issue still persist in SQL 2008 R2 SP2 and creating a cluster index on #temp table is not a permanent solution.
Posted by Leonid2014 on 8/12/2014 at 4:29 AM
I have exactly the same problem in SQL Server 2008 R2 SP2. Sometimes when performing the same script, there is another kind of error: (SQL Server detected a logical consistency-based I/O error: invalid protection option. It occurred during a read of page (1:56744) in database ID 2 at offset 0x0000001bb50000 in file 'E:\DATA\tempdb.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. [SQLSTATE HY000] (Ошибка 824))

Script:

create table #TestTable1 (ID int)

insert into #TestTable1
(select 1000 rows)

insert into #TestTable1
select distinct t2.id+1000000
from testdb.dbo.TestTable2 T2 with(nolock)
inner join #TestTable1 T1 on T1.ID=T2.ID
Posted by dcrph127 on 3/28/2014 at 6:35 AM
I just received this same error in SQL Server 2008 R2 SP2.
Posted by Anatoly V. Popov on 2/14/2013 at 3:04 AM
It seems, that issue fixed in Sql Server 2012 SP1 CU2
Posted by Atif-ullah Sheikh 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.
Posted by Anatoly V. Popov on 5/18/2012 at 12:27 AM
We ran into it in Sql Server 2008 R2 SP1.
Posted by Erland Sommarskog 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
Posted by Richard Douglas 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)
Posted by Stefan M 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.
Posted by colin leversuch-roberts 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.
Posted by colin leversuch-roberts 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.
Posted by Mike Wade on 2/23/2010 at 6:03 AM
Im getting the same thing with SP1.

SELECT @@VERSION.....

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)
Posted by Aviel Iluz on 2/10/2010 at 2:05 AM
In Service Pack 1 the is still occuring. Clustered index helps.
Posted by Microsoft on 1/15/2010 at 11:16 AM
Hi,
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!

emily
Posted by dy5005 on 10/28/2009 at 4:40 PM
Add a clustered index works. Thanks.
Posted by Microsoft on 7/17/2009 at 9:52 AM
Hi,
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.

thanks,
Emily