Re: Is there a reliable way to do this?
- From: "Elizabeth Connolly" <econnolly@xxxxxxxxxxxxxx>
- Date: Tue, 9 Oct 2007 20:17:02 -0500
That's a good idea! The service is autostarting - or at least, starting
automatically - and I am not proceeding unless its status is running - but I
never thought of the error log for the recovery complete message. And yes, I
can see from the log that the timing problem is in milliseconds - it took
about 30 milliseconds to finish starting the tempdb, but my database was
trying to connect before those 30 milliseconds are up.
I'll try this and see what happens. Thanks a bunch!
"Allen Kinsel" <allen.kinsel@xxxxxxxxxxxxxxxx> wrote in message
news:9553483cc26c436d9cbf6e5af89a4a70@xxxxxxxxxxxxxx
What is a reliable way to check to ensure that all system DBs are
started when SQL Server (SQL Express) starts up?
I am using SQL Express 2005 for a desktop application in which the user
requires the application be started at windows log-in time (so that
nothing is ever visible on the desktop except the application.)
Starting the application involves opening connections to two application
databases.
When the application is started from the user's startup folder - that
is, right after log-in - there are often login failures reported by
..NetSQLClientData Provider - "Cannot open database [dbname] requested
by the login. The login failed. Login failed for user ...."
There are never any failures when started manually after login.
To deal with the things I THOUGHT might be causing this I made the
application check that the SQL Express service was running, and
increased the length of the connection time-out in the connection
string. Appears that these were not the cause of the problem. Examining
the SQL log shows that on startup, SQL Server has to start all its
internal databases. It looks like if this process is not complete
(usually it is the last db, tempdb, that isn't done with its startup)
my first connection fails. I suppose I could hardcode or put in the
configuration settings some sort of wait, or repeatedly try to open the
connection if the first time fails. But it seems like it would be safer to
just know the status of the system dbs.
So, is there a way to do this?
Thanks!
Elizabeth
I think that there is really 2 approaches to this, one is to start sql
express prior to the application. That is to say, have the sqlexpress
service set to autostart (if this is feasible) If you do it this way the
service will be started and available by the time the logon screen comes
up otherwise if your already polling the service state and that's not
working
im thinking that the only other real alternative would be to parse the
sql error log for the final "recovery complete" message. I would think
unless the user db's and/or tempdb database is rather large your probably
talking about milliseconds of timing on this issue.
-Allen
Posted by NewsLook (Trial Licence) from
http://www.ghytred.com/NewsLook/about.aspx
.
- References:
- Is there a reliable way to do this?
- From: Elizabeth Connolly
- Re: Is there a reliable way to do this?
- From: Allen Kinsel
- Is there a reliable way to do this?
- Prev by Date: Re: Is there a reliable way to do this?
- Next by Date: Re: Cannot bind to port 1433
- Previous by thread: Re: Is there a reliable way to do this?
- Next by thread: RE: Is there a reliable way to do this?
- Index(es):
Relevant Pages
|