I have a DB2 9.7 LUW instance with several databases. I am trying to take backup of a specific database, but Data Studio client reports that there is still an active connection so it fails.
How can I force the database to remove all active connections to that specific database? Thanks!
You can't do it in a single command; you have to list the connections first:
Then, use all of the numeric application handles returned by the list above to issue the
FORCE APPLICATION
statement:I assume you are trying to take an OFFLINE backup. You can use
db2 FORCE APPLICATION ALL
. As listed in the manual:Though before you take the force route - I suggest taking a look at
QUIESCE
instead or properly stopping the application. Your backup process would look something like this:You can also use
db2top
to monitor database connections and identify what applications you need to stop.I use the following steps, and it works.
Assuming it to be an OFFLINE backup, this can be done by either DEACTIVATE'ing the database or by QUISCE'ing the database.
For DEACTIVATE'ing the database, follow the below steps:-
DB_NAME
, and if found force them off using FORCE APPLICATIONS ALLDB_NAME
For QUISCE'ing the database, follow the below steps:-
CONNECT TO
DBNAME
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS
CONNECT RESET