tomclegg.net |
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 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 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 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 bsd5# cd /usr/oracle/etc bsd5# cp -i oratab oraInst.loc /etc Change 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 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 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 bsd5# cat <<EOF >>/etc/services oraclelistener 1521/tcp oraclelistenerssl 2484/tcp EOF Copy 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 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 #!/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 |