Thread: deactive /reactive database??
07-27-04, 11:44 #1Registered User
- Join Date
- Jul 2004
Unanswered: deactive /reactive database??
I am a beginner in DB2 though I had a few years experience in other RDMS. Some senario in DB2 is really confusing me here.
when I was asked to do a offline backup of DB2 database, I forced all applications off, then I issued 'deactive database db1' command. it gives me some messages like 'the command is successful, but the database is not active'. then I list application again, I found some connections again!
so my first question is Why after the deactive database, users can still connect to the database?
Then I forced applications off again. and deactive database again. then I iissued the command backup database .... it looks okay.
so I terminated my connection.
then I run db2, then I typed connect db1, then it looks like I got connected??
if that is case, that's the command of activate database doing?
Anyone can give me some explanation? Thank you!
07-27-04, 12:25 #2Registered User
- Join Date
- May 2003
When the activate database command is issued, most database resources (especially buffer pools) are allocated regardless of whether there are any connections, and they stay allocated until a deactivate command is issued (or a db2stop is issued).
If no activate is issued, then the first connection causes DB2 resources to be allocated, and they are de-allocated when the last connection is disconnected. In some situation this could cause a lot of allocation and de-allocation of resources causing delays in connecting.
Using the deactivate command does not disconnect users, it just reverts back to the way DB2 allocates resources as if no activate database had ever been issued (relying on the first connection to do the allocation).
If you have DB2 version 8, you should look at the QUIESCE command, otherwise the system command DB2STOP FORCE (or CLI command STOP DBM FORCE) is normally used in front of backups.M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390