| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Using SQL Express 2005 SP2. The call “Database.Size” (using SQL Server Manager Objects - SMO) is called approximately every 15 seconds which worked fine. After computer sits for a few days eventually will get message: “Database 'MyDatabaseName' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.” Error# 945 Looked at the server log and found nothing that helped. The .mdf and .ldf related files were on the hard drive. All of the SQL permissions were fine. Using SQL Server Manager Studio Express the database name appears in the tree view however there was no expansion plus sign next to it and no other icons next to it. Right clicking on the database caused the above error to appear. Does anyone know what would cause this error to occur? |
|
#2
|
| It could be that the autoclose option has been set for this Database. Try turning it off and see if the problem persists. -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS SQL Server MVP Toronto, ON Canada https://mvp.support.microsoft.com/profile/Tom.Moreau "Scott" news:BE2E1891-99E3-4C48-9236-D11318E6D691-at-microsoft.com... Using SQL Express 2005 SP2. The call “Database.Size” (using SQL Server Manager Objects - SMO) is called approximately every 15 seconds which worked fine. After computer sits for a few days eventually will get message: “Database 'MyDatabaseName' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.” Error# 945 Looked at the server log and found nothing that helped. The .mdf and .ldf related files were on the hard drive. All of the SQL permissions were fine. Using SQL Server Manager Studio Express the database name appears in the tree view however there was no expansion plus sign next to it and no other icons next to it. Right clicking on the database caused the above error to appear. Does anyone know what would cause this error to occur? |
|
#3
|
| Thanks for the response. I haven't yet implemented disabling the auto close. I am waiting for the problem to occur again and to then use an application that will read the status of the database to see what mode it is in. More information: Noticed that other databases which were also idle were not in the same state as the one that appeared to be "locked up". Also after either re-starting the sql server service or re-booting the computer the database would then be accessible. "Tom Moreau" wrote: > It could be that the autoclose option has been set for this Database. Try turning > it off and see if the problem persists. > > -- > Tom |
|
#4
|
| Hi Tom, The Inaccessible error has re-surfaced. I did not set the Database AutoClose option. However the database status was: "RecoveryPending, Shutdown" At this point I had an application that set thet database to online (see code snippet below): Server srv = new Server("localhost\SQLExpress"); Database Database = srv.Databases["MyDatabaseName"]; Database.SetOnline(); After running the above the database returned and was accessible. Is this still due to the AutoClose option or is there something else that is causing the to occur? Note that other databases were not in the state of "RecoveryPending". "Tom Moreau" wrote: > It could be that the autoclose option has been set for this Database. Try turning > it off and see if the problem persists. > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS > SQL Server MVP > Toronto, ON Canada > https://mvp.support.microsoft.com/profile/Tom.Moreau > > |
|
#5
|
| Can you run: sp_helpdb 'MyDatabaseName' I'd like to see if the AutoClose option has been set for that Database. By running your script, that would bring it back online. If the AutoClose option is on, then we need to turn it off. If it is already on, then there must be some process that is simply taking it offline for whatever reason. -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS SQL Server MVP Toronto, ON Canada https://mvp.support.microsoft.com/profile/Tom.Moreau "Scott" news:C1C0EDDC-F99A-413A-9D86-CA9433697638-at-microsoft.com... Hi Tom, The Inaccessible error has re-surfaced. I did not set the Database AutoClose option. However the database status was: "RecoveryPending, Shutdown" At this point I had an application that set thet database to online (see code snippet below): Server srv = new Server("localhost\SQLExpress"); Database Database = srv.Databases["MyDatabaseName"]; Database.SetOnline(); After running the above the database returned and was accessible. Is this still due to the AutoClose option or is there something else that is causing the to occur? Note that other databases were not in the state of "RecoveryPending". "Tom Moreau" wrote: > It could be that the autoclose option has been set for this Database. Try > turning > it off and see if the problem persists. > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS > SQL Server MVP > Toronto, ON Canada > https://mvp.support.microsoft.com/profile/Tom.Moreau > > |
![]() |
| Thread Tools | |
| Display Modes | |