Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Testing for running service

    We have an installation of a BI application which requires a database to be up an running.
    The critical BI service requires the database to be up and running to validate logins.
    The database is 'taken down' every night for a 'cold' backup and is then made available the next morning.
    The critical service will fail to start if the database is not available, which then requires a manual restart of the service.
    Even if the service is setup to restart automatically after a number of failures, it needs to be started manually if the database isn't available after the first restart.
    Is there any way that we can keep the service try to startup until it does connect to the database?
    Our current solution is to have a NT schedule restart the service one hour after the agreed time of the database being up and running again.
    Any other suggestions gratefully accepted.
    Regards
    Zinger

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,896
    Thanks
    0
    Thanked 86 Times in 82 Posts

    Re: Testing for running service

    Hi,
    What kind of database is it? SQL Server, Oracle or something else?
    Regards,
    Rory
    Microsoft MVP - Excel.

  4. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Testing for running service

    There are a couple of tools I would look at to start the service, SC and PsService. Each can check whether the service is running.

    I would schedule a BATch file to start at the required time, with pseudo code like:

    :loop
    obtain the current time
    is it after the latest time when the database should be up?
    if yes, exit the BATch file

    :queryservice
    query the database service
    is it started?
    if yes, go to waitsometime
    if not, try to start it
    wait at least 30 seconds, perhaps a minute
    goto queryservice

    :waitsometime
    wait a sensible length of time (1 minute? 5 minutes? 10 minutes?)
    goto loop

    You can obviously build in lots more tests, like only trying to start the service a certain number of times, sending a message to a systems admin if it doesn't start, and so on...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  5. #4
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing for running service

    It's Oracle sitting on a Sun.
    The BI tool is Business Objects XI R2, which uses the Oracle schema to store some metadata, and if this is not available then the critical service won't start and no other Business Objects services can run either.
    In effect the whole thing is 'dead'.
    Regards

  6. #5
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing for running service

    Thanks for the suggestion and outline of a batch file.
    I found the PSservice on Microsoft, but what is and where can I find the SC you referred to?
    Regards

  7. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Testing for running service

    That's an easy one - WindowsSystem32!

    Just type SC in a Command Prompt window...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  8. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,896
    Thanks
    0
    Thanked 86 Times in 82 Posts

    Re: Testing for running service

    There is a sample batch file to test if an Oracle db is up here.
    HTH
    Regards,
    Rory
    Microsoft MVP - Excel.

  9. #8
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing for running service

    Thanks.
    Will modify and test this first thing tomorrow morning (it's now 11pm) and incorporate the SC or PSService suggestion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •