tux-debianwww.palmix.orgtux-debian


  HOME  TUTORIALS  ARTICLES  DOWNLOADS  LINKS  ITALIANO

 
Installing Oracle 10g on Debian Linux
by Francesco Palmisano

oracle&debian


Oracle database server is easy to install on RedHat or Suse, but not so in others Linux ditro.
Here let's see how to install with no errors Oracle 10g on Debian/GNU Linux.
This tutorial is good for 32 bit and 64 bit.

Pre installation:

First control to have installed these packages:

gcc
make
binutils
libmotif3
lesstif2
rpm
libaio1
libdb3
libstdc++5

and for 64 bit also these:

ia32-libs
libc6-dev-i386
libc6-dev

Now create some symbolic link:

ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename
ln -s /etc /etc/rc.d

If you don't have done, download Oracle 10g server installere here for 32bit and here for 64bit.
It's a zipped file about 670Mib, unzip it:

unzip <name_file>

it will be created a directory called database.
To install and use Oracle, you need to create some groups and users, so as root give these commands:

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd nobody
/usr/sbin/useradd -m -g oinstall -G dba -p passwd -d /home/oracle oracle
/usr/sbin/useradd -g nobody nobody

and create also these directory:

mkdir -p /u01/app/oracle
mkdir -p /u02/oradata

and theirs rights:

chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02



Kernel parameters:

You need to set sone systems and kernel parameters for a correct use of Oracle database server; for this reason edit /etc/sysctl.conf file and add (or modify)these rows:

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

and then give the command:

/sbin/sysctl -p

to reload parameters. Edit also /etc/security/limits.conf, adding:

* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

and /etc/pam.d/login and /etc/pam.d/su adding (or uncomment):

session required /lib/security/pam_limits.so

Enviroment variables:

Now login as oracle user:

su oracle; cd

and edit .profile file adding (or uncomment):

umask 022

edit also .bashrc adding these rows:

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=ora10g
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Installing:

Now as oracle user enter in databese directory and start the installation of Oracle 10g:

./runInstaller -ignoreSysPrereqs

Follow the installation wizard and complete the installation.

Post installation:

Edit, as root, /etc/oratab file and modify row:

ora10g:/u01/app/oracle/product/10.2.0/db_1:N

like

ora10g:/u01/app/oracle/product/10.2.0/db_1:Y

edit also the scripts in /u01/app/oracle/product/10.2.0/db_1/bin directory: dbstart and dbshut
Modify row:

ORATAB=/var/opt/oracle/oratab

like

ORATAB=/etc/oratab

Auto starting Oracle 10g server:

If you want to start Oracle server on PC boot, edit, as root, a new file called oracle and save it in /etc/init.d with this content:

#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance


ORA_HOME="/u01/app/oracle/product/10.2.0/db_1"
ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
        echo "Oracle startup: cannot start"
        exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/dbstart $ORA_HOME"
        su oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start"

        #Optional : for Enterprise Manager software only
        su oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/emctl start dbconsole"

        touch /var/lock/oracle
        echo "OK"
        ;;
    stop)
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "

        #Optional : for Enterprise Manager software only
        su oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/emctl stop dbconsole"

        su oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl stop"
        su oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/dbshut $ORA_HOME"
        rm -f /var/lock/oracle
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
esac
exit 0

then give the command:

updatate-rc oracle default 99

Good that all.
Enjoy your Oracle 10g server!



back on topback to tutorials