Pemulung yang Berusaha Memanfaatkan Limbah Sebaik Mungkin

Jalanin Oracle 9i Di FreeBSD

Posted by kang deden pada 31 Januari, 2007

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

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.


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 - 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 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release - 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 = = 1521)) ...       (GLOBAL_DBNAME =

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        *:* oracle   oracle     6546  12 udp4       *:* oracle   oracle     6546  13 tcp4   *:49161               *:* oracle   oracle     6544  12 udp4       *:* oracle   oracle     6528  12 udp4       *:*

To start Oracle at boot time, create /usr/local/etc/rc.d/ 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/

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: