Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Recommendations for tunable shmmax in preparation for Oracle10g

SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Recommendations for tunable shmmax in preparation for Oracle10g

Hi,

I was given a list of prerequisite kernel tunables for an Oracle10g installation/upgrade that I am supposed to deploy tomorrow night.
I've been putting up a Perl script to do this because this needs to be done on a bunch of hosts where SAM wouldn't be a sensible tool,
when I tripped over shmmax.
In the list I was given, it laconically reads, "AvailMem".
As I haven't got a clue about Oracle system tuning I wonder what "Available Memory" compares to in my case?
The boxes where I am supposed to set this are for instance furnished with abt. 32 GB of RAM.

Regards
Ralph
Madness, thy name is system administration
16 REPLIES
Tim Nelson
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Set to physical memory. shmmax is only a top end limit. If you wish, set to 2GB or so less to reserver some for system processes to stop oracle admins from taking all the memory.
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Here:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1109448

"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

P.S. Don't set it equal to available physical memory. It's a waste. Not unless you are planning on having a 32Gb SGA.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Ralph Grothe
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Hi Tim,

I've just had a talk to one of my colleagues who is an Informix admin.
His advice was exactly the same as yours,
viz. to set it to the whole of physical RAM minus an allowance of abt. 2GB for the system itself.
He also showed me a terse explenation of this tunable from his docs, where it says:


- The value of the kernel parameter "shmmax" should be set to the
maximum allowable on the system. Setting "shmmax" to a high value
will prevent the OS from creating multiple shared memory segments
which can degrade performance.

Madness, thy name is system administration
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Look if your SGA is 4GB then make shmmax equal to 5Gb in size. This will allow for some growth of the SGA. shmmax can always be changed to be larger later if necessary. Then when oracle requests a shared memory segment for the SGA it will only choose one. Why is this so hard to understand. Oracle recommendation to set shmmax to the size of available physical memory is just hogwash in my opinion.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Also if you are planning on having multiple instances on the same box, set shmmax to something a little larger than the largest SGA. This will allow any instance to pull only one shared memory segment for each instances SGA.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Tim Nelson
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

FYI,

There is no preallocation with shmmax, it is only a limit, not like static tables.

Yes, if oracle attempts to create an SGA that is larger than shmmax it will fragment and create multiples, in turn creating a performance problem. Other applications will error out.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Recommendations for tunable shmmax in preparation for Oracle10g

While it is true that setting shmmax to a very large value does not consume resources, it also sets the stage for abuse. Ask your DBA's what their largest anticipated SGA size is and set it to that (if reasonable). One thing to keep in mind iis that this is a per-segment limit and a process can have many shared memory segments. Even with a small value of shmmax, it is possible to allocate enormous amounts of shared memory but setting shmmax to a large value makes this much easier to abuse. Also note that you aren't limited by physical memory but rather virtual memory. The downside to having a smaller shmmax (e.g 1GiB) is that oracle will have to make multiple segments so that the SGA is less efficient. It's better if everything in the SGA will fit in one segment. So again, the correct approach, is too ask what their largest anticapted needs are and set it accordingly. In any event, with 32GiB of physical memory, I would think that an SGA of 16GiB would be more than adequate and I would set shmmax very near to that value.

If it ain't broke, I can fix that.
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Tim do you really believe that he is going to be running other apps/services on his oracle database server that are going to require a shared memory segment larger than what the size of his largest SGA is going to be. Come on, be realistic. Let's say his SGA is going to be 5Gb and he sets shmmax to be 6Gb, I highly doubt that if he runs ipcs -mb that he will see another process that is going to need a shared mem segment larger than 6Gb.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Ralph Grothe
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Hi Court,

at the moment the value is set to abt. 22 GB (of 32 GB RAM), so I would think I could well leave it at that.

# kmtune -q shmmax|perl -alne 'print hex($F[1])/2**30 if $F[0] eq "shmmax"'
22


How can I find out how much memory was assigned to the old 9i DB?
In the pfile init.ora I couldn't find some sga param.
There must exist a view in the data dictionary that one can query by a simple SQL statement?
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Wait, I think this should suffice as a clue

# ipcs -mob|grep oracle
m 368649 0xe0377310 --rw-rw---- oracle dba 13 98275328
m 3082 0xe71d289c --rw-r----- oracle dba 797 13826273280
Madness, thy name is system administration
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Login to sqlplus and;

>show sga

That will show the sga size.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

I truly recommend that you read this:

http://orafaq.com/node/8

I believe that it will answer a lot of your questions.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
TwoProc
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Small point - but , set it just a bit bigger than db_cache_size - because this most likely is your largest piece of the SGA. The other parts of the SGA will be perfectly happy living in their own segment(s) after the buffer cache gets its own big space.
We are the people our parents warned us about --Jimmy Buffett
Tim Nelson
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

Duely noted Court,

I think all responses are valid and helpfull enough to help Ralph make his decision.



Ralph Grothe
Honored Contributor

Re: Recommendations for tunable shmmax in preparation for Oracle10g

show sga:

SQL>
Total System Global Area 1.3809E+10 bytes
Fixed Size 756808 bytes
Variable Size 1795162112 bytes
Database Buffers 1.2012E+10 bytes
Redo Buffers 1060864 bytes


which indeed is the shm seg @ ID 522 as I already have assumed:

# ipcs -mob|grep ora
m 167945 0xe0377310 --rw-rw---- oracle dba 12 98275328
m 522 0xe71d289c --rw-rw---- oracle dba 1165 13826273280
Madness, thy name is system administration