old-www/HOWTO/html_single/Oracle-9i-Fedora-3-Install-.../index.html

1362 lines
22 KiB
HTML
Raw Permalink Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Oracle 9i under Fedora Core 3 - Installation HOWTO</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
><BODY
CLASS="article"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="ARTICLE"
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
><A
NAME="AEN2"
></A
>Oracle 9i under Fedora Core 3 - Installation HOWTO</H1
><H3
CLASS="author"
><A
NAME="AEN4"
>Gaurav Prasad</A
></H3
><DIV
CLASS="affiliation"
><DIV
CLASS="address"
><P
CLASS="address"
><br>
<TT
CLASS="email"
>&#60;<A
HREF="mailto:gauravpd at gmail dot com"
>gauravpd at gmail dot com</A
>&#62;</TT
><br>
</P
></DIV
></DIV
><P
CLASS="pubdate"
>2005-06-27<BR></P
><DIV
CLASS="revhistory"
><TABLE
WIDTH="100%"
BORDER="0"
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
COLSPAN="3"
><B
>Revision History</B
></TH
></TR
><TR
><TD
ALIGN="LEFT"
>Revision v1.0</TD
><TD
ALIGN="LEFT"
>2005-06-22</TD
><TD
ALIGN="LEFT"
>Revised by: MG</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>For inclusion in TLDP: Completed XML article structure with articleinfo, section IDs for cross-referencing; technical, language, grammar and spelling review.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision v1.0-pre1</TD
><TD
ALIGN="LEFT"
>2005-04-01</TD
><TD
ALIGN="LEFT"
>Revised by: GP</TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>Added miscellaneous errors section.</TD
></TR
><TR
><TD
ALIGN="LEFT"
>Revision v0.1</TD
><TD
ALIGN="LEFT"
>2005-03-25</TD
><TD
ALIGN="LEFT"
></TD
></TR
><TR
><TD
ALIGN="LEFT"
COLSPAN="3"
>First publication.</TD
></TR
></TABLE
></DIV
><DIV
><DIV
CLASS="abstract"
><A
NAME="AEN26"
></A
><P
></P
><P
>This tutorial describes how to install Oracle 9i on Fedora Core 3 or greater.</P
><P
></P
></DIV
></DIV
><HR></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>1. <A
HREF="#sect_01"
>1. Introduction</A
></DT
><DD
><DL
><DT
>1.1. <A
HREF="#sect_01_01"
>What you need to know</A
></DT
><DT
>1.2. <A
HREF="#sect_01_02"
>Acknowledgments</A
></DT
><DT
>1.3. <A
HREF="#sect_01_03"
>Availability and Feedback</A
></DT
><DT
>1.4. <A
HREF="#sect_01_04"
>Licensing Information and Liability</A
></DT
></DL
></DD
><DT
>2. <A
HREF="#sect_02"
>Get Oracle 9i</A
></DT
><DD
><DL
><DT
>2.1. <A
HREF="#sect_02_01"
>CD Installation</A
></DT
><DT
>2.2. <A
HREF="#sect_02_02"
>Download</A
></DT
><DT
>2.3. <A
HREF="#sect_02_03"
>Install</A
></DT
></DL
></DD
><DT
>3. <A
HREF="#sect_03"
>Prepare for Configuration</A
></DT
><DD
><DL
><DT
>3.1. <A
HREF="#sect_03_01"
>Create Users and Groups</A
></DT
><DT
>3.2. <A
HREF="#sect_03_02"
>Create Directories</A
></DT
></DL
></DD
><DT
>4. <A
HREF="#sect_04"
>Set Environment Variables</A
></DT
><DT
>5. <A
HREF="#sect_05"
>Set Kernel Parameters</A
></DT
><DD
><DL
><DT
>5.1. <A
HREF="#sect_05_01"
>Edit /etc/sysctl.conf</A
></DT
><DT
>5.2. <A
HREF="#sect_05_02"
>Edit /etc/security/limits.conf</A
></DT
></DL
></DD
><DT
>6. <A
HREF="#sect_06"
>Install GCC 2.9 Compat libraries</A
></DT
><DD
><DL
><DT
>6.1. <A
HREF="#sect_06_01"
>Install GCC 2.96 Compat packages</A
></DT
><DT
>6.2. <A
HREF="#sect_06_02"
>Create symbolic links</A
></DT
></DL
></DD
><DT
>7. <A
HREF="#sect_07"
>Run Installer</A
></DT
><DD
><DL
><DT
>7.1. <A
HREF="#sect_07_01"
>Apply the libwait.c patch</A
></DT
><DT
>7.2. <A
HREF="#sect_07_02"
>Configure the Display</A
></DT
><DT
>7.3. <A
HREF="#sect_07_03"
>Start the Installation</A
></DT
><DT
>7.4. <A
HREF="#sect_07_04"
>Fix nodeinfo</A
></DT
></DL
></DD
><DT
>8. <A
HREF="#sect_08"
>Create a Startup Script</A
></DT
><DT
>9. <A
HREF="#sect_09"
>Miscellaneous Errors</A
></DT
></DL
></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="sect_01"
></A
>1. 1. Introduction</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_01_01"
></A
>1.1. What you need to know</H2
><P
>This tutorial was written due to my frustration on installing Oracle 9i on FC3. Basically 9i installation on RAS 1,2,3 RH 9, FC1, FC2 is documented fairly well but it is hard to find anything worthwhile on FC3; some people even suggested that installing Oracle 9i on FC3 is not possible. This HOWTO attempts to condense all my experience and findings with any such info peculiar to FC3, which was before scattered all over the web, into one concise but useful document.</P
><P
>I hope you will find this short tutorial useful.</P
><P
>If you need to install Oracle 9i on FC3, you should be aware of the following facts:</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Fedora is not *Officially Supported* by Oracle Corp.</P
></LI
><LI
><P
>Oracle 9i installation is difficult but possible on FC3.</P
></LI
><LI
><P
>Oracle 9i CANNOT be linked with the libraries used by gcc 3.4. On FC3 you need to use the FC2 GCC compat libraries.</P
></LI
><LI
><P
>The Oracle 10 G installation method does NOT WORKS with 9i.</P
></LI
><LI
><P
>This HOWTO deals with RedHat products &#62;= FC3 or higher or gcc version greater than 2.9. If you are installing any other RedHat product you might want to have a look at other excellent tutorials, for instance <A
HREF="http://www.puschitz.com/OracleOnLinux.shtml"
TARGET="_top"
>http://www.puschitz.com/OracleOnLinux.shtml</A
> and <A
HREF="http://oracle-base.com/"
TARGET="_top"
>http://oracle-base.com/</A
>.</P
></LI
></OL
><P
>Also keep in mind: </P
><P
></P
><OL
TYPE="1"
><LI
><P
>This HOWTO aims only to assist you. This is not an OFFICIAL Oracle document.</P
></LI
><LI
><P
>I am not a DBA. Please do not contact me for matters other than the content of this document. I will not help you to set up your database. If you need help with that, check the Oracle forums.</P
></LI
><LI
><P
>The next step for me is probably to write some Bash or Perl
scripts to fully automate this tedious and boring, frustrating,
manual process but that depends on spare time I get. Your ideas are welcome.</P
></LI
></OL
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_01_02"
></A
>1.2. Acknowledgments</H2
><P
>I would like to thank Jean Fran<61>ois for helping me out with the most
tricky parts.</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_01_03"
></A
>1.3. Availability and Feedback</H2
><P
>The latest version can be found at <A
HREF="http://www.pagux.com/oracle9ionfedora3.html"
TARGET="_top"
>http://www.pagux.com/oracle9ionfedora3.html</A
>.</P
><P
>I rely on you, the reader, to make this HOWTO useful. If you have
any suggestions, corrections or comments, please send them to me and I will try to incorporate them in the next revision.</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_01_04"
></A
>1.4. Licensing Information and Liability</H2
><P
>Copyright 2005 Gaurav Prasad</P
><P
>This HOWTO is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. A copy of the license is available at <A
HREF="http://www.gnu.org/copyleft/fdl.html"
TARGET="_top"
>http://www.gnu.org/copyleft/fdl.html</A
>.</P
><P
>This document is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. No liability for the contents of this document can be accepted.
Use the concepts, examples and information at your own risk.
There may be errors and inaccuracies, that could be damaging to
your system. Proceed with caution, and although accidents are highly
unlikely, the author(s) do not take any responsibility.
</P
><P
>Linux is a registered trademark of Linus Torvalds.</P
><P
>&#13;All copyrights are held by their by their respective owners,
unless specifically noted otherwise. Use of a term in this
document should not be regarded as affecting the validity of any
trademark or service mark. Naming of particular products or
brands should not be seen as endorsements.
</P
></DIV
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_02"
></A
>2. Get Oracle 9i</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_02_01"
></A
>2.1. CD Installation</H2
><P
>If you got Oracle 9i on a CD then mount it:</P
><P
><B
CLASS="command"
>mount <TT
CLASS="option"
>-r -o loop=/dev/loop0</TT
> <TT
CLASS="filename"
>ora9id1.iso Disk1/</TT
></B
> </P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_02_02"
></A
>2.2. Download</H2
><P
>Otherwise download it from <A
HREF="http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxsoft.html"
TARGET="_top"
>http://www.oracle.com/technology/software/products/oracle9i/htdocs/linuxsoft.html</A
>.</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_02_03"
></A
>2.3. Install</H2
><P
>Extract all three files:</P
><P
><B
CLASS="command"
>gunzip <TT
CLASS="filename"
>ship_9204_linux_disk1.cpio.gz</TT
></B
> </P
><P
><B
CLASS="command"
>cpio <TT
CLASS="option"
>-idmv -I</TT
> <TT
CLASS="filename"
>ship_9204_linux_disk1.cpio</TT
></B
> </P
><P
>Don't forget the <TT
CLASS="option"
>-I</TT
> option or you will get errors during the extraction.</P
><P
>This command will expand the cpio archive to the <TT
CLASS="filename"
>Disk1</TT
> directory. Repeat the process for the other two archives.</P
></DIV
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_03"
></A
>3. Prepare for Configuration</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_03_01"
></A
>3.1. Create Users and Groups</H2
><P
>Execute the following commands as <EM
>root</EM
>:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;# groupadd oinstall
# groupadd dba
# groupadd oper
# groupadd apache
# useradd -g oinstall -G dba oracle
# passwd oracle
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Set the password for user <EM
>oracle</EM
>.</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_03_02"
></A
>3.2. Create Directories</H2
><P
>The final destination of the software will be here:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;# mkdir /u01 /u02
# chown oracle.dba /u01 /u02
# chmod 755 /u01 /u02
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_04"
></A
>4. Set Environment Variables</H1
><P
>Log in as the <EM
>oracle</EM
> user:</P
><P
><B
CLASS="command"
>su <TT
CLASS="option"
>-</TT
> <TT
CLASS="parameter"
><I
>oracle</I
></TT
></B
> </P
><P
>Edit <TT
CLASS="filename"
>.bash_profile</TT
> in <EM
>oracle</EM
>'s home directory and add the following, for instance using <B
CLASS="command"
>vim</B
>:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;########## Oracle Variables ##########
echo " Welcome to oracle";
ORACLE_BASE=/u01/app/oracle
ORACLE_OWNER=oracle; export ORACLE_OWNER
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_HOME=/u01/app/oracle/product/9.2.0.1.0
ORACLE_SID=ORTD
LD_PRELOAD=$HOME/libcwait.so
export DISPLAY=172.28.66.39:0.0
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/network/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH
LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL
THREADS_FLAG=native; export THREADS_FLAG
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_PRELOAD
########## End of Oracle variables ##########
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_05"
></A
>5. Set Kernel Parameters</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_05_01"
></A
>5.1. Edit /etc/sysctl.conf</H2
><P
>Add the following lines to the <TT
CLASS="filename"
>/etc/sysctl.conf</TT
> file:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;kernel.shmmax = 2147483648
kernel.shmmni = 128
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_05_02"
></A
>5.2. Edit /etc/security/limits.conf</H2
><P
>Additionally the following lines can be added to the <TT
CLASS="filename"
>/etc/security/limits.conf</TT
> file:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Adding lines into these files requires a reboot before the new settings
take effect.</P
></DIV
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_06"
></A
>6. Install GCC 2.9 Compat libraries</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_06_01"
></A
>6.1. Install GCC 2.96 Compat packages</H2
><P
>From Fedora Core TWO:</P
><P
></P
><UL
><LI
><P
><TT
CLASS="filename"
>compat-libstdc++-7.3-2.96.126.i386.rpm</TT
></P
></LI
><LI
><P
><TT
CLASS="filename"
>compat-libstdc++-devel-7.3-2.96.126.i386.rpm</TT
></P
></LI
><LI
><P
><TT
CLASS="filename"
>compat-gcc-7.3-2.96.126.i386.rpm</TT
></P
></LI
><LI
><P
><TT
CLASS="filename"
>compat-gcc-c++-7.3-2.96.126.i386.rpm</TT
></P
></LI
></UL
><DIV
CLASS="caution"
><P
></P
><TABLE
CLASS="caution"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/caution.gif"
HSPACE="5"
ALT="Caution"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>Don't overwrite existing packages</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Make sure that you keep your existing GCC installation, or a large part of your software will not work or can not be compiled any more. In case these packages are already installed on your system with newer version numbers, use <B
CLASS="command"
>rpm <TT
CLASS="option"
>-i --force</TT
></B
> to install the older ones next to the newer ones.</P
></TD
></TR
></TABLE
></DIV
><P
>From the Fedora Core THREE subtree, get the <SPAN
CLASS="application"
>compat-db</SPAN
> package.</P
><P
>If you don't install GCC compat libraries as above you get
a zillion linking errors.</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_06_02"
></A
>6.2. Create symbolic links</H2
><P
>Put gcc296 and g++296 first in
your $PATH variable by creating the following symbolic links:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;# mv /usr/bin/gcc /usr/bin/gcc323
# mv /usr/bin/g++ /usr/bin/g++323
# ln -s /usr/bin/gcc296 /usr/bin/gcc
# ln -s /usr/bin/g++296 /usr/bin/g++
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Note that should you already have upgraded your system, GCC versions might be different.</P
></DIV
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_07"
></A
>7. Run Installer</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="sect_07_01"
></A
>7.1. Apply the libwait.c patch</H2
><P
>Before running the installer, do the following in order to overcome some weird errors:</P
><P
></P
><UL
><LI
><P
>In <TT
CLASS="filename"
>/home/oracle</TT
>,create a file name <TT
CLASS="filename"
>libwait.c</TT
> and as described below and compile it :</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>Ceate a file called libcwait.c in the
oracle
user's home directory to avoid getting
an error when running the Oracle installer. The libcwait.c file should contain the
following text:
/*
gcc -O2 -shared -o $HOME/libcwait.so -fpic $HOME/libcwait.c
*/
#include
#include
#include
Deploying Oracle 9i on Red Hat Enterprise Linux AS 3
Page 11
#include
pid_t
__libc_wait (int *status)
{
int res;
asm volatile ("pushl %%ebx\n\t"
"movl %2, %%ebx\n\t"
"movl %1, %%eax\n\t"
"int $0x80\n\t"
"popl %%ebx"
: "=a" (res)
: "i" (__NR_wait4), "0" (WAIT_ANY), "c" (status), "d" (0), "S" (0));
return res;
}
Next, compile this file in the
oracle
user's home directory by executing the
following command:
gcc -02 -shared -o $HOME/libcwait.so -fpic $HOME/libwait.c
</PRE
></FONT
></TD
></TR
></TABLE
><P
><B
CLASS="command"
>gcc <TT
CLASS="option"
>-shared -o</TT
> <TT
CLASS="filename"
>libcwait.so libcwait.c</TT
> <TT
CLASS="option"
>-fpic -O</TT
></B
> </P
></LI
><LI
><P
>Then add this library to the environment of the database user:</P
><P
><B
CLASS="command"
>export <TT
CLASS="varname"
>LD_PRELOAD</TT
>=<TT
CLASS="filename"
>/home/oracle/libcwait.so</TT
></B
> </P
><P
>Earlier, we put a similar line in <TT
CLASS="filename"
>.bash_profile</TT
>.</P
></LI
></UL
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_07_02"
></A
>7.2. Configure the Display</H2
><P
>Execute the following commands as oracle User :</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;oracle@9iserver ~&#62; xhost +localhost
oracle@9iserver ~&#62; export DISPLAY=localhost:0.0
</PRE
></FONT
></TD
></TR
></TABLE
><P
>You can now connect to your desktop or optionally run the installation remotely, for instance using <SPAN
CLASS="application"
>VNC</SPAN
>.for instance running the installer from your Windows desktop
</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_07_03"
></A
>7.3. Start the Installation</H2
><P
>Start the graphical installation application:</P
><P
><B
CLASS="command"
>/path/to/oracle/Disk1/runInstaller</B
> </P
><P
>Now carry with Graphical setup (if you are not sure choose Standard database). From here the rest of the installation process is obvious.</P
></DIV
><DIV
CLASS="sect2"
><HR><H2
CLASS="sect2"
><A
NAME="sect_07_04"
></A
>7.4. Fix nodeinfo</H2
><P
>Now installation should proceed without any linking errors but you will get one error in the end:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;Parameter "nodeinfo" = NO_VALUE
Agent Service Failed
</PRE
></FONT
></TD
></TR
></TABLE
><P
>In order to fix this, run the following for starting the wizard after setup has finished:</P
><P
><B
CLASS="command"
>netca &#38;</B
> </P
><P
>Now change into <TT
CLASS="varname"
>$ORACLE_HOME</TT
> and run <B
CLASS="command"
>./lsnrctl <TT
CLASS="parameter"
><I
>start</I
></TT
></B
>.</P
><P
>Check that the process is running:</P
><P
><B
CLASS="command"
>ps <TT
CLASS="option"
>afx</TT
> | grep <TT
CLASS="parameter"
><I
>LISTEN</I
></TT
></B
> </P
></DIV
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_08"
></A
>8. Create a Startup Script</H1
><P
>In order for the Oracle server to start automatically at system boot time, create the file <TT
CLASS="filename"
>/etc/init.d/oracle</TT
> like this:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;#!/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/9.2.0.1.0"
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 - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Now run <B
CLASS="command"
>chkconfig <TT
CLASS="filename"
>oracle</TT
></B
> for updating the run level information.</P
><P
>Try <B
CLASS="command"
>service <TT
CLASS="parameter"
><I
>oracle start|stop|restart</I
></TT
></B
> to check that everything works as expected now.</P
><P
>If you reached this step without errors: congratulations. Else, check <A
HREF="#sect_09"
>Section 9</A
> for troubleshooting suggestions.</P
></DIV
><DIV
CLASS="sect1"
><HR><H1
CLASS="sect1"
><A
NAME="sect_09"
></A
>9. Miscellaneous Errors</H1
><P
>ERROR:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
</PRE
></FONT
></TD
></TR
></TABLE
><P
>This error happens when you reboot and try to login. You will get lots of errors when the database instance is not mounted/started automatically.</P
><P
>Solution:</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Check <TT
CLASS="filename"
>/etc/oratab</TT
> and make sure that <TT
CLASS="option"
>*:/opt/oracle/OraHome1</TT
> and <TT
CLASS="option"
>ordb:/opt/oracle/OraHome1</TT
> are set to <SPAN
CLASS="QUOTE"
>"Y"</SPAN
> (YES).</P
></LI
><LI
><P
>Try to initialize the database: <B
CLASS="command"
>$ORACLE_HOME/bin/dbstart</B
>.</P
></LI
></OL
><P
>ERROR:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;No start entry for SID * at /opt/oracle/OraHome1 in /etc/oratab
</PRE
></FONT
></TD
></TR
></TABLE
><P
>This might be caused by a bug in the dbstart script which searches for the sid file in the wrong place.</P
><P
>Solution:</P
><P
></P
><OL
TYPE="1"
><LI
><P
><B
CLASS="command"
>cp <TT
CLASS="filename"
>$ORACLE_BASE/admin/$ORACLE_SID/pfile/init_*.ora</TT
></B
> \</P
><P
><TT
CLASS="filename"
>$ORACLE_HOME/dbs/init$ORACLE_SID.ora</TT
></P
></LI
><LI
><P
>As user <EM
>oracle</EM
>:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;$ sqlplus
SQL&#62; create pfile from spfile;
SQL&#62; exit
</PRE
></FONT
></TD
></TR
></TABLE
></LI
><LI
><P
>Run the <TT
CLASS="filename"
>dbstart</TT
> script: <B
CLASS="command"
>$ORACLE_HOME/bin/dbstart</B
>.</P
></LI
></OL
></DIV
></DIV
></BODY
></HTML
>