[1666203 views]

[]

Odi's astoundingly incomplete notes

New entries | Code

Installing Oracle 11g on x86_64 Gentoo

The normal quick install guide applies. Additionally:

Oracle needs some 32bit versions of packages. So we need to use the abi_x86_32 USE flag on some packages.

Set USE flags in /etc/portage/package.use: Set keywords in /etc/portage/package.keywords:
1. emerge the following packages: 2. create symlinks 3. create /bin/gcc wrapper script:
#!/bin/bash
if [ "$1" = "-m32" ]; then
  /usr/bin/gcc -L/usr/lib32 $*
else
  /usr/bin/gcc $*
fi
and make it executable: chmod 755 /bin/gcc

4. /dev/shm mount options need to be default and the size needs to be set to accomodate your SGA. NB that more shm is required than the size of your SGA. This seems to be due to busg in Oracle. The required additional space can be a lot. To be safe, just set it to all available memory:
/etc/fstab:
shm                     /dev/shm        tmpfs           defaults,size=64g        0 0
Then: mount -o remount,defaults,size=64g /dev/shm

5. /etc/sysctl.conf: Always overcommit seems to be the only working solution with dozens of GB SGA.
# there is no swap really
vm.swappiness=0
# 0: default overcommit
# 1: always overcommit
# 2: never overcommit. max = swap + ratio% * RAM
vm.overcommit_memory=1
# commit limit = (swap + ratio% * RAM)
vm.overcommit_ratio=100

# Oracle
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 5368709120
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
Then sysctl -p

6. If remote installing: ./runInstaller -ignoreSysPrereqs

7. On link errors during install (or during copying files in a different shell if you are quick), edit $ORACLE_HOME/lib/sysliblist and add -lrt

In $ORACLE_HOME/sysman/lib run manually make -f ins_emagent.mk "agent" then copy the last failed gcc commandline and add -lnnz11 and execute it. Hit the Retry button.

8. Disable password expiry

9. Enable automatic startup in /etc/oratab by setting the last column to Y.

10. Add an init script /etc/init.d/oracle:
#!/sbin/runscript

depend() {
        need net logger hostname clock 
        after sshd
}

start() {
        ebegin  "Oracle"
        cat <<-"EOF"|su - ${ORACLE_OWNER:-oracle}
        lsnrctl start
        dbstart
        emctl start dbconsole
EOF
        eend $?
}

stop() {
        ebegin "Oracle"
        cat <<-"EOF"|su - ${ORACLE_OWNER:-oracle}
        emctl stop dbconsole
        dbshut
        lsnrctl stop
EOF
        eend $?
}
11. If running without swap, make sure to size the SGA appropriately.

See also Gentoo forum entry.
posted on 2009-10-06 15:17 UTC in Code | 0 comments | permalink