Wednesday, July 27, 2011

How to fix Error “Open Failed” in SQL server

When you are trying to start the services of SQL server database and found the database is unavailable. At this situation you are unable to do any operation on the SQL server database like insert, delete, rename, update, and many more or even unable to open the SQL server database. You can open and see SQL server error log to know the reasons for the problem. After knowing the reason, you can take appropriate method to recover sql server database. When you open the error log got an error message. The error message is:

"FCB::Open failed: Could not open file for file number . OS error: 5(access denied)"

Possible Cause: There are tons of reasons for the above problem but we will discuss here about hardware failure problem and account access problem.

Hardware Failure Problem: Whenever you will get the above error message. It is recommended you to check the hardware component of your system first before try any other action. If you found any faulty hardware component then replace it with new one and fix the problem.

Account Access Problem: The account in which SQL server is running does not has permission to access the folder that contains data and log files.   

Follow Steps to Fix
: You can fix the above error message by following the below steps:
  • Click on the Start button of your system
  • Go to the programs and select SQL server
  • Click on the folder that contains one the database files
  • Right click on the folder
  • Select sharing and security
  • Now, select security button
  • Click on the Add button
  • A text box will be appear
  • Write qualified user-name of the service account in the text box
  • Check the allow column to ensure full control
  • Repeat these all steps for all other database and log folder.
  • Shutdown the SQL server database
  • Now, restart the SQL server database from configuration manager.