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 on one Database.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-09, 12:31
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
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 12:37.
Reply With Quote
  #2 (permalink)  
Old 05-14-09, 12:50
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Use the QUIESCE command.

Code:
QUIESCE DB IMMEDIATE FORCE CONNECTIONS
Andy
Reply With Quote
  #3 (permalink)  
Old 05-14-09, 12:56
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Thanks

Great, I will use it tonight.

Thanks again.
Reply With Quote
  #4 (permalink)  
Old 05-19-09, 09:30
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
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 09:34.
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