Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2004
    Posts
    268

    Unanswered: Force application for one database

    How can I use "force applications all" for only 1 database and not the others?

    Using Appl.Handle doesn't work.

    Thanks.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You cannot force all applications from only one particular database if there are connections to multiple databases in the instance.

    What do you mean by "Using Appl.Handle doesn't work"?

    If you recieved an error, please post the exact command you ran and the error message.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Mar 2004
    Posts
    46
    There is no force for one database, but I use the "quiesce database immediate force connections" command.

    I can usually achieve the same thing with that - see if it helps you.

    -- Jayesh

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    I use batch file on Windows to to the job. First execute "list applications" and use "find" with database name to filter all db-connections. Then "use force". But on my system there are applications that are connected to only one database at the time, so there are no "double" connected applications, like Marcus_a has mentioned.

    mdx34, can you please provide what kind of operating system do you use and version and also db version and fixpack.

    Hope this helps,
    Grofaty

  5. #5
    Join Date
    Jul 2005
    Location
    Irvine, CA
    Posts
    23
    With respect, the answers the others gave are not completely true. You can force off individual users for one database in a single statement.

    Example: Let's say you have 2 databases on one instance - db2_1 and db2_2. You want to force off only those users on db2_2.

    db2 list application:


    DEVX java 336 xxxxxxxxxxxxxxxxxx DB2_2 5
    DEVX java 309 xxxxxxxxxxxxxxxxxx DB2_2 1
    DEVX java 291 xxxxxxxxxxxxxxxxxx DB2_2 5
    DEVX java 334 xxxxxxxxxxxxxxxxxx DB2_2 5
    DEVP cnr64 415 xxxxxxxxxxxxxxxxxx DB2_1 5
    PSADM ppagent 160 zzzzzzzzzzzzzzzzzz DB2_1 1
    PSADM ppagent 159 zzzzzzzzzzzzzzzzzz DB2_1 5

    OK, so users 336, 309, 291, and 334 need to be forced off. So:

    db2 "force application (336, 309, 291, 334)"

    You must use the quotes or the command will not work. Maybe this is why your previous attempt to do this failed? You can also set this up in a script that looks for the users for the database in question, then creates the statement for you and runs it.

    Hope this helps.

    -- Steve

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    sharrisdb2,
    this is true you can manualy force all applications, but there is no such a command like: "force application for database db1_2" to force all applications without manualy typing application IDs.
    Grofaty

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    While it is true that there is no simple command to force the application off of one DB, there is still an easy way to do it. Download the freeware DB2 monitor program at:

    http://chuzhoi_files.tripod.com/index.html

    Attach to the server and view the "applications" monitor. Sort the list by DB. Select all the connection to the DB you want to force. Right click and pick Disconnect (force).

    Andy

  8. #8
    Join Date
    Jan 2003
    Posts
    1,605
    ARWinner, this is also posible. BTW you can turn off "Show all app in instance" if you right click and disable above settings. So only applications attached db are displayed, so no sort is needed.

  9. #9
    Join Date
    Oct 2004
    Posts
    268
    Thanks for all the replies.............

Posting Permissions

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