• Testing for running service

    Home » Forums » Admin IT Lounge » Admin IT Lounge – Miscellaneous » Testing for running service

    Author
    Topic
    #439882

    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

    Viewing 1 reply thread
    Author
    Replies
    • #1052224

      Hi,
      What kind of database is it? SQL Server, Oracle or something else?

      • #1052420

        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

        • #1052428

          There is a sample batch file to test if an Oracle db is up here.
          HTH

          • #1052432

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

    • #1052228

      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

      • #1052423

        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

        • #1052426

          That’s an easy one – WindowsSystem32!

          Just type SC in a Command Prompt window…

          John

    Viewing 1 reply thread
    Reply To: Testing for running service

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: