Excellent comments. Thanks for looking into this... But I have
additional information that my help further refine our problem.
Buffer pool is supposed to be a memory backing for a page system. Its
purpose is to speed up retrieval of data. Thus how can you lock a
buffer pool. It should spill to disk. Yes, it will be very slow, but
it does make sense. Locking a page is interesting. Why would this be
required, especially, since buffer pools are defined per database, and
in our case I have 1 user in db-1 and 1 user in db-2.
(These are just discussion points.. I believe you are absolutley
correct about the reason, its just not clear as to why this would
happen.)
Your comment:
In any case, DB2 will mediate bp usage between applications, swapping
pages in and out of memory as required. The only time the query will
fail (modulo other resource issues) is, as I mentioned, if every single
page in the BP is being actively used by another query, and cannot be
evicted.
Interesting since there is only 1 active user in this db. Thus there
is no other query.
I started a command window and tried to manually connect to db-2 while
a user was successful into db-1. The error I get was:
SQL1478W The defined bufferpools could not be started.... Exactly
like you implied.
Now we to further diagnose why I could not get the space. Details
follow.
System memory: 3.25 gb
Instance memory: 6600 x 4k = 27,033,600 (round to 27 meg)
Db-2 memory (from configure parms) = 449,196 * 4k = 1,839,906,816 = 1.8
G (rounded)(AUTOMATIC allocation)
db-1 memory exactly like db-2 above 1.8 G (AUTOMATIC allocation)
We see that 1.8+1.8 = 3.6 Gig which is more than my physical memory,
but DB2 is setup for AUTOMATIC database_memory allocation, thus I would
assume it would reassing the value.
Ideally, this is what we would like. If there is 1 database, then
grab as much as possible for this 1 db, but, if we need to
start/activate another db, then I thought this automatic would
negotiate between the 2 for a middle of the road value between the 2.
Additionally, no where does it say, you need the physical memory to
back up this number. (like it explicitly states for bufferpool
allocations).
I check the bufferpools for both databases.
Db-1 wants: 270,295 * 4k = 1,107,128,320 (or 1.1 gig rounded)
db-2 exatcly the same.
thus 2 bufferpools of 1.1+1.1 = 2.2 gig required.
- now the docs says this memory must be available or it will default to
the smaller internal bufferpoosl.
I have 3.25Gig on this machine thus this should be potentially
available and is, when I checked task manager:
Task manager reports:
(with db-1 and db-2 both active, but db-2 cripled)
Total memory: 3.2
available : 1.9 (db-2 wanted 1.1 gig only... why could it not get
it... all system overhead is already built in to this, since db-2 is
started with the small buffer pool)
And the db2syscs.exe using: 1,192,502 K. (not the assumed 1.8 G
(rounded) values we would expect from the database_memory setting).
So with 1 full functional db-1 connection we only used 1.2 Gig and the
system still says there is 1.9Gig available.
Thus why did the second db connection fail to get the bufferpool for
the db.
I can fix the problem by forcing a smaller database_memory value (ie,
removing the automatic and specifying a smaller value), but this limits
the memory used when only 1 db is active.
Any suggestions. (it couild be the numbers are just too close to the
pysical limits of the machine, even though the math indicates I should
have room).
Thanks for all your comments.