Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: FORCE APPLICATION on one Database.

    Hi guys,

    Is there a way to force application off one database while allowing other to continue in same instance.

    My requirement is to restore one database POS only while GAMING will be still running.

    So I think that I have to force the application on POS and when they are off, I will deactivate DB and DROP DB.

    So.

    Code:
    LIST APPLICATIONS FOR DATABASE POS
    
    FORCE APPLICATIONS (?,?,?,?,?. . . . .)
    
    deactivate db POS
    
    DROP DB POS
    
    RESTORE DB POS FROM . . . . .
    So I need a function or select query that can be passed to FORCE APPLICATIONS.

    I tried following query

    Code:
    SELECT AGENT_ID FROM  
    TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENTSERVER, -1)) AS SNP_TBL 
     WHERE INPUT_DB_ALIAS='POS'
    But Force Applications does not accept the output of this query.


    Is there any other function or statement.

    DB2 V8.2 and V9.5 on Win 2K3 servers

    Thanks in adv,
    DBFinder
    Last edited by DBFinder; 05-14-09 at 13:37.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Use the QUIESCE command.

    Code:
    QUIESCE DB IMMEDIATE FORCE CONNECTIONS
    Andy

  3. #3
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Thanks

    Great, I will use it tonight.

    Thanks again.

  4. #4
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Hi Andy,

    Following is the code I came up with,for dropping one DB while other DB is running.
    I am listing it for any correction if needed.

    Code:
    DB2 CONNECT TO POS
    if [%ERRORLEVEL%]==[4] goto :DBdoesNotExist
    
    DB2 QUIESCE DB IMMEDIATE FORCE CONNECTIONS 
    
    DB2 UNQUIESCE DB
    
    DB2 CONNECT RESET
    
    DB2 DEACTIVATE DB POS
    
    DB2 DROP DB POS
    
    :DBdoesNotExist
    Please advise if anything is not appropriate.

    This works well except it takes little longer to drop the databse.

    Is there any other way to force applications filtring by database, to drop db in similar situation.

    Thanks Andy , your suggestion worked well.
    DBFinder
    Last edited by DBFinder; 05-19-09 at 10:34.

Posting Permissions

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