Results 1 to 7 of 7

Thread: Stopping DB2

  1. #1
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150

    Unanswered: Stopping DB2

    We use db2 stop to try to stop the database but something is still running and connected to the database. We have been told to deactivate the database to bring it down completely. Can anyone suggest a way to bring db2 to a complete stop like pulling the rug from under it's feet?

    thank

  2. #2
    Join Date
    Feb 2002
    Posts
    11
    Hello Mark, to see what's connected to the db, run 'db2 list applications'
    If you need to disconnect a session, run 'db2 force application (<handle-number>) or 'db2 force application all'. If you don't care what's connected, you can run 'db2stop force' to close all connections and shutdown the instance.

    BTW, if you do not explicitly activate the db, it will automatically deactivate when the last user disconnects. To prevent this happening, just run 'db2 activate db <db-name>'.

    Hope this helps.

    Regards,
    Noel.


  3. #3
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    We do the db2 stop force and the application all commands. It is though that something is still hanging on. I am going to be putting in a call to IBM and see what they have to say but thank you for your reply, i appreciate it

  4. #4
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    We found out that the backend process was still hanging on, b2bp, don't know why, the force application all should have handled that. So now we do a force application all, terminate, and stop force all within a loop. Wait some time and then check for the backend process, if it is there, grab the PID and kill it and move on

  5. #5
    Join Date
    Feb 2002
    Posts
    11
    Mark, I think the command you're looking for is 'db2 terminate' is you're
    using the db2 command line processor (CLP) to connect to DB2.

    Regards,
    Noel.

  6. #6
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    That's the thing we don't use that at all. We don't even start the DAS on the server but for some reason this comes up. We think we have handled the problem and thanks for your assistance

  7. #7
    Join Date
    Feb 2002
    Posts
    33
    Mark,

    A script is included with DB2 to 'pull the rug'. On a UNIX environment:

    db2_kill

    This will bring down DB2 processes and clean up IPC resources. On the next connect to the database (assuming inflight transactions when the script was run), you should expect to see 'Crash Recovery' being initiated. This is just telling us that we are applying transactions that existed in the logs before the shutdown.

    I strongly recommend this only be used in extreme situations. If its just to bring down DB2 to perform system maintenance, this is not the way to go... db2stop is still preferred.
    Raj

Posting Permissions

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