Home > Ask the SQL Server Experts > Michael Hotek Questions & Answers > Can the auto close option cause problems?
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Can the auto close option cause problems?

Michael Hotek EXPERT RESPONSE FROM: Michael Hotek

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 20 February 2004

We are running SQL Server 7 and got the following error message when the first user tried to log in to a database this morning at 6:13:

udopen: Operating system error 32 (The process cannot access the file
because it is being used by another process.) during the
creation/opening of physical device d:MSSQL7dataCanada_Data.MDF.
The database option for auto close was set to 'yes,' so the database was opening and closing every time something ran. Several processes ran during the night, with the last one at 2:15 showing the database had been opened and closed successfully. The 6:13 open failed and when looking at the database through Enterprise Manager the database was listed as 'suspect'. When looking in the data folder the mdf and ldf files were there and looked OK. One of the DBAs has the MSSQL 2000 Enterprise Manager and took the database off line and then put it back on line and it seemed to fix the issue.

My question is can the auto close option cause a problem like this? We have since moved that option to 'NO,' but I'm still concerned there may be something else.


>
EXPERT RESPONSE

The autoclose option shouldn't create an issue. There are all kinds of things that can happen with a closed database. When a database closes, SQL Server closes the files and releases all handles to those files. That means anything can generate a handle to those files and if something else had an open handle on the file, SQL Server would be prevented from accessing the files the way it needs to access them. In your case, something else had an open handle on the file. Since SQL Server couldn't open the file in a read/write mode, it placed the database into a suspect status.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Michael Hotek
Applying LDF file to MDF without turning it to .BAK first?
Procedure for finding last modified info?
Migrating poorly designed database to new, normalized one
Displaying decimal places in SQL Server 2000
Creating a DTS package
Extracting data without strings converted to strange characters
Money data type conversion issue using DTS
Any way to alias a call to functions?
Repairing corrupt MDF files
Memory usage by different databases

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2005 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts