tomclegg.net


Diary
Examples
    256-router
    adzap
    apache-double-reverse
    cacti-adodb-php4
    debian-quota
    diskonmodule
    dollarsperbyte
    dynip
    ezmlm-linux
    fbsdhabits
    freebsdclone
    macbook-quantal-sound
    maildirpop3d-awfulhak
    mandy
    md
    mrtg
    net-snmp
    nodefaultroute
    oracle9i
  >oracle9i-bsd5<
    oracle9i-client
    oracle9i-nat
    php-cgi
    php-commandline
    php-image
    php-kics
    php-mini_httpd
    pinouts
    pizzaperdollar
    plesk-symlink-php
    pxe
    qmail-linux
    qmail-qfilter
    racoon-sonicwall
    redundant-vpn
    rewriterule
    seahorse-workaround
    setting-locale-failed
    smalldog
    snmpv3-cacti
    spamassassin
    squid-tproxy
    supfile
    suse73
    svc-nmbd
    svc-smbd
    svc-smtpd
    toyotastereo
    vm
    vn-file
    wmp-invalid
    xcode-remote-install
    xen-eth0-renamed
    xen-monowall
    xen3-ubuntu-dapper
    zz-update-grub-fail
Hire Tom
Mostly Mozart
Patches
School
Scrapbook
Software
Telephones




colocation
comments
davidireland
edsgranola
faq
funsites
goodlooking
goodmovies
google-earth-saucy-amd64
houserules
liberating
resume
resume2
scratch
shopping
snacks
todo
university
warisbogus

Running Oracle 9i on FreeBSD 5.1
Posted August 11, 2003

Don't even bother trying to run the Oracle installer on FreeBSD.

Instead, NFS-mount the BSD disk from a Linux box and use the Linux system to install Oracle.

Once it is working on the Linux box, tune your FreeBSD kernel according to Oracle's requirements.

Start with a copy of the GENERIC kernel configuration.

bsd5# cd /usr/src/sys/i386/conf
bsd5# cp -i GENERIC /root/BSD5
bsd5# ln -s /root/BSD5

Add the following options.

options SEMMSL=100
options SEMMNS=32000
options SEMOPM=100
options SEMMNI=100
options SHMMAX=2147483647
options SHMMNI=4096
options SHMALL=2097152

Oracle wants SHMMAX=2147483648 but FreeBSD doesn't like that because it doesn't fit in a signed 32-bit word. "Decimal constant is so large that it is unsigned." As it turns out, you have to set SHMMAX at boot time anyway.

bsd5# echo >>/etc/rc.local sysctl kern.ipc.shmmax=2147483647

Also before rebooting, enable linux binary emulation.

bsd5# echo >>/etc/rc.conf linux_enable=YES

Install the linux_base package from a CD or a mirror site.

bsd5# pkg_add ftp://ftp.nrc.ca/pub/systems/bsd/freebsd/releases/i386/4.8-RELEASE/packages/All/linux_base-7.1_2.tgz

Compile and install the new kernel.

bsd5# config BSD5
bsd5# cd ../compile/BSD5
bsd5# make depend
bsd5# make
bsd5# make install
bsd5# reboot

Copy oratab and oraInst.loc to /etc.

bsd5# cd /usr/oracle/etc
bsd5# cp -i oratab oraInst.loc /etc

Change N to Y in the planb line in /etc/oratab, so that dbstart will start the planb instance.

planb:/usr/oracle/planb:Y

Change the oracle user's shell to bash.

bsd5# chsh -s /usr/local/bin/bash oracle

Add environment variables to /home/oracle/.profile.

bsd5# su -l oracle
oracle@bsd5$ cd
oracle@bsd5$ cat >>.profile
export ORACLE_HOME=/usr/oracle/planb
export ORACLE_BASE=/usr/oracle/base
export ORACLE_SID=planb
PATH="$PATH:/usr/oracle/planb/bin"
EOF
oracle@bsd5$ . .profile

Create initplanb.ora from the template init.ora file.

oracle@bsd5$ cp -i /usr/oracle/planb/dbs/init{,planb}.ora

Start Oracle.

oracle@bsd5$ dbstart

SQL*Plus: Release 9.2.0.1.0 - Production on Sat Aug 9 11:05:11 2003

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> Connected to an idle instance.
SQL> ORACLE instance started.

Total System Global Area  235999352 bytes
Fixed Size                   450680 bytes
Variable Size             201326592 bytes
Database Buffers           33554432 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

Database "planb" warm started.

Set up TCP/IP service.

Log in as root again.

Add oraclelistener and oraclelistenerssl ports to /etc/services.

bsd5# cat <<EOF >>/etc/services
oraclelistener    1521/tcp
oraclelistenerssl 2484/tcp
EOF

Copy /usr/oracle/network/admin/listener.ora to /etc and make sure the hostnames are bsd5 (this machine) rather than planb (the machine you ran the installer on).

bsd5# cp -p -i /usr/oracle/network/admin/listener.ora /etc
bsd5# ee /etc/listener.ora

These are the two lines that I changed.

        (ADDRESS = (PROTOCOL = TCP)(HOST = bsd5.cis2.selkirk.bc.ca)(PORT = 1521))
...
      (GLOBAL_DBNAME = bsd5.cis2.selkirk.bc.ca)

Start the TCP/IP listener.

bsd5# su -l oracle -c 'tnslsnr &'

Verify that tnslsnr is listening to port 1521.

bsd5# sockstat|grep oracle
oracle   tnslsnr    6591  9  stream /var/tmp/.oracle/sEXTPROC
oracle   tnslsnr    6591  10 stream /var/tmp/.oracle/s#6591.1
oracle   tnslsnr    6591  11 tcp4   10.10.2.5:1521        *:*
oracle   oracle     6546  12 udp4   127.0.0.1:49371       *:*
oracle   oracle     6546  13 tcp4   *:49161               *:*
oracle   oracle     6544  12 udp4   127.0.0.1:49369       *:*
oracle   oracle     6528  12 udp4   127.0.0.1:49363       *:*

To start Oracle at boot time, create /usr/local/etc/rc.d/oracle.sh like this.

#!/bin/sh
case "$1" in
  start)
    echo -n ' oracle '
    su -l oracle -c 'dbstart; exec tnslsnr' &
    ;;
  stop)
    echo -n ' oracle '
    su -l oracle -c 'killall tnslsnr; exec dbshut' &
    sleep 10
    ;;
  *)
    echo >&2 "usage: $0 start|stop"
    ;;
esac

Make it executable.

bsd5# chmod +x /usr/local/etc/rc.d/oracle.sh