15.5. Lowering the SGA Attach Address for Shared Memory Segments in Oracle 9i

The default SGA attach address for shared memory segments in Oracle 9i on Red Hat Enterprise Linux 2.1 is 0x50000000 (1.25 GB). To lower the SGA attach address for shared memory, the Oracle utility genksms must be used before the relinking:

Note

The examples below use # to represent comments not a root shell.
Login as oracle and execute the following commands:
# shutdown Oracle
SQL> shutdown

cd $ORACLE_HOME/rdbms/lib

# Make a backup of the ksms.s file if it exists
[[ ! -f ksms.s_orig ]] && cp ksms.s ksms.s_orig

# Modify the SGA attach address in the ksms.s file before relinking Oracle
genksms -s 0x15000000 > ksms.s
Rebuild the Oracle executable by entering the following commands:
# Create a new ksms object file
make -f ins_rdbms.mk ksms.o

# Create a new "oracle" executable ($ORACLE_HOME/bin/oracle):
make -f ins_rdbms.mk ioracle

# The last step creates a new Oracle binary in $ORACLE_HOME/bin 
# that loads the SGA at the address specified by sgabeg in ksms.s:
#   .set   sgabeg,0X15000000
Now when Oracle is started in the shell terminal session for which the mapped_base for shared libraries was changed at Section 15.4, “Lowering the Mapped Base Address for Shared Libraries in Red Hat Enterprise Linux 2.1”, the SGA attach address for Oracle's shared memory segments and hence SGA can be displayed with the following commands:
# Get pid of e.g. the Oracle checkpoint process
$ /sbin/pidof ora_dbw0_$ORACLE_SID
13519
$ grep '.so' /proc/13519/maps |head -1
10000000-10016000 r-xp 00000000 03:02 750738     /lib/ld-2.2.4.so
$ grep 'SYS' /proc/13519/maps |head -1
15000000-24000000 rw-s 00000000 00:04 262150     /SYSV3ecee0b0 (deleted)
$
The SGA size can now be increased to approximately 2.7 GB. If you create the SGA larger than 2.65 GB, then test the database very thoroughly to ensure no memory allocation problems arise.