<SCRIPT LANGUAGE = "JavaScript">
<!--
top.corner.help.location.replace("ml2_graphics.helpFrame?p_hlp_tag=SHOW_NOTE");
//-->
</SCRIPT>
<!-- $Id: ml2_documents_b.sql,2.8.9.0 2004/10/25 MetaLink Exp $ -->
<HTML><HEAD>
<TITLE></TITLE></HEAD><BODY MARGINHEIGHT="0" MARGINWIDTH="0"
LEFTMARGIN="0" TOPMARGIN="0" BGCOLOR="#6699CC" LINK="#000000" ALINK="#000000">
<CENTER><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BORDER=0
WIDTH="98%" HEIGHT="0" >
<TR>
<TD BGCOLOR="#FFFFFF" ALIGN="LEFT" VALIGN="TOP">
<IMG SRC="http://metalink.oracle.com/images/metalink/generic/usaeng/kur_left_top.gif" HEIGHT="15" WIDTH="10"></TD><TD BGCOLOR="#FFFFFF"> </TD>
<TD BGCOLOR="#FFFFFF" ALIGN="RIGHT" VALIGN="TOP">
<IMG SRC="http://metalink.oracle.com/images/metalink/generic/usaeng/kur_right_top.gif" HEIGHT="15"></TD>
</TR><TR><TD COLSPAN=3 WIDTH=100% VALIGN=TOP BGCOLOR="#FFFFFF">
<font face="helvetica">
<TABLE cellspacing="0" cellpadding="2" border="0" width="100%">
<TR ALIGN="center">
<TD ALIGN="center"><A HREF="ml2_bookmarks.addBookmark?p_title=UNIX%3A%20Resolving%20the%20ORA-27123%20error&p_database_id=NOT&p_document_id=115753.1&p_username=KAZIMIRG" TARGET="corner"><FONT size="-1">Bookmark</FONT></A></TD>
<TD ALIGN="center"><A HREF="ml2_documents.showNot?p_id=115753.1&p_font="><SMALL>Fixed font </SMALL></A></TD>
<TD ALIGN="center"><A HREF="#bottom"><FONT size="-1">Go to End</FONT></A></TD>
</TR>
</TABLE>
<BR>
<TABLE width=80% border="0" cellpadding="0" cellspacing="0">
<TR>
<TD>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR>
<TD VALIGN=TOP><STRONG><a href="/help/usaeng/Search/search.html#file">Doc ID</a>: </STRONG></TD>
<TD>Note:115753.1</TD>
</TR>
<TR>
<TD VALIGN=TOP><STRONG>Subject: </STRONG></TD>
<TD>UNIX: Resolving the ORA-27123 error</TD>
</TR>
<TR>
<TD VALIGN=TOP><STRONG>Type: </STRONG></TD>
<TD>BULLETIN</TD>
</TR>
<TR>
<TD VALIGN=TOP><STRONG>Status: </STRONG></TD>
<TD>PUBLISHED</TD>
</TR>
</TABLE>
</TD><TD>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR>
<TD VALIGN=TOP><STRONG>Content Type: </STRONG></TD>
<TD>TEXT/PLAIN</TD>
</TR>
<TR>
<TD VALIGN=TOP><STRONG>Creation Date: </STRONG></TD>
<TD>23-JUL-2000</TD>
</TR>
<TR>
<TD VALIGN=TOP><STRONG>Last Revision Date: </STRONG></TD>
<TD>09-JUL-2004</TD>
</TR>
</TABLE>
</TR>
</TABLE>
<PRE>
Problem Description <P>------------------- <P> <P>You are trying to start your database and are getting one of the following <P>errors: <P> <P> ORA-27123: Unable to attach a shared memory segment <P> Error: ORA-27123 <P> Text: unable to attach to shared memory segment <P> Cause: shmat() call failed <P> Action: check permissions on segment, contact Oracle support <P> <P>This error may be accompanied by one of the following: <P> <P> A) SVR4 error 12: not enough space <P> B) SVR4 error 22: Invalid argument (you are trying to increase SGA and <P> SHMMAX is large enough) <P> C) SVR4 error 22: Invalid argument <P> D) SVR4 error 22: Invalid argument <P> E) UNIX error 13 (Permission Denied) <P> F) SVR4 error 24 - too many open files. <P> <P> <P>Solution Description <P>-------------------- <P> <P>A) You are receiving the above error messages because the SGA size for <P> the current instance is too large to fit into the available physical <P> memory segments. <P> <P> Raise SHMMAX in /etc/system or Lower SHARED_POOL_SIZE and/or <P> DB_BLOCK_BUFFERS accordingly <P> <P> You need to reduce the SGA to a resonable size, so that it can be <P> allocated during the startup process. <P> <P> Approximating size of the SGA <P> ----------------------------- <P> <P> 8.0.X <P> <P> To approximate size of the SGA (Shared Global Area), use following formula: <P> <P> ((db_block_buffers * block size) + <P> (shared_pool_size + large_pool_size + log_buffers) + 1MB <P> <P> <P> 8.1.X <P> <P> To approximate size of the SGA (Shared Global Area), use following formula: <P> <P> ((db_block_buffers * block size) + <P> (shared_pool_size + large_pool_size + java_pool_size + log_buffers) + 1MB <P> <P> <P> For Example: <P> SHARED_POOL_SIZE = 200 MB <P> DB_BLOCK_BUFFERS = 200000 # 1600 MB <P> DB_BLOCK_SIZE = 8192 #8K <P> LOG_BUFFER = 65536 # 64K <P> <P> Total SGA size becomes about 1800 MB for this instance. <P> <P> *NOTE: If you have other instances running on the same server, <P> you need to calculate SGA size requirements for the other <P> instances also. <P> <P> Modify DB_BLOCK_BUFFERS from 200000 to approximately 5000 (40 MB) <P> in the init<SID>.ora file and restart the database. <P> <P> SVRMGR> shutdown immediate <P> SVRMGR> startup <P> Statement processed. <P> <P> <P>B) You are trying to increase the size of the SGA for your database. <P> You have adequate memory, and your SHMMAX is large enough to accomodate <P> the new SGA. If you are on Sun, you have already tried adjusting <P> sgabeg, as per <a target=corner
href="ml2_documents.showDocument?p_id=61896.1&p_database_id=NOT">[NOTE:61896.1]</a>. Despite checking all these possibilities, <P> you still get an ORA-27123 and a UNIX error 22. <P> <P> %svrmgrl <P> SVRMGR> connect internal <P> SVRMGR> startup <P> ORA-27123 "unable to attach to shared memory segment" <P> SVR4 ERROR 22 Invalid argument <P> <P>C) You are on a sun4c machine trying to startup the database. You receive <P> the following errors: <P> <P> ORA-27123: unable to attach to shared memory segment <P> SVR4 Error: 22: Invalid argument <P> <P> The value of the kernel parameter "shmmax" is at least 10% bigger than <P> the estimated size of the SGA of for database. You lower the <P> "sgabeg" address as instructed in <a target=corner
href="ml2_documents.showDocument?p_id=1028623.6&p_database_id=NOT">[NOTE:1028623.6]</a>, relink Oracle and still <P> receive the same error when you attempt to startup the database. <P> <P> Set "sgabeg" to a value within the address space of your physical RAM. <P> Note that valid values start at 0x000000, and that the system requires 32M <P> to boot up. <P> <P> For example: <P> <P> - If you have 64M of RAM, then you have a physical address space from <P> 0x000000 to 0x4000000 (64M in hexadecimal). <P> - Set sgabeg address to 0x3000000 using the method shown in <a target=corner
href="ml2_documents.showDocument?p_id=1028623.6&p_database_id=NOT">[NOTE:1028623.6]</a>. <P> This will attach the SGA leaving 48M for the system. <P> <P> *NOTE: sgabeg = 0x10000000 for sun4c machines does not work because this is <P> still too high of an address if machine has more than 256Mb of RAM. <P> <P> <P>D) You are running a batch job as root and receive the following error (running <P> as an oracle user does not fail) <P> <P> ORA-01034: ORACLE not available <P> ORA-27123: unable to attach to shared memory segment <P> SVR4 Error: 22: Invalid argument <P> Additional information: 1 <P> Additional information: 6203 <P> <P> You need to set ulimit stack to 8192 <P> <P> <P>E) You have installed Oracle8 on UNIX and are attempting to create a database <P> manually or with the installer. You are receiving the following error: <P> <P> %svrmgrl <P> SVRMGR>connect internal <P> SVRMGR>startup nomount. <P> ORA-27123: "unable to attach to shared memory segment" <P> Cause: shmat() call failed <P> Action: check permissions on segment, contact Oracle support <P> UNIX error 13 (Permission Denied) <P> <P> You need to change the "umask" to the required 022, set the permissions on <P> all relevant directories and also set the correct permissions for the oracle <P> executable per se. See the Platform Specific Installation Guide <P> Table 4-1 Access Permissions on Oracle Directories and Files <P> <P> Example: <P> # umask 022 <P> # cd $ORACLE_HOME <P> # chmod 755 (on all sub-dirs) <P> # cd $ORACLE_BASE/admin/(SID NAME) <P> # chmod 755 (on all sub-dirs) <P> # cd $ORACLE_HOME/bin <P> # chmod 6751 oracle <P> <P>F) You are trying to create a new database, and when you begin by typing <P> <P> % svrmgrl <P> SVRMGR> startup nomount pfile=<initfile> <P> You get: <P> <P> ORA-27123, 00000, "unable to attach to shared memory segment" <P> // *Cause: shmat() call failed <P> // *Action: check permissions on segment, contact Oracle support <P> svr4 error 24 - too many open files. <P> <P> Check your nofiles(descriptors) limit by typing: <P> <P> % ulimit -a <P> <P> It may be set to the default 64. You will want to increase this to <P> allow oracle to open the files it needs to create your database. <P> <P> <P>Explanation <P>----------- <P>A) When you reduce the size of the SGA, Oracle can now allocate this <P> space in the physical memory segment. The database will now start <P> up without any error. <P> <P>B) Stack size, as shown by the 'ulimit -a' C-shell command, <P> my be set to low. This limit should be set to at least 8192K bytes. <P> <P>C) You do not have much physical memory on your system. None of the <P> recommended values for "sgabeg" work because these values are still higher <P> than the amount of physical memory that is on your system. <P> <P>D) Because root was starting the jobs, the stack size of unlimited was <P> inherited from root. Changing to 8192 allowed the jobs to run. <P> <P>E) You have installed the software with an incorrect umask setting for the <P> oracle user or the permissions were changed after the install was complete. <P> When the database starts up, oracle needs write permission to certain <P> directories. Incorrect permissions on the oracle software will cause <P> the noted failure during database startup. <P> <P>F) Increasing this parameter allows your shell to open the number of files it <P> needs in order to complete the operation. 64 is not a large enough number <P> to accomplish some tasks with Oracle, and increasing it will not pose an <P> undue burden on the system. <P> <P> <P>References <P>---------- <P> <P><a target=corner
href="ml2_documents.showDocument?p_id=69119.1&p_database_id=NOT">[NOTE:69119.1]</a> "SGA Sizing Issues on HP-UX" <P> <P><a target=corner
href="ml2_documents.showDocument?p_id=1028623.6&p_database_id=NOT">[NOTE:1028623.6]</a> SUN SOLARIS: HOW TO RELOCATE THE SGA <P> <P><a target=corner
href="ml2_documents.showDocument?p_id=1042494.6&p_database_id=NOT">[NOTE:1042494.6]</a> SOLARIS: ORA-27123: WHEN STARTING A V8.0.4.X DATABASE <P></PRE>
<a name="bottom">.</a>
</TD></TR><TR><TD BGCOLOR="#FFFFFF" COLSPAN=3><HR SIZE="1" ALIGN=LEFT NOSHADE></TD></TR><TR>
<TD ALIGN="LEFT" BGCOLOR="#FFFFFF" VALIGN="BOTTOM"><IMG SRC="http://metalink.oracle.com/images/metalink/generic/usaeng/kur_left_bottom.gif"></TD><TD VALIGN="BOTTOM" BGCOLOR="#FFFFFF"><SMALL><A HREF="http://www.oracle.com/html/copyright.html" target="_top">Copyright (c) 1995,2000 Oracle Corporation</A>. All Rights Reserved.<A HREF="http://metalink.oracle.com/metalink/plsql/ml2.show_legal_text"> Legal Notices and Terms of Use.</A></SMALL></TD>
<TD ALIGN="RIGHT" BGCOLOR="#FFFFFF" VALIGN="BOTTOM"><IMG SRC="http://metalink.oracle.com/images/metalink/generic/usaeng/kur_right_bottom.gif"></TD></TR></TABLE></CENTER></BODY></HTML>