On Nov 30, 5:51 am, Rahul Babbar <rahul.babb...@gmail.comwrote:
Hi All,
When could be the possible reasons that could make a database
inconsistent?
I was told by somebody that it could become inconsistent if you "
force all the applications to a close on that database and
transactions are not committed or rollbacked"
I infact, don't believe it, because i suppose when we do a "force
applications all", then the applications should be automatically
rollbacked. I mean this should be the case.
Can anybody explain it with the others reasons leading to a database
being inconsistent?
Thanks a lot
Rahul
Hi Rahul,
Can you explain what exactly you mean by inconsistent as I'm not sure
if my response here is what you are looking for.
When a database is started, it is considered "consistent" (and you'll
see this in the database configuration output). What this really
means is that what is on disk for the database is consistent. Now,
the first piece of write/update type of work that happens flips the
database to inconsistent. The reason being that changes are usually
buffered in the bufferpool and what is on disk is not guaranteed to be
consistent. If an inconsistent database comes down abnormally (DB2
crashes, is killed, machine is shut down, etc) then it needs to go
through crash recovery (usually happens automatically as the part of
the first connect/activate that occurs afterwards). When a database
is shutdown normally (deactivated, last connection goes away, etc) all
of the in-memory changes are flushed to disk and the database is now
considered consistent again (and won't require any kind of crash
recovery the next time it's started).
In the case of "force applications all", it is my understanding that
the agents are being forced, but cleanup and the flushing of changes
should still occur when the last one is forced off, leaving the
database consistent afterwards.
Regards,
Kelly Schlamb