|
-
Feb 9th, 2009, 08:21 AM
#1
[RESOLVED] Error 5069 on shrink database
I recieved the following error on a when attempting to shrink a database after removing a column of datatype Image:
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Location: tmpilb.cpp:2565
Expression: fFalse
SPID: 111
Process ID: 4216
Description: Attempt to access expired blob handle (3)
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 3624, Level 20, State 1, Line 1
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support.
The system I was running this on is MS Server 2008, SQL Server 2005 Enterprise Edition 64 bit.
The code worked fine in a test env (and on another database where we did not drop the column with type Image). The script is
DECLARE @DataFileFreeSpaceGB INT
DECLARE @LogFileFreeSpaceGB INT
SELECT @DataFileFreeSpaceGB = 10
SELECT @LogFileFreeSpaceGB = 1
DECLARE @DBName VARCHAR(100) --Database Name
DECLARE @filenameD VARCHAR(500) -- DataFile
DECLARE @filenameL VARCHAR(500) -- Logfile
DECLARE @DSpaceUsed DECIMAL(10) --Spaceused in Meg
DECLARE @LSpaceUsed DECIMAL(10) --Spaceused in Meng
DECLARE @sStr VARCHAR(200) -- A string SQL statement to EXECute
SELECT @DBName = DB_NAME()
SET @sStr = 'ALTER DATABASE ' + @DBName + ' SET RECOVERY Simple'
EXEC (@sStr)
--DataFile
SELECT @fileNameD = name From sys.database_files Where type = 0
SELECT @DSpaceUsed = (FILEPROPERTY (@filenameD,'SpaceUsed ') * 8192.0)/1024/1024
SET @DSpaceUsed = @DSpaceUsed + (@DataFileFreeSpaceGB * 1000)
SET @sStr = 'DBCC ShrinkFile (' + @fileNameD + ',' + Convert(VARCHAR(50),@DSpaceUsed) + ')'
EXEC (@sStr)
--Logfile
SELECT @fileNameL = name From sys.database_files Where type = 1
SELECT @LSpaceUsed = (FILEPROPERTY (@filenameL,'SpaceUsed ') * 8192.0)/1024/1024
SET @LSpaceUsed = @LSpaceUsed + (@LogFileFreeSpaceGB * 1000)
SET @sStr = 'DBCC ShrinkFile (' + @fileNameL + ',' + Convert(VARCHAR(50),@LSpaceUsed) + ')'
EXEC (@sStr)
SET @sStr = 'ALTER DATABASE ' + @DBName + ' SET RECOVERY FULL'
EXEC (@sStr)
I have run a DBCC CheckDB after the error and came back with no errors listed for the database this failed on.
I have decied to ignore the error as the DB did perform the shrink
Last edited by GaryMazzone; Feb 20th, 2009 at 08:40 AM.
Sometimes the Programmer
Sometimes the DBA
Mazz1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|