Problem Description -------------------
You are trying to start your database and are getting one of the following
errors:
ORA-27123: Unable to attach a shared memory segment
Error: ORA-27123
Text: unable to attach to shared memory segment
Cause: shmat() call failed
Action: check permissions on segment, contact Oracle support
This error may be accompanied by one of the following:
A) SVR4 error 12: not enough space
B) SVR4 error 22: Invalid argument (you are trying to increase SGA and
SHMMAX is large enough)
C) SVR4 error 22: Invalid argument
D) SVR4 error 22: Invalid argument
E) UNIX error 13 (Permission Denied)
F) SVR4 error 24 - too many open files.
Solution Description
--------------------
A) You are receiving the above error messages because the SGA size for
the current instance is too large to fit into the available physical
memory segments.
Raise SHMMAX in /etc/system or Lower SHARED_POOL_SIZE and/or
DB_BLOCK_BUFFERS accordingly
You need to reduce the SGA to a resonable size, so that it can be
allocated during the startup process.
Approximating size of the SGA
-----------------------------
8.0.X
To approximate size of the SGA (Shared Global Area), use following formula:
((db_block_buffers * block size) +
(shared_pool_size + large_pool_size + log_buffers) + 1MB
8.1.X
To approximate size of the SGA (Shared Global Area), use following formula:
((db_block_buffers * block size) +
(shared_pool_size + large_pool_size + java_pool_size + log_buffers) + 1MB
For Example:
SHARED_POOL_SIZE = 200 MB
DB_BLOCK_BUFFERS = 200000 # 1600 MB
DB_BLOCK_SIZE = 8192 #8K
LOG_BUFFER = 65536 # 64K
Total SGA size becomes about 1800 MB for this instance.
*NOTE: If you have other instances running on the same server,
you need to calculate SGA size requirements for the other
instances also.
Modify DB_BLOCK_BUFFERS from 200000 to approximately 5000 (40 MB)
in the init<SID>.ora file and restart the database.
SVRMGR> shutdown immediate
SVRMGR> startup
Statement processed.
B) You are trying to increase the size of the SGA for your database.
You have adequate memory, and your SHMMAX is large enough to accomodate
the new SGA. If you are on Sun, you have already tried adjusting
sgabeg, as per [NOTE:61896.1]. Despite checking all these possibilities,
you still get an ORA-27123 and a UNIX error 22.
%svrmgrl
SVRMGR> connect internal
SVRMGR> startup
ORA-27123 "unable to attach to shared memory segment"
SVR4 ERROR 22 Invalid argument
C) You are on a sun4c machine trying to startup the database. You receive
the following errors:
ORA-27123: unable to attach to shared memory segment
SVR4 Error: 22: Invalid argument
The value of the kernel parameter "shmmax" is at least 10% bigger than
the estimated size of the SGA of for database. You lower the
"sgabeg" address as instructed in [NOTE:1028623.6], relink Oracle and still
receive the same error when you attempt to startup the database.
Set "sgabeg" to a value within the address space of your physical RAM.
Note that valid values start at 0x000000, and that the system requires 32M
to boot up.
For example:
- If you have 64M of RAM, then you have a physical address space from
0x000000 to 0x4000000 (64M in hexadecimal).
- Set sgabeg address to 0x3000000 using the method shown in [NOTE:1028623.6].
This will attach the SGA leaving 48M for the system.
*NOTE: sgabeg = 0x10000000 for sun4c machines does not work because this is
still too high of an address if machine has more than 256Mb of RAM.
D) You are running a batch job as root and receive the following error (running
as an oracle user does not fail)
ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segment
SVR4 Error: 22: Invalid argument
Additional information: 1
Additional information: 6203
You need to set ulimit stack to 8192
E) You have installed Oracle8 on UNIX and are attempting to create a database
manually or with the installer. You are receiving the following error:
%svrmgrl
SVRMGR>connect internal
SVRMGR>startup nomount.
ORA-27123: "unable to attach to shared memory segment"
Cause: shmat() call failed
Action: check permissions on segment, contact Oracle support
UNIX error 13 (Permission Denied)
You need to change the "umask" to the required 022, set the permissions on
all relevant directories and also set the correct permissions for the oracle
executable per se. See the Platform Specific Installation Guide
Table 4-1 Access Permissions on Oracle Directories and Files
Example:
# umask 022
# cd $ORACLE_HOME
# chmod 755 (on all sub-dirs)
# cd $ORACLE_BASE/admin/(SID NAME)
# chmod 755 (on all sub-dirs)
# cd $ORACLE_HOME/bin
# chmod 6751 oracle
F) You are trying to create a new database, and when you begin by typing
% svrmgrl
SVRMGR> startup nomount pfile=<initfile>
You get:
ORA-27123, 00000, "unable to attach to shared memory segment"
// *Cause: shmat() call failed
// *Action: check permissions on segment, contact Oracle support
svr4 error 24 - too many open files.
Check your nofiles(descriptors) limit by typing:
% ulimit -a
It may be set to the default 64. You will want to increase this to
allow oracle to open the files it needs to create your database.
Explanation
-----------
A) When you reduce the size of the SGA, Oracle can now allocate this
space in the physical memory segment. The database will now start
up without any error.
B) Stack size, as shown by the 'ulimit -a' C-shell command,
my be set to low. This limit should be set to at least 8192K bytes.
C) You do not have much physical memory on your system. None of the
recommended values for "sgabeg" work because these values are still higher
than the amount of physical memory that is on your system.
D) Because root was starting the jobs, the stack size of unlimited was
inherited from root. Changing to 8192 allowed the jobs to run.
E) You have installed the software with an incorrect umask setting for the
oracle user or the permissions were changed after the install was complete.
When the database starts up, oracle needs write permission to certain
directories. Incorrect permissions on the oracle software will cause
the noted failure during database startup.
F) Increasing this parameter allows your shell to open the number of files it
needs in order to complete the operation. 64 is not a large enough number
to accomplish some tasks with Oracle, and increasing it will not pose an
undue burden on the system.
References
----------
[NOTE:69119.1] "SGA Sizing Issues on HP-UX"
[NOTE:1028623.6] SUN SOLARIS: HOW TO RELOCATE THE SGA
[NOTE:1042494.6] SOLARIS: ORA-27123: WHEN STARTING A V8.0.4.X DATABASE