If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Force application for one database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-18-06, 15:27
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
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.
Reply With Quote
  #2 (permalink)  
Old 08-18-06, 20:29
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 08-19-06, 08:53
jthakrar jthakrar is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 08-21-06, 01:51
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #5 (permalink)  
Old 08-21-06, 14:02
sharrisdb2 sharrisdb2 is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 08-23-06, 06:37
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #7 (permalink)  
Old 08-23-06, 08:04
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #8 (permalink)  
Old 08-23-06, 08:11
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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.
Reply With Quote
  #9 (permalink)  
Old 08-23-06, 15:30
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
Thanks for all the replies.............
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On