System Administration
Showing results for 
Search instead for 
Did you mean: 

SHMMAX on HPUX 11iv2 memory upgrade

Go to solution

SHMMAX on HPUX 11iv2 memory upgrade

Hey, guys. I have an rx8620 with 32gb RAM that is running two Oracle databases. We plan on adding memory to this server to get it to 48gb.

The two Oracle databases have SGAs of 11.2gb and 1.6gb. The SHMMAX parameter is set to 16gb. The larger of the two SGAs will likely increase by 10gb to a total of 20.2gb.

I have two questions. The first is whether or not I will need to increase the SHMMAX tunable. In my mind, it wouldn't be necessary as the o/s should only need to create one additional shared memory segment for the larger Oracle instance and the other one won't need an additional one.

My second question is why ipcs -m shows 4 shared memory segments created for both of the databases:

root@rachp11:/root# ipcs -m
IPC status from /dev/kmem as of Thu Apr 9 08:56:02 2009
Shared Memory:
m 0 0x411c0189 --rw-rw-rw- root root
m 1 0x4e0c0002 --rw-rw-rw- root root
m 2 0x41200a8a --rw-rw-rw- root root
m 393219 0x0c6629c9 --rw-r----- root root
m 4 0x06347849 --rw-rw-rw- root root
m 32773 0x4918116f --rw-r--r-- root root
m 2818054 0x00000000 --rw-rw---- orabo dba
m 753671 0x00000000 --rw-r----- oradw dba
m 120913928 0x00000000 --rw-r----- oradw dba
m 2424841 0x00000000 --rw-r----- oradw dba
m 1703946 0x25a6138c --rw-r----- oradw dba
m 425995 0x00000000 --rw-rw---- orabo dba
m 262156 0x00000000 --rw-rw---- orabo dba
m 262157 0xf031a404 --rw-rw---- orabo dba

root@rachp11:/root# kctune | grep shmmax
shmmax 16000000000 16000000000 Immed

With a SHMMAX of 16gb, shouldn't it only be creating one shared memory segment for both databases? oradw is the 11.2gb SGA and orabo is the 1.6gb SGA. I see 4 for each and it doesn't make sense to me.

I am concerned about protection key faults as I see I have a total of 14 shared memory segments and this Itanium server has a maximum of 14 protection keys.

Thank you!
Don Morris_1
Honored Contributor

Re: SHMMAX on HPUX 11iv2 memory upgrade

Question One depends on how Oracle chooses to handle things. If it tries a shmget() of 20Gb with shmmax 16Gb, it will fail. If it makes two 10Gb segments, it will succeed. The OS doesn't control what it does (SysV shm* APIs kind of mandate that the OS creates what the application requests -- it can't "unify" segments at its whim).

This also deals with the second question. It did because the application asked it to do so. Why Oracle did that is up to Oracle. (Is this a Cell based server? Is this ccNUMA aware oracle running on 4 cells? That would easily explain things as Oracle could be using 4 segments each directed at a particular Cell and directing the queries to the lowest latency part of the SGA.)

Itanium has many more than 14 protection keys, by the way. The maximum is around 2^24 but depends on the chip implementation. I think you mean protection key registers (I don't remember it being only 14 [I thought it was around 16 -- maybe you're assuming 2 are always taken, which is likely true], but I don't go look this up all that often) [which are changed on context switch and hence your two Oracle applications should not be consuming protection key registers for keys which correspond to Shared objects they aren't attached to -- orabo should only be using 4 for the SysV segments (and one for private, and likely a few more for shared mmap objects)].

Another alternative would be to go to v3 and get Oracle to create the segments with IPC_RELAXED_ISOLATION.
Steven E. Protter
Exalted Contributor

Re: SHMMAX on HPUX 11iv2 memory upgrade


The size of the memory segments displayed is most likely from the configuration of the Oracle SGA and how much memory it is requesting.

It might not be efficient for Oracle to request the memory in big chunks.

Also 32 bit Oracle has some limitations on size of memory segments. Did you install a 32 or 64 bit version of Oracle..

You ask:
With a SHMMAX of 16gb, shouldn't it only be creating one shared memory segment for both databases?

Answer: To prevent memory corruption, each oracle instance creates a shared memory segment for itself. To have one shared memory segment, you would need all your oracle tables and tablespaces in one instance not two.

Steven E Protter
Owner of ISN Corporation
Esteemed Contributor

Re: SHMMAX on HPUX 11iv2 memory upgrade

I think that for 64 bits oracle, SHMMAX should be a little bit larger than the largest of Oracle SGA.

As for 32 bits oracle, SHMMAX had to be 1g.