Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    197

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

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,369
    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.

  3. #3
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    197
    [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

  4. #4
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    197
    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

  5. #5
    Join Date
    Oct 2007
    Posts
    246
    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

  6. #6
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    197
    thanks for your reply.

    but then how i was able to take using the GUI(control center)

  7. #7
    Join Date
    May 2010
    Location
    India
    Posts
    84
    Provided Answers: 2
    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.

  8. #8
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    197
    thanks all to their replies,

    i just removed it from admin group and now it is working

  9. #9
    Join Date
    Jul 2013
    Posts
    4

    Same problem - invalid login

    I had the same issue on a Windows Server running db2 LUW 9.5.
    In desperation, I decided to just restart the instance.
    When I did, I got an error indicating invalid credentials.

    I had to go into the Windows Service and change the password for the user.
    That cleared up the issue.

Posting Permissions

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