| |
|
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.
|
 |

08-09-07, 08:08
|
|
Registered User
|
|
Join Date: Jul 2006
Location: Pune , India
Posts: 433
|
|
Force application for a DB
|
|
i was just wondering how to force applications for only a specified DB.
i need DB scripts for BKP to run at night(task centre) ,
but the problem is
db2 force application all
will force connections for other DB's also (which i dont want)
any hints ?
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
|
|

08-09-07, 08:23
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
You could use the following query to generate the script you need:
select 'force application ('||rtrim(char(agent_id))||')' from table(snapshot_appl_info('MyDB',-1)) as x
Andy
|
|

08-09-07, 08:50
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 1,570
|
|
|
|
ARWinner, this is new in v8.2 if I am not mistaken. I use Windows batch script to do the same task for any kind of database new and old versions - this is one command in one line:
Code:
FOR /F "tokens=3 delims= " %%i IN ('db2 list application for database MyDB ^| find /v "Auth" ^| find /v "--" ^| find /v "Name"') DO db2 force application (%%i)
Note: use your database name instead of MyDB.
rahul_s80, can you write your db2 version and operating system type and version.
Hope this helps,
Grofaty
|
Last edited by grofaty; 08-09-07 at 08:54.
|

08-09-07, 09:14
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 23
|
|
i think , when you execute "force application xxx" ,you must connect to the very db ,which db you have connected ,then witch db you would force app disconnected.
|
|

08-09-07, 09:19
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Quote:
|
Originally Posted by myprotein
i think , when you execute "force application xxx" ,you must connect to the very db ,which db you have connected ,then witch db you would force app disconnected.
|
You do not have to be connected to the database, but you do need an instance attachment which you would normally get if you logged on as instance owner.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

08-09-07, 09:30
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 23
|
|
|
|

08-09-07, 13:51
|
|
Registered User
|
|
Join Date: Aug 2007
Location: TX, USA
Posts: 5
|
|
Have you tried DEACTIVATE DATABASE, followed by an ACTIVATE DATABASE?
|
|

08-10-07, 06:18
|
|
Registered User
|
|
Join Date: Jul 2006
Location: Pune , India
Posts: 433
|
|
thanks,
db2 quiesce db immediate force connections
will suit me better
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
|
|

08-10-07, 23:13
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Quote:
|
Originally Posted by rahul_s80
thanks,
db2 quiesce db immediate force connections
will suit me better
|
That should work for most shops, except those where the applications are using the instance owner id (which is not affected by quiesce).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|