Solved

Solaris 2.6 SHMMAX setting for Oracle 8.0.5

Posted on 2000-04-20
3
7,422 Views
Last Modified: 2013-12-05
Server Platform: Sun Solaris 2.6
Oracle version: 7.3.4
Other Install: Context Cartridge 2.3.4
Physical Memory: .5 GB
Swap Space: 1 GB

We have run into an issue with the default SHMMAX settings suggested by Oracle documentation. Oracle documentation suggested that we have a 4GB SHMMAX setting, but when we used that setting, it seemed that swap space was being taken for the SGA.

It has been suggested to us that we use an SHMMAX setting that is the same as physical memory. In our case, it would be .5 GB.

My question is for those who have dealt with this situation...
Is it better to set the SHMMAX setting to the amount of physical memory? If so, then why does Oracle documentation state it differently? May we experience problems because the SHMMAX is set so low?

Thanks!

0
Comment
Question by:wren2000
3 Comments
 
LVL 5

Expert Comment

by:sbenyo
Comment Utility
Hi,

Shmmax defines the maximum size a shared segment can be.

shmmax is used by the kernel every time a share memory is being allocated (ask by applications).
If the share memory asked for is larger than shmmax allocation fails.

Setting shmmax to its maximum value does not effect the kernel size -- no kernel resources get allocated based on shmmax, so this can be tuned to its maximum value of 4 GB (0xffffffff).

In Solaris 2.6 shmmax can get as high as 4GB and this is because of the 32-bit limit of the kernel.
In the kernel shmmax is defined as:

set shmsys:shminfo_shmmax=0xffffffff /* hexidecimal */
set shmsys:shminfo_shmmax=4294967295 /* decimal */

That's exactly what Oracle recommend.
Oracle tries to allocate shared memory for the SGA. setting shmmax to the highest limit only ensures that Oracle's request for shared memory will not fail.

But, there may be other programs using shared memory segments causing the SGA not be able to use one contigous segment.
Use ipcs -a to determine shared memory usage on your system, and see if there is high usage of shared segments.
If so, check what's running on the system apart from Oracle that uses your shared memory.

As for swapping, how did you check that the SGA is being swapped ?
In this case you should also check the init.ora parameters:
db_block_size
db_buffers
share_pool_size

These parameters (with some other which are not that important) determine the SGA size.
You have to tune these parameters so that you system will not be too large for your system, and still will be enough for the database.



0
 
LVL 6

Expert Comment

by:mshaikh
Comment Utility
You have to make you share memory as large as the larges SGA plus some (15 to 20% is a good estimate). Don't set the shared memory max  to more than .5 GB. And make you your SGA less than or equal to 1/2 the memory, 256Mb. Your swapping problem will probably go away. If it does not  then you should try to further reduce the SGA and consider using MTS.
0
 
LVL 4

Accepted Solution

by:
tbcox earned 100 total points
Comment Utility
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1011658.6

Note:1011658.6
Subject:  SHARED MEMORY REQUIREMENTS ON UNIX
Type:  PROBLEM
Status:  PUBLISHED
 Content Type:  TEXT/PLAIN
Creation Date:  09-AUG-1995
Last Revision Date:  28-MAR-2000
Language:  USAENG
 

Problem Description:
====================
 
This entry lists shared memory requirements for Unix systems.
 
 
Problem Explanation:
====================
 
Oracle uses shared memory and semaphores to communicate between processes and
the SGA (System Global Area).  There are certain requirements for shared
memory and the semaphores.  When the Oracle instance comes up, it allocates a
certain portion of the main memory to create the SGA. If the shared memory or
the semaphores are not set properly, then it gives an error related to shared
memory or semaphores.  
 
The following are the recommended values for shared memory and semaphores for
running a SMALL size Oracle database.  These values are set at the Unix kernel
level.
 
Search Words: SHMMAX, SHMMIN, SHMMNI, SHMSEG, SEMMNS, SEMMNI, SEMMSL

Solution: SHARED MEMORY REQUIREMENTS ON UNIX


Solution Description:
=====================
 
The shared memory feature of the UNIX operating system is required by Oracle.  
The System Global Area (SGA) resides in shared memory; therefore, shared
memory must be available to each Oracle process to address the entire SGA.
 
 
      Definitions of Shared Memory and Semaphore Parameters
 
SHMMAX = The maximum size(in bytes) of a single shared memory segment.
SHMMIN = The minimum size(in bytes) of a single shared memory segment.
SHMMNI = The number of shared memory identifiers.
SHMSEG = The maximum number of shared memory segments that can be attached by
       a process.
SEMMNS = The number of semaphores in the system.
SEMMNI = The number of semaphore set identifiers in the system; determines the
       number of semaphore sets that can be created at any one time.
SEMMSL = The maximum number of sempahores that can be in one semaphore set.
       It should be same size as maximum number of Oracle processes
       (The PROCESSES parameter in the init.ora file).
 
 
      Recommended Semaphore and Shared Memory Parameters
 
Operating System        Shared Memory Parameters                 Semaphore
----------------        ------------------------                 ---------
Sun OS                  SHMSIZE = 32768                          SEMMNS = 200
                        SHMMNI = 50                              SEMMNI = 50
 
 
Solaris                 SHMMAX = 8388608                         SEMMNS = 200
                        SHMSEG = 20                              SEMMSL = 50
                  SHMMNI=100                         SEMMNI = 70
 
 
 
      Setting the Shared Memory and Semaphore Parameters
 
The values of the shared memory and semaphore parameters must be set in the
kernel configuration file of your operating system (OS).  The location of that
file is port-specific. See PRE 1010913.6 for its name and location on your
system.  
 
To check your current shared memory and semaphore configuration you can use
the command:
 
      % sysdef | more
 
Example on HP-UX (relevant sections only):
------------------------------------------
Semaphore Related Parameters
 maximum value for semaphores(semaem)= 16384
 Semaphore  map(semmap)= 4098
 number of semaphore identifiers(semmni) = 4096
 total number of semaphores in the system(semmns) = 8192
 number of semaphore undo structures(semmnu) = 1536
 semaphore undo entries per process(semume) = 512
 semaphore maximum value(semvmx) = 32767
 
Shared Memory Related Parameters
 maximum shared memory segment size in bytes(shmmax) = 536870912
 minimum shared memory segment size in bytes(shmmin) = 1
 maximum shared memory segments in system (shmmni) = 512
 maximum shared memory segments per process(shmseg) = 512
 
NOTE:  The SHMMAX is quite large on this system as there are 8 instances
running on this system.
      
 
To make changes in shared memory or semaphore parameters:
 
      1. Shut down any running Oracle instances
      2. Locate the kernel configuration file for your OS
      3. Make the necessary changes using the system utilities or your
         favorite editor.  System utilities include:
 
            OS      Utility
            ---      -------
            HP-UX      SAMS
            SCO      SYSADMSH
            AIX      SMIT
            Solaris      ADMINTOOL
 
      4. Reconfigure the kernel.  
      5. Reboot your machine.  
      6. Restart your Oracle instances
 
 
Example, using Solaris 2.3/2.4 parameters and commands:
--------------------------------------------------------
      1. Log into SQLDBA and type:  
            SQLDBA> shutdown
            SQLDBA> exit
 
      2. Log in as the superuser (root) and:
            # cd /etc/system
   
      3. Add the following lines to the /etc/system file:  
 
                set shmsys:shminfo_shmmax=8388608  
                set shmsys:shminfo_shmmin=1  
                set shmsys:shminfo_shmmni=100  
                set shmsys:shminfo_shmseg=20  
                set semsys:seminfo_semmns=200  
                set semsys:seminfo_semmni=70  
 
      4. Reconfigure the kernel:
            # touch /reconfigure
   
      5. Reboot the machine:
            #init 6  
 
      6. Log into SQLDBA and type:
            SQLDBA> startup
            SQLDBA> exit
 
 
 
      Oracle, Shared Memory, and SGA Size  
 
There are Oracle init<SID>.ora parameters which can be modified to influence
the size of the SGA.  These settings of these parameters, in conjunction with
OS shared memory and semaphore parameters, can influence both system and
Oracle performance.
 
For more information on configuring the SGA, see PRE 1008866.6
 
For more information on memory and performance, see PRE's 1012819.6 and
1008866.6
..

 

--------------------------------------------------------------------------------
 
 Copyright (c) 1995,1999 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.


0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now