You may receive a "FCB::RemoveAlternateStreams: Operating system error <error number>" when starting up databases on an instance of SQL Server 2005 or SQL Server 2008

Article translations Article translations
Article ID: 970878 - View products that this article applies to.
Expand all | Collapse all
Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Symptom



Consider the following scenario:

·          You install an application software that in turn installs file system mini-filter drivers [For example, Anti-Virus software, backup applications, etc]

·          You install SQL Server 2005 or SQL Server 2008 on the same server



In this scenario, the following error messages may be written to SQL error log for each of the databases that SQL server tries to start as part of its startup process:



2009-04-10 09:29:48.22 spid5s      Starting up database 'master'.

2009-04-10 09:29:48.24 spid5s      Error: 17207, Severity: 16, State: 1.

2009-04-10 09:29:48.24 spid5s      FCB::RemoveAlternateStreams: Operating system error 6(The handle is invalid.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf'. Diagnose and correct the operating system error, and retry the operation.

2009-04-10 09:29:48.85 spid9s      Starting up database 'model'.

2009-04-10 09:29:48.89 spid9s      Error: 17207, Severity: 16, State: 1.

2009-04-10 09:29:48.89 spid9s      FCB::RemoveAlternateStreams: Operating system error 6(The handle is invalid.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\model.mdf'. Diagnose and correct the operating system error, and retry the operation.

2009-04-10 09:29:49.10 spid9s      Clearing tempdb database.

2009-04-10 09:29:49.49 spid9s      Error: 17207, Severity: 16, State: 1.

2009-04-10 09:29:49.49 spid9s      FCB::RemoveAlternateStreams: Operating system error 6(The handle is invalid.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\tempdb.mdf'. Diagnose and correct the operating system error, and retry the operation.

 

You will also notice the same errors reported in the Application event log.



Event Type:       Information

Event Source:    MSSQL$SQL2005

Event Category: (2)

Event ID:          17137

Date:                4/10/2009

Time:                9:29:48 AM

User:                N/A

Computer:         <Computer name>

Description:

Starting up database 'master'.

 

Event Type:       Error

Event Source:    MSSQL$SQL2005

Event Category: (2)

Event ID:          17207

Date:                4/10/2009

Time:                9:29:48 AM

User:                N/A

Computer:         <Computer name>

Description:

FCB::RemoveAlternateStreams: Operating system error 6(The handle is invalid.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf'. Diagnose and correct the operating system error, and retry the operation.



You might encounter similar errors while performing any database maintenance activity that results in starting up a database like creating a new database, restore of a database from backup, issuing alter database commands to bring a database online, can potentially result in the error messages discussed above

 

Cause



SQL Server uses named alternate streams of NTFS for the internal snapshot of the database that is created, when running DBCC CHECKDB family of commands. Under normal conditions, this internal snapshot is dropped and the corresponding alternate stream is removed at the completion of the DBCC command. Under some rare circumstances, it is possible that this alternate stream is not removed and its file system resources not cleaned up. During startup of a database, SQL Server attempts to enumerate the alternate streams that are present in a data file and remove them. The intent is to release the disk resources used by the internal snapshot. SQL Server uses the Win32 API’s BackupRead() and BackupSeek() to enumerate the alternate streams. These Win32 API’s do not support file handles created with asynchronous flag passed as input parameters. SQL Server always opens the database files with asynchronous I/O flag [FILE_FLAG_OVERLAPPED]. This incompatibility results in the error messages mentioned in the Symptom section.

Status: Microsoft is currently investigating possible resolutions to this problem and will post new information as it becomes available to this article.

You might observe this problem with the following combination of SQL Server and Windows Operating system:

·          All editions of SQL Server 2005 installed on all supported Windows Operating systems

·          All editions of SQL Server 2008 installed on systems running Windows XP

 

You will not encounter this problem with the following combination of SQL Server and Windows Operating system:

·          All editions of SQL Server 2008 installed on systems running Windows 2003 and higher.

  On newer operating systems [Windows 2003 and later], SQL Server 2008 makes use of the Win32 API’s FindFirstStream() and FindNextStream() to extract the information about the alternate streams.

More Information



This error is reported after all the alternate streams are deleted and their resources freed. As of this writing, Microsoft does not believe that these error messages prevent a database from starting up. If you suspect that there is space being consumed by alternate streams and the alternate stream is not getting deleted, you can use the “Streams” utility from Windows Sysinternals. This will enumerate and list all alternate streams. Streams with the name MSSQL_DBCC are created by SQL Server for the internal snapshots. If you find any of these named alternate streams created by SQL Server that are not cleaned up after the database is started, contact Microsoft Customer Support Services (CSS) for more help.



Additional References



·          DBCC (Transact-SQL): http://msdn.microsoft.com/en-us/library/ms188796(SQL.90).aspx

·          BackupRead() API: http://msdn.microsoft.com/en-us/library/aa362509.aspx

·          AlternateStreams & new API’s: http://msdn.microsoft.com/en-us/magazine/cc300448.aspx#S4

·          FILE_FLAG_OVERLAPPED: http://msdn.microsoft.com/en-us/library/aa363858.aspx

 

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.

Properties

Article ID: 970878 - Last Review: May 1, 2009 - Revision: 1.0
APPLIES TO
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise Evaluation
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2005 Standard Edition
Keywords: 
kbrapidpub kbnomt KB970878

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com