Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unable to attach SGA (beyond 2GIG)
My question on the following: If I lower that sgabeg thing, am I
limited to a number of connections to the DB? Or just the sizew of my
PGA? Thanx
2. sgabeg and the SPARC virtual memory map
On a UNIX operating system with a 32bit word size, each process has
it's own 4Gb
virtual address map (0x0000000 - 0xffffffff), and ANY chunk of memory
(shared
memory segments included) has to fit into free space in this map. The
memory
management unit (MMU) is responsible for subsequent virtual to
physical address
translation and has no further relevence here.
Locating sufficient free space within the virtual address map, in
which to
attach the shared memory segment, is dictated by three things:
The SPARC ABI virtual memory map has several forms, but the most
common (Solaris
2.5+ on sun4m/sun4u/sun4d) is:
|------------|| 0xef000000 | default start for dlopen()ed and mmap()ed files (grows
| |
| /|\ |
| | |
| |
| 0xf0000000 | Kernel stack (grows upwards)
|------------|
| 0xf0000000 | User stack (grows downwards)
| |
| | |
| \|/ |
| |
| /|\ |
| | |
| |
|- - - - - - || 0x00000000 | Bottom 64k not mapped
| |
| /|\ |
| | |
| |
| 0x80000000 | Default sgabeg (grows upwards)
|- - - - - - |
| |
| /|\ |
| | |
| |
| 0x00010000 | Text & Data (grows upwards)
|------------|
| |
As you can see from the diagram above, the default SGA attach address
is
0x80000000. Given that dlopen()ed and mmap()ed files are attached at
0xef000000
and above, this allows for an SGA no bigger than about 1.7Gb.
3. Large SGA's
You have the ability to reduce the value of sgabeg, thereby allowing a
larger
SGA. The amount by which you can successfully reduce sgabeg is
determined
by how far up the map text and data segments have already grown.
Also bear in mind that once the shared memory segment is successfuly
mapped at
an address, other segments cannot use this space. Therefore, by
lowering sgabeg
you reduce the amount of memory that can be allocated later for data
segments,
which constitute the Oracle Private Global Area (PGA).
My advice is never to set sgebeg below 0x01000000. On an average
system, this
leaves about 7Mb for data segments, out of which must come (at least)
enough
memory for such things as SORT_AREA_SIZE etc. With a start address of
0x01000000
you can achieve an overall SGA size of about 3.6Gb.
Any problem attaching the shared memory segment due to it overlapping
with
another segment (i.e. sgabeg too low, or sga too big) will produce the
following
two errors at instance startup:
V7:
ORA-7307: sms1sg: shmat error, unable to attach sga
SVR4 error: 22: Invalid argument
V8:
ORA-27123: unable to attach to shared memory segment
SVR4 error: 22: Invalid argument
O/S error 22 (invalid argument) confirms that shmat() failed because
the
requested attach address is illegal, mis-aligned, or the segment would
overlap
an area of the virtual memory map that's already in-use.
If you have successfully reduced the value of sgabeg, and subsequently
receive
errors:
ORA-4030: out of process memory when trying to allocate %s bytes (%s,%s)
or
ORA-7324: smpall: malloc error while allocating pga.
then it's very likely that you've lowered the start address into an
area which
the PGA needs to extend into. Raise sgabeg, and try again.
For RDBMS versions 7.3.3.x.x, 7.3.4.x.x:
% cd $ORACLE_HOME/rdbms/lib
% genksms -b <the value you require> >ksms.s
e.g.
genksms -b 0x80000000 >ksms.s
% cp env_rdbms.mk env_rdbms.mk.orig % vi env_rdbms.mk
change:
$(KSMSS): $(ORACLE_HOME)/bin/genksms
$(ORACLE_HOME)/bin/genksms > $(KSMSS)
to:
$(KSMSS): $(ORACLE_HOME)/bin/genksms
$(ORACLE_HOME)/bin/genksms > $(KSMSS).default_sgabeg
% rm ksms.o
% make -f ins_rdbms.mk ioracle
On Tue, 07 Sep 1999 02:12:18 GMT, netcomradeNOSPAM_at_earthlink.net (NetComrade ) wrote:
>Hi I am trying to create SGA of around 3.7GIGs, but I get an error > >SVRMGR> startup >ORA-07307: sms1sg: shmat error, unable to attach sga. >SVR4 Error: 22: Invalid argument >Additional information: 1 > >here's my /etc/system >************** Oracle's ******************************** >set shmsys:shminfo_shmmax=4026531840 >set shmsys:shminfo_shmmin=1 >set shmsys:shminfo_shmmni=100 >set shmsys:shminfo_shmseg=4104 >set semsys:seminfo_semmns=65535 >set semsys:seminfo_semmni=4096 >set semsys:seminfo_semmsl=400 > >When I called Oracle, they told me that I am allowed to have SGA size >of 3.75 Gig on Orace 7.3.4 and Solaris 2.6 > >Any suggestions? >Thanx >Received on Mon Sep 06 1999 - 22:01:34 CDT
![]() |
![]() |