Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433

    Exclamation Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605
    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 09:54.

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

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  6. #6
    Join Date
    Aug 2007
    Posts
    23
    oh,sorry,ic

  7. #7
    Join Date
    Aug 2007
    Location
    TX, USA
    Posts
    5
    Have you tried DEACTIVATE DATABASE, followed by an ACTIVATE DATABASE?

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

  9. #9
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

Posting Permissions

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