October 18, 2005 at 9:20 am
(Visual 6.0 C/C++)Lets say you have a piece of code that does database updates to a primary server at a remote site and these updates take about 2 to 3 seconds to complete. This application is designed to collect, parse, and save data in a do while true loop that runs forever. Now, lets say that all works great until...
at a specified time during the week, the remote server enters maintenance mode where the tables are backed upa nd all the tables are optimized and shrunk (standard maintenance).
During this time, the application crashes with run time error. If I turn off the server optimization (database tuning), then all is well and the app runs fluidly.
Is there a way to detect and avoid this condition, i.e. detecting if the database is in or enterring into maintenance mode? I am stuck on the proper method of dealing with this one.
October 18, 2005 at 12:49 pm
Usually this kind of maintenece is performed with Jobs. If you can query job status and next run date/time you should be able to aviod the contention
* Noel
October 18, 2005 at 12:54 pm
Usually this kind of maintenece is performed with Jobs. If you can query job status and next run date/time you should be able to aviod the contention
I guess what I am asking for is: how?
FYI: app is written in VC/C++ MSVS6.0, using ADO and MSSQL2K.
October 18, 2005 at 1:02 pm
Select * from msdb.dbo.SysJobHistory where Run_Status = 4 AND job_id = '3017EDE7-E5AC-4ECA-A376-FCEA13AD57DC'
Run_Status = 4 means that the step is running, look at the same table to find the correct job_id.
October 18, 2005 at 2:03 pm
YES!!! YOU ROCK!! This is exactly what i was looking for!!
Thank you so very much!
October 18, 2005 at 2:14 pm
HTH.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply