On 30 Mar, 12:53, "Woody Ling" <woodyl...@gmail.comwrote:
Thanks James,
Seems that there is no way to use more that 256MB private sort heap in
32bits DB2 and I am now focusing on intra-parallel=YES options and
want to use database shared memory area for shared sort heap.
As I know that total shared sort heap is equal to "total number of
concurrent sort * sortheap size". I set the sheapthres to 102400 * 4K
= 400MB and sortheap to 10240 * 4K = 40MB so that suppose 10
concurrent applications can have its own sorting area.
Am I right? Or only 10 concurrent sorting agents/subagents are allowed
with this configuration?
Besides, I would like to know if there is any method to monitor the
shared sort heap memory utilization?
Thanks.
Hi Woody,
One thing to bear in mind is setting INTRAPARALLEL to yes doesn't
automatically force DB2 to use the shared sort heap. For example, our
database is a mixed environment. The reason why our SHEAPTHRES is set
so high is because of our concurrent private sort heaps during certain
points of our end of day. (During the day, the concurrent private sort
heaps don't reach anywhere near SHEAPTHRES). We have INTRAPARALLEL set
to yes at all times here, but during the day, we exclusively use
private sorting. During the end of day, some reports use the shared
sort heap and others use private sort heap. Those reports which use
the shared sort heap do so by setting current degree = <degree of
parallelismbefore executing the query. You can see if your shared
sort heap has neared your SHEAPTHRES at any times since you restarted
your database by looking at the "Shared Sort heap high water mark"
which you'll find from your "get snapshot for db on <database>"
snapshot monitor.
2 other alternatives are to do:-
1. "db2mtrk -i -w" and look for the shsorth value (this gives you the
figure in real memory rather than pages).
2. "db2pd -db <database-mempools" and look under the LogHWM or
PhyHWM columns where the Poolname = 'shsorth'
If you're wondering if you can find total private sort heap using
db2mtrk and db2pd, as far as I'm aware you can't.
You can see if anything's using the shared sort heap currently by
looking at "Total Shared Sort heap allocated" in the snapshot monitor
mentioned above.
You can see what applications are likely to be using shared sort heap
by typing "db2 list applications show detail" and looking for those
which are executing and were "No. of agents" are greater than 0.
Remember that for shared sort heaps, SHEAPTHRES is a hard limit. If
your shared sorts exceed this parameter, they'll fail. I'm guessing
that you will then see something in the db2diag.log if this happens,
but we've not been in that situation. As mentioned previously, you'll
get errors in your db2diag.log if your total private sort heap
allocation exceeds SHEAPTHRES but this is a soft limit, your next
agent requiring a sort won't fail, it will be just allocated less and
less SORTHEAP memory so it's performance will be impacted.
Hopefully, that's answered all your questions.