Topic
  • 5 replies
  • Latest Post - ‏2014-02-19T16:57:59Z by PeterDimitrios
amccarl
amccarl
73 Posts

Pinned topic Can I automatically restart DB2 UDB after an unexpected stop?

‏2013-06-12T19:16:59Z |

The db2iauto command enables and disables the auto-start of an instance after each system restart. With Fault Monitor facility, if the DB2 Universal Database (DB2 UDB) instance exits prematurely, the fault monitor will restart it.  Technical article 1209001 lists step by step instructions for setting up the Fault Monitor Facility to automatically restart DB2 UDB instances: http://www.ibm.com/support/docview.wss?uid=swg21209001

Updated on 2013-06-14T14:35:52Z at 2013-06-14T14:35:52Z by amccarl
  • amccarl
    amccarl
    73 Posts

    Re: Can I automatically restart DB2 UDB after an unexpected stop?

    ‏2013-06-14T14:31:13Z  
    Hello!  We've had a number of clients respond through feedback to our technical documents indicating that they have further questions or comments that require additional dialogue.  Unfortunately, our feedback is anonymous, so unless an email address or other contact information is included, we have no way to get back in touch with you.
     
    Within DB2 support, the management team asked if we could somehow link our documents to the forums so that we could invite more discussion - like this!   As a start, we chose a small set of  technical articles and "seeded" the forum with initial entries so that we could have a starting place for conversation.  The documents have now been updated with links to the forums as well.  
     
    Hopefully, we will make DB2 support better by providing more interaction around our technical information!
  • PeterDimitrios
    PeterDimitrios
    3 Posts

    Re: Can I automatically restart DB2 UDB after an unexpected stop?

    ‏2014-02-16T19:14:10Z  
    • amccarl
    • ‏2013-06-14T14:31:13Z
    Hello!  We've had a number of clients respond through feedback to our technical documents indicating that they have further questions or comments that require additional dialogue.  Unfortunately, our feedback is anonymous, so unless an email address or other contact information is included, we have no way to get back in touch with you.
     
    Within DB2 support, the management team asked if we could somehow link our documents to the forums so that we could invite more discussion - like this!   As a start, we chose a small set of  technical articles and "seeded" the forum with initial entries so that we could have a starting place for conversation.  The documents have now been updated with links to the forums as well.  
     
    Hopefully, we will make DB2 support better by providing more interaction around our technical information!

    I stumbled across this entry while having troubles with DB2 databases not activating upon reboot in Windows.    Windows doesn't have the db2iauto command, but instead seems to rely on the autostart setting of the windows DB2  instance service (e.g. "DB2 - D2COPY1 - DB2-0").    However, even with the individual databases auto-restart settings turned on (  db2 update db cfg for XXX using autorestart yes ), they still aren't activated when Windows comes up.

      So, my question is, is there anything else I can do to ensure they are activated on bootup?  It appears that the normal DB2 "start on connect" isn't working in our environment, and besides we want the databases "hot" and ready to run instead of waiting for the first application to connect.

     

     

  • LukeNumrych
    LukeNumrych
    90 Posts

    Re: Can I automatically restart DB2 UDB after an unexpected stop?

    ‏2014-02-17T13:25:56Z  

    I stumbled across this entry while having troubles with DB2 databases not activating upon reboot in Windows.    Windows doesn't have the db2iauto command, but instead seems to rely on the autostart setting of the windows DB2  instance service (e.g. "DB2 - D2COPY1 - DB2-0").    However, even with the individual databases auto-restart settings turned on (  db2 update db cfg for XXX using autorestart yes ), they still aren't activated when Windows comes up.

      So, my question is, is there anything else I can do to ensure they are activated on bootup?  It appears that the normal DB2 "start on connect" isn't working in our environment, and besides we want the databases "hot" and ready to run instead of waiting for the first application to connect.

     

     

    I had a need to do something similar.  To accomplish this, I created a script that is executed once after each time the system restarts.  The script logs in to each of the databases and executes "activate db".  This way all of the databases are explicitly activated - "hot and ready".

  • PeterDimitrios
    PeterDimitrios
    3 Posts

    Re: Can I automatically restart DB2 UDB after an unexpected stop?

    ‏2014-02-18T22:15:38Z  

    I had a need to do something similar.  To accomplish this, I created a script that is executed once after each time the system restarts.  The script logs in to each of the databases and executes "activate db".  This way all of the databases are explicitly activated - "hot and ready".

    To close the loop on this, here is what I've done on Windows 2008 Server:

      The main script activate_databases.cmd:

    choice /M "Wait for DB2 to autostart before activating databases " /C Y /D Y /T 30
    db2start
    db2 list database directory
    db2 list database directory | for /f "usebackq tokens=2 delims==" %%f in (`findstr /I /C:"Database alias"`) do (
      @echo  Activating %%f
      db2 activate db %%f
    )
    choice /M "Done with %0" /C Y /D Y /T 30

    And then used gpedit.msc to add the script to the Windows->Startup scripts.

     

     

  • PeterDimitrios
    PeterDimitrios
    3 Posts

    Re: Can I automatically restart DB2 UDB after an unexpected stop?

    ‏2014-02-19T16:57:59Z  

    To close the loop on this, here is what I've done on Windows 2008 Server:

      The main script activate_databases.cmd:

    choice /M "Wait for DB2 to autostart before activating databases " /C Y /D Y /T 30
    db2start
    db2 list database directory
    db2 list database directory | for /f "usebackq tokens=2 delims==" %%f in (`findstr /I /C:"Database alias"`) do (
      @echo  Activating %%f
      db2 activate db %%f
    )
    choice /M "Done with %0" /C Y /D Y /T 30

    And then used gpedit.msc to add the script to the Windows->Startup scripts.

     

     

    One more tidbit:   Depending on how you setup your environment, you may need to run the activatate_databases.cmd via db2cmd to get the command-line environment setup right.   Something like

     rundb2cmd.cmd :  db2cmd -c "%*"

    so the true startup command would be:   rundb2cmd activate_databases.cmd

    Also, you can set windows credentials / ACLs so that you can run a command with elevated privileges:  runas /user:administrator /savecred rundb2cmd activate_databases.cmd