shared memory requirements on unix

advertisement
SHARED MEMORY REQUIREMENTS ON UNIX
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. HP-UX
needs a substantial amount of swap space to allocate an SGA as large as 1GB.
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.
Note that when running 32 bit Oracle on 32 bit HP-UX, if SHMMAX > 1GB, then startup
will fail with ORA-7306 and HP-UX error 12 (regardless of the amount of available
memory). If running 32 bit Oracle on 64 bit HP-UX, then prior to 8.1.7, startup will fail if
SHMMAX > 4GB. From 8.1.7 onwards, SHMMAX can be set to any valid value. The
restriction on 32-bit HP-UX still applies (ie, on 32 bit HP-UX, SHMMAX must be <=
1GB).
SHMMAX relation to SGA
Since the SGA is comprised of shared memory, SHMMAX can potentially limit how large
your SGA can be and/or prevent your instance from starting.
What limits the size of my SGA?
In no particular order.
1. The amount of Physical Memory and Swap space available on your system.
2. The kernel parameter SHMMAX.
3. Other OS specific limitations on shared memory.
Memory
+----------+
|
|
|
|
|
|
|
|
|
|
+----------+
SHMMAX
+----------+
|
|
|
|
|
|
|
|
|
|
+----------+
OS Limits
+----------+
|
|
|
|
|
|
|
|
|
|
+----------+
>
+------+
| S
|
| G
|
|
A |
+------+
On some Unix platforms, the Install Guide recommends specific values. Previous
versions of the Install Guide recommended setting SHMMAX to 0.5 *(physical memory
present in machine). Most recently it's been suggested SHMMAX be set to 4294967295
(4GB). This may not seem appropriate, particularly if the system has considerably less
physical memory available, but it does prevent you from having to modify your system
kernel every time a new instance is created or additional physical memory is added to
the system. Remember that SHMMAX is a high water mark, meaning that the OS will
attempt to allow up to that amount for an application.
Shared Memory Requirements on Unix:
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
SHMMIN
SHMMNI
SHMSEG
=
=
=
=
The maximum size(in bytes) of a single shared memory segment.
The minimum size (in bytes) of a single shared memory segment.
The number of shared memory identifiers.
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 semaphores 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
---------------Sun OS
Solaris
Shared Memory Parameters
-----------------------SHMSIZE = 32768
SHMMNI = 50
SHMMAX = 8388608
(or larger than max SGA)
SHMSEG = 20
SHMMNI = 100
Semaphore
--------SEMMNS = 200
SEMMNI = 50
SEMMNS = 200
SEMMSL = 50
SEMMNI = 70
HP/UX
SHMMAX = 0x4000000 (64Mb)
SHMSEG = 12
SEMMNS = 128
SEMMNI = 10
Digital Unix
(DEC Alpha OSF/1)
SHMMAX = 4194304
SHMSEG = 32
SEMMNS = 60
SEMMSL = 25
Ultrix
Use system default
SEMMNS = 60
SEMMSL = 5
AT&T Unix
8 or 16 Mb RAM
32 Mb RAM
64 Mb RAM
128 Mb RAM
256 Mb RAM
512 Mb RAM
1024 Mb RAM
2048 Mb RAM
SHMMAX
SHMMAX
SHMMAX
SHMMAX
SHMMAX
SHMMAX
SHMMAX
SHMMAX
SHMMAX
SHMSEG
SHMMIN
SEMMNS = 200
for all RAM
values
=
=
=
=
=
=
=
=
=
=
=
RAM-Dependant
5 Mb
8 Mb
16 Mb
32 Mb
64 Mb
128 Mb
256 Mb
512 Mb
6 for all RAM values
1 for all RAM values
Dynix/PTX
SHMMAX = 11010048
SHMSEG = 20
Other parameter: NOFILES = 128
DG/UX
SHMMAX = 4194304
SHMSEG = 15
SEMMNS = 200
SEMMSL = 85
SEMMNS = 200
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.
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
minimum
maximum
maximum
shared
shared
shared
shared
memory
memory
memory
memory
segment size in bytes(shmmax) = 536870912
segment size in bytes(shmmin) = 1
segments in system (shmmni) = 512
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
--HP-UX
SCO
AIX
Solaris
Utility
------SAMS
SYSADMSH
SMIT
ADMINTOOL
4. Reconfigure the kernel.
5. Reboot your machine.
6. Restart your Oracle instances
Download