Linux Oracle HOWTO

Linux Oracle HOWTO

Install Oracle 8.0.5 for Linux on FreeBSD 3.1, step by step, Mon Feb 22 18:22:27 CET 1999

Part 0 (damn, those romans knew no zero): Introduction

This guide describes how to install Oracle 8.0.5 for Linux on FreeBSD 3.1.

Open issues:
- compiling perl DBD/DBI interface
- re-linking the Oracle database (done by orainst)

Other quite interesting informations can be found at:
-, thanks to
  for this pointer
  seems to be the original source for this.
  some hints on Oracle/SCO for FreeBSD (some parts russian, *sigh*)
  As SCO/Oracle is available from as well,
  this might be an interesting way.

Disk space requirements: approx. 1 GB disk space for light usage.
For testing purposes, approx. 820 MB seem to be sufficient.
Q: Why so much diskspace ?
A: Oracle needs a copy of the tape/cd-rom somewhere read-writeable
   in the filesystem (so-called staging area). This needs approx. 400 MB.

We assume the following environment variables:

	export ORACLE_OWNER=oracle

The userid that owns the binaries and the datasets.


Some sort of uniq database name. Given this, you can
have multiple databases on the same machine.

	export ORACLE_HOME=/usr/local/oracle

Where the binaries are located. There's a suggestion from
Oracle on filesystem layout called "Optimal Flexible Architecture" (OFA).
OFA is described in detail in Chapter 1 of the Oracle8 Administrator's
Reference for LINUX. 

	export ORACLE_TERM=xterm

The terminal type we need to run the installation script.
The installation script (orainst), runs on curses. Your mileage may vary.
[comment: setting "stty intr '^c' erase '^?'" in your .profile might
be useful, as well. orainst is picky on the erase character]

You can add those variables to your .bashrc (for every account that
will work with oracle!). Add /usr/local/oracle/bin to your $PATH,
if you do not want to type the whole path 8-)

Part I: How to install all this ?

- Install FreeBSD 3.1 on a new machine, including the ports collection

- provide approx 1 GB of diskspace in the filesystem where Oracle
  will reside (approx. 500 MB for the installation, more
  if you need a copy of oracle (approx. 400 MB) in the staging area)

As root:

- Edit /etc/rc.conf and add:

- Kernel configuration, add those parameters:

  o section for shared memory:

  options         SHMALL=4097
  options         SHMMAXPGS=4097
  options         "SHMMAX=(SHMMAXPGS*PAGE_SIZE+1)"

  o section for semaphores (values work, oracle needs approx. 100 semaphores)
    I do not understand the criterias for "correct" values here. They just
    have to be large enough

  options         SEMMAP=255
  options         SEMMNI=235
  options         SEMMNS=255
  options         SEMMNU=235 
  options         SEMMSL=255
  options         SEMOPM=201 
  options         SEMUME=201 

- compile the kernel, reboot

- Install the linux emu
  umask 022
  cd /usr/ports/emulators/linux
  make all install

- Add a unix group "dba" to /etc/group, like this:

- Add a unix user "oracle" to /etc/passwd, like this:
  oracle:somepassword:82:82::0:0:Oracle Owner:/home/oracle:/bin/bash

- create the oracle destination directory
  mkdir -p /usr/local/oracle/etc
  echo WHATEVER:/usr/local/oracle:Y >/usr/local/oracle/etc/oratab
  ln -s /usr/local/oracle/etc/oratab /etc/oratab
  chown -R oracle.dba /usr/local/oracle

- get yourself the large tar file, e.g.

- now continue as user oracle (not root)

- unpack the distribution
  mkdir ~/somedir
  cd ~/somedir
  tar xfvz somewhereelse/805ship.tgz

- start the orainst script
  cd ~/somedir/orainst

- Now some comments on the following "dirty" part.
  orainst tries to re-link the applications, even while the tgz files
  provides all of them in (working) binary form.
  I do not know whether the installation is incomplete if the linking
  phase fails, so at the end is an appendix on how to get over the
  linking. See the appendix for details.
  Otherwise, you probably can work with installating,
  ignoring the linking errors and copy the pre-linked binaries into
  place. See below for details.

- First, we have to answer quite a few questions to orainst:
  step through orainst, using OK or the selection given below:

  o Custom Install (otherwise no 8bit character sets)
  o Install, Upgrade or De-Install Software
  o Install New Product - Do not Create DB Objects
  o Mount point: /usr/local/oracle
  o ORACLE_HOME location "/usr/local/oracle/app/oracle/product/": 8.0.5
  o Environment Variables:
    * ORACLE_BASE: /usr/local/oracle
    * ORACLE_HOME: /usr/local/oracle
  o Install Log: just keep the values
  o Install from: Staging Area (I had errors when I ran from the CD mount)
  o Enter Pathname of source staging:
    Enter the path to ~/somedir, in my case:
  o Select native language: All Languages
  o Select all sw-products im Software Asset Manager
  o select group to act as DBA: dba
  o select the OSOPER Group: dba
  o Choose JDBC Components: select all
  o Pathname for ORACLE_DOC: /usr/local/oracle/doc
  o Formats of Dokumentation: html

- now orainst starts to copy lots of files around.
  sometimes it will complain about software not being linked
  or some make command that failed.
  Ignore those.

- After it installed all files, it will return you to the
  Software Asset Manager. Leave it. It will complain that
  some commands fail. Ignore this (untested).
  At the end, it should have created an $ORACLE_HOME/orainst/
- Copy the pre-compiled binaries from somedir/bin:

  cp ~/somedir/bin/* $ORACLE_HOME/bin/

- Fix orainst/
< #!/usr/bin/sh
> #!/bin/bash
< CHOWN=/bin/chown
> CHOWN=/usr/sbin/chown

- as root: run orainst/ 
  It will ask for a pathname to a local bin directory.
  I used "/usr/local/oracle/bin", $ORACLE_HOME/bin
  This will set some permissions (sbits for some binaries)
  Not yet checked in all detail: which ones and for what.

- You now have a working oracle setup.

Part II: How to get to the first "select" ?

Some steps to a running database:

  cp dbs/init.ora dbs/initWHATEVER.ora
  edit initWHATEVER.ora, replace DEFAULT with WHATEVER
  bin/svrmgrl			# some prompt from svrmgrl comes up
  connect internal
  create database WHATEVER character set WE8ISO8859P1;
  alter tablespace SYSTEM 
        add datafile '/usr/local/oracle/dbs/dbs2WHATEVER.dbf'
        size 10M autoextend on;
  @$ORACLE_HOME/rdbms/admin/catalog.sql		# lots of messages, some errors
  @$ORACLE_HOME/rdbms/admin/catproc.sql		# ignore those

Now you should be able to:

  sqlplus sys/manager			# connects you to the database
  select * from tab;			# which tables are available ?
  quit					# and goodbye

Appendix: Getting Oracle to link

This is really, really ugly. But it works for me.
It does not produce running binaries, but it lets orainst
end with "Result: sucess".

During orainst, the installation will report problems seven times:
- TNS Listener (this one can be ignored)
- Oracle Names
- wrap executable
- Oracle Trace
- Oracle8 Standard RDBMS
- Oracle Intelligent Agent
- SQL*Plus

For these to suceed, some changes have to be made to some
files, and the relevant command has to be used (manually).

Oracle Names:
- edit lib/sysliblist
  replace "-lnsl -lm"
  "/compat/linux/lib/ /compat/linux/lib/ /compat/linux/lib/ /compat/linux/lib/ /compat/linux/lib/ /compat/linux/lib/"
- edit network/lib/
> # EXSYSLIBS= -ldl
> # EXSYSLIBS=-ldl
< MY_TMP_FLAGS = -ldl -lc
> # MY_TMP_FLAGS = -ldl -lc
- run
  make -f names_targs

wrap executable:
- set the value of the lib/sysliblist as described before
  (apparently, it was overwritten by something ? dunno)
- edit plsql/lib/
> # EXSYSLIBS= -ldl
> # EXSYSLIBS=-ldl
- run
  make -f install

Oracle Trace:
- edit otrace/lib/
> # EXSYSLIBS= -ldl
> # EXSYSLIBS=-ldl
- run
  make -f /usr/local/oracle/otrace/lib/ install

Oracle8 Standard RDBMS:
- edit rdbms/lib/
> # EXSYSLIBS= -ldl
> # EXSYSLIBS=-ldl
> #        $(LLIBSQL) $(LLIBSQL)
- run
  make -f install

Oracle Intelligent Agent:
- edit network/lib/
> # EXSYSLIBS= -ldl
> # EXSYSLIBS=-ldl
< LIBTCL = /usr/lib/
< LLIBTCL = -ltcl
> #LIBTCL = /usr/lib/
> #LLIBTCL = -ltcl
> LIBTCL = /client/lib/libtcl.a
> LLIBTCL = /client/lib/libtcl.a
- compile tcl with a static library
  you can get tcl from
  cd /tmp/
  tar xfvz tcl8*
  cd tcl*4
  cp libtcl.a /client/lib/		# that's where I keep it
- edit network/lib/
< MY_TMP_FLAGS =-lm -ldl -lc -lcrypt
> # MY_TMP_FLAGS =-lm -ldl -lc -lcrypt
> MY_TMP_FLAGS =-lcrypt
- run
  make -f install

- edit sqlplus/lib/
> # EXSYSLIBS= -ldl
> # EXSYSLIBS=-ldl
- run
  make -f install

If you now re-run orainst, it will end with:
Result: Success.

Leave a Reply

Your email address will not be published. Required fields are marked *