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 > backup Db2- unable to force applications

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-10-11, 23:29
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
Question backup Db2- unable to force applications

when i am taking backup of a particular DB ,

i am unable to force the applications ,

i use a simple script.

"
CONNECT TO MAXDB71;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
CONNECT RESET;
BACKUP DATABASE MAXDB71 TO "/opt/DBBAckup/" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 COMPRESS WITHOUT PROMPTING;
CONNECT TO MAXDB71;
UNQUIESCE DATABASE;
CONNECT RESET;
"

But this gives the output as
"[ctginst1@WESSPMDB01 ~]$ ./maxback

Database Connection Information

Database server = DB2/LINUX 9.1.6
SQL authorization ID = CTGINST1
Local database alias = MAXDB71

DB20000I The QUIESCE DATABASE command completed successfully.
DB20000I The SQL command completed successfully.
SQL1035N The database is currently in use. SQLSTATE=57019

Database Connection Information

Database server = DB2/LINUX 9.1.6
SQL authorization ID = CTGINST1
Local database alias = MAXDB71

DB20000I The UNQUIESCE DATABASE command completed successfully.
DB20000I The SQL command completed successfully.
[ctginst1@WESSPMDB01 ~]$
"

Can you help me on this as the moment i quiesce or force the application/ DB , they get connected immediately. how do i over come
Reply With Quote
  #2 (permalink)  
Old 01-11-11, 01:04
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Add "sleep <seconds>" to give db2 enough time to force existing applications. You can also add "list applications show detail" before and after quiesce to see which applications are still connected or got connected after the quiesce. If the db had been activated, you need to deactivate it using "deactivate db". Unsetting svcename will prevent remote appls from connecting but quiesce should take care of it.
Reply With Quote
  #3 (permalink)  
Old 01-11-11, 02:30
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
[ctginst1@WESSPMDB01 ~]$ cat maxback
db2 CONNECT TO MAXDB71;
db2 QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
db2 CONNECT RESET;
sleep 20
db2 BACKUP DATABASE MAXDB71 TO "/opt/DBBAckup/" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 COMPRESS WITHOUT PROMPTING;
db2 CONNECT TO MAXDB71;
db2 UNQUIESCE DATABASE;
db2 CONNECT RESET;
[ctginst1@WESSPMDB01 ~]$

still getting the same error ,

"01/11/2011 09:41:51 Backing up database....This will take time
SQL1035N The database is currently in use. SQLSTATE=57019"


any other suggestion as applications are not disconnecting
Reply With Quote
  #4 (permalink)  
Old 01-11-11, 02:35
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
have look as i see applications after quiesce command is executed.

[ctginst1@WESSPMDB01 ~]$ db2 connect to maxdb71

Database Connection Information

Database server = DB2/LINUX 9.1.6
SQL authorization ID = CTGINST1
Local database alias = MAXDB71

[ctginst1@WESSPMDB01 ~]$ db2 list applications

Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
CTGINST1 db2bp 641 *LOCAL.ctginst1.110111073335 MAXDB71 1
MAXIMO db2jcc_applica 638 10.101.226.43.40321.11011107331 MAXDB71 1
MAXIMO db2jcc_applica 637 10.101.226.43.40065.11011107330 MAXDB71 1
MAXIMO db2jcc_applica 636 10.101.226.43.39809.11011107330 MAXDB71 1
MAXIMO db2jcc_applica 635 10.101.226.39.13265.11011107330 MAXDB71 1
MAXIMO db2jcc_applica 634 10.101.226.39.13009.11011107330 MAXDB71 1
MAXIMO db2jcc_applica 633 10.101.226.39.12753.11011107330 MAXDB71 1
MAXIMO db2jcc_applica 631 10.101.226.43.37761.11011107321 MAXDB71 1
MAXIMO db2jcc_applica 630 10.101.226.43.37505.11011107320 MAXDB71 1
MAXIMO db2jcc_applica 629 10.101.226.43.37249.11011107320 MAXDB71 1
MAXIMO db2jcc_applica 628 10.101.226.39.11217.11011107320 MAXDB71 1
MAXIMO db2jcc_applica 627 10.101.226.39.10961.11011107320 MAXDB71 1
MAXIMO db2jcc_applica 626 10.101.226.39.10705.11011107320 MAXDB71 1
MAXIMO db2jcc_applica 625 10.101.226.43.36737.11011107314 MAXDB71 1
MAXIMO db2jcc_applica 624 10.101.226.43.36481.11011107314 MAXDB71 1
MAXIMO db2jcc_applica 623 10.101.226.39.10449.11011107313 MAXDB71 1
ROOT db2evmg_DB2DET 594 *LOCAL.DB2.110111072753 MAXDB71 1
MAXIMO db2taskd 593 *LOCAL.DB2.110111072752 MAXDB71 1
MAXIMO db2stmm 592 *LOCAL.DB2.110111072751 MAXDB71 1

[ctginst1@WESSPMDB01 ~]$ db2 quiesce database immediate force connections
DB20000I The QUIESCE DATABASE command completed successfully.
[ctginst1@WESSPMDB01 ~]$ db2 list applications

Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
MAXIMO db2jcc_applica 643 10.101.226.43.42113.11011107335 MAXDB71 1
CTGINST1 db2bp 641 *LOCAL.ctginst1.110111073335 MAXDB71 1
ROOT db2evmg_DB2DET 594 *LOCAL.DB2.110111072753 MAXDB71 1
MAXIMO db2taskd 593 *LOCAL.DB2.110111072752 MAXDB71 1
MAXIMO db2stmm 592 *LOCAL.DB2.110111072751 MAXDB71 1

[ctginst1@WESSPMDB01 ~]$


Any suggestions
Reply With Quote
  #5 (permalink)  
Old 01-11-11, 03:14
Mathew_paul Mathew_paul is offline
Registered User
 
Join Date: Oct 2007
Posts: 200
i believe all connection which ur seeing is having the instance owner group hence its allowing connection even after the db is quiesce.

regs
Paul
Reply With Quote
  #6 (permalink)  
Old 01-11-11, 03:46
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
thanks for your reply.

but then how i was able to take using the GUI(control center)
Reply With Quote
  #7 (permalink)  
Old 01-11-11, 07:21
stiruvee stiruvee is offline
Registered User
 
Join Date: May 2010
Location: India
Posts: 34
We had similar situation when web application was using instance owner id to connect and continuously trying to reconnect. As Paul mentioned above, if your application is using userid which is part of instance owner group , it will manage to re-connect even after QUIESCE was issued. Removing web application user id from instance owner group will fix the problem.


As a temporary fix, we kept all the db2 commands in a file (backup.sql), and invoked db2 command with file as input ( db2 -tvf backup.sql ). There is a possibility that web application might still manage to connect, but using file the chances are low compared to issuing separate commands . Sleep command will not help, if your application is continuously trying to reconnect. I think same thing is happening when backup was taken thru control center (no sleep command) and you are able to take backup thru control center. Permanent fix is to use user id that was not part of instance owner group for web application to connect to database. Another alternative is to take online backups.
Reply With Quote
  #8 (permalink)  
Old 01-12-11, 02:13
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
thanks all to their replies,

i just removed it from admin group and now it is working
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