Oracle 9i release 2 (9.2.0.1.0) installation on Red Hat Linux 8.0

From Oracle FAQ
Jump to: navigation, search

Step-by-step installation guide for Oracle 9i release 2 (9.2.0.1.0) database on RedHat linux 8.0.

Please note that oracle 9i release 2 is not certified to run on RedHat 8.0, so you should not use this combination on a production server. You can examine Oracle certification matrix at Metalink .

Changing kernel parameters[edit]

To change the kernel parameters login as root and type:

[root@marvin]# echo 250 32000 100 128 > /proc/sys/kernel/sem
[root@marvin]# echo 2147483648 > /proc/sys/kernel/shmmax
[root@marvin]# echo 4096 > /proc/sys/kernel/shmmni
[root@marvin]# echo 2097152 > /proc/sys/kernel/shmall

In earlier versions of oracle server on linux I never bothered to change these parameters because the default values were good enough. This time I ended up with ORA-27123: unable to attach to shared memory segment when running dbca. At first I thought that I don't have enough RAM installed (256M), but after changing these parameters I was able to create the database.

You can write a script to initialize these parameters during system startup. I put these lines in the script that starts oracle database.

Creating users and groups[edit]

Create user oracle and dependent groups that will own oracle software. In this example we'll name the user 'ora9':

[root@marvin]# groupadd oinstall
[root@marvin]# groupadd dba
[root@marvin]# useradd -g oinstall -G dba ora9
[root@marvin]# passwd ora9

Create directories in which oracle software will be installed. Oracle recommends OFA - Optimal Flexible Architecture (see oracle installation guide), but in this example everything will be installed under /home/ora9:

[root@marvin]# mkdir -p /home/ora9/product/9.2
[root@marvin]# chown -R ora9.oinstall /home/ora9/*
[root@marvin]# mkdir /var/opt/oracle
[root@marvin]# chown ora9.dba /var/opt/oracle

Login as user oracle and put the following lines at the end of your .bashrc:

#oracle 9i
export ORACLE_HOME=/home/ora9/product/9.2
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH 
#
# change this NLS settings to suit your country:
# example:
# german_germany.we8iso8859p15, american_america.we8iso8859p2 etc.
#
export NLS_LANG='croatian_croatia.ee8iso8859p2'

Since I am from Croatia, I use Croatian national language support (NLS_LANG, NLS_DATE_LANGUAGE, NLS_SORT and NLS_DATE_FORMAT). You should set these variables to suit your needs.

Listing of valid Oracle NLS Data parameters including supported languages, territories and storage character sets can be found here. Execute .bashrc in order to initialize these variables:

[ora9@marvin]$ source /home/ora9/.bashrc

or just log off and than back on as user oracle.

If you use some shell other than bash (tcsh, sh, ...) these variables should be set according to syntax of your shell and put in script that automatically executes at user login.

Unpacking downloaded installation files[edit]

If you downloaded oracle software from technet, you have three files: lnx_920_disk1.cpio.gz, lnx_920_disk2.cpio.gz and lnx_920_disk3.cpio.gz. First run

[ora9@marvin]$ gunzip lnx_920*.cpio.gz

and then

[ora9@marvin]$ cpio -idmv<lnx_920_disk1.cpio
[ora9@marvin]$ cpio -idmv<lnx_920_disk2.cpio
[ora9@marvin]$ cpio -idmv<lnx_920_disk3.cpio

Running the installer[edit]

Oracle installer MUST be run from Xwindows. Login as user oracle, start Xwindows and from terminal window and start the installer:

$ /wherever/you/unpacked/it/Disk1/runInstaller

or (if you have the CD set):

$ /mnt/cdrom/runInstaller

If you install oracle from CD, do not change directory to CD-ROM and run installer from there because later you will not be able to unmount the first CD.

During the linking of oracle software you'll get the following error - view snapshot (new window):

Error in invoking target install of makefile $ORACLE_HOME/ctx/lib/ins_ctx.mk

At this point leave the error window up and open new terminal window. Then do

[ora9@marvin]$ cd $ORACLE_HOME/install
[ora9@marvin]$ tail make.log

You will see that the last gcc line that failed looks like this: (your path values may be different)

gcc -o ctxhx -L/home/ora9/product/9.2/ctx/lib/ -L/home/ora9/product/9.2/lib/ -L/home/ora9/product/9.2/lib/stubs/ /home/ora9/product/9.2/ctx/lib/ctxhx.o -L/home/ora9/product/9.2/ctx/lib/ -lm -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut -lsc_ch -lsc_fi -lctxhx -lc -Wl,-rpath,/home/ora9/product/9.2/ctx/lib -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9

Copy this line, add -ldl at the end of line and run it in $ORACLE_HOME/bin:

[ora9@marvin]$ cd $ORACLE_HOME/bin
[ora9@marvin]$ gcc -o ctxhx -L/home/ora9/product/9.2/ctx/lib/ -L/home/ora9/product/9.2/lib/ -L/home/ora9/product/9.2/lib/stubs/ /home/ora9/product/9.2/ctx/lib/ctxhx.o -L/home/ora9/product/9.2/ctx/lib/ -lm -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut -lsc_ch -lsc_fi -lctxhx -lc -Wl,-rpath,/home/ora9/product/9.2/ctx/lib -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 -ldl

Now you can hit ignore button on error message window and installation should continue without problems.

If you need to relink oracle later using oracle relink utility (e.g. after applying a patch from oracle), you will have to edit $ORACLE_HOME/ctx/lib/env_ctx.mk first. Open the file in your favorite editor, search for line that starts with 'INSO_LINK' (line Number 1365). The line should look like this:

INSO_LINK = -L$(CTXLIB) $(LDLIBFLAG)m $(LDLIBFLAG)sc_ca $(LDLIBFLAG)sc_fa $(LDLIBFLAG)sc_ex $(LDLIBFLAG)sc_da $(LDLIBFLAG)sc_ut $(LDLIBFLAG)sc_ch $(LDLIBFLAG)sc_fi $(LLIBCTXHX) $(LDLIBFLAG)c -Wl,-rpath,$(CTXHOME)lib $(CORELIBS) $(COMPEOBJS) 

Again, put -ldl at the end of that line and save the file. Now you will be able to 'relink all' if you need to.

Starting the database for the first time[edit]

Starting the database[edit]

In .bashrc (if you use bash shell) for user oracle add variable ORACLE_SID=your_sid_name. I named my instance ora9, so my line looks like this:

export ORACLE_SID=ora9

Initialize this variable for current session:

[ora9@marvin]$ export ORACLE_SID=ora9

Edit /etc/oratab and make sure that it contains the following line:

ora9:/home/ora9/product/9.2:Y

You should replace the first 'ora9' (SID) with the name of your instance and change the last argument from 'N' to 'Y'

Start oracle TNS listener and Apache http server:

[ora9@marvin]$ lsnrctl start
[ora9@marvin]$ apachectl start

Let's start the database now:

[ora9@marvin]$ dbstart

Or you can do it the other way:

[ora9@marvin]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on Mon Mar 17 20:51:08 2003

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved. 

SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  168890408 bytes
Fixed Size                   450600 bytes
Variable Size             100663296 bytes
Database Buffers           67108864 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> select sysdate from dual;

SYSDATE
---------
17-MAR-03

SQL> exit
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
[ora9@marvin]$

Shutting down the database[edit]

First we'll shut down TNS listener and Apache:

[ora9@marvin]$ lsnrctl stop
[ora9@marvin]$ apachectl stop

To shut down the database use:

[ora9@marvin]$ dbshut

or through the SQL*PLUS:

[ora9@marvin]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on Mon Mar 17 20:54:49 2003

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
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
[ora9@marvin]$

Automating oracle startup and shutdown[edit]

To automatically start/shut oracle database during system startup/shutdown you need to write a script in /etc/rc.d/init.d directory. You can view this script as an example. Make sure that your script is in /etc/rc.d/init.d/ directory, owned by root, and that it has exec permission set. Next, you should put the links to this script in runlevel in which you want oracle so start or stop. Yo can also do it via GUI tool (e.g. ksysv, a part of KDE) For example, I named my script ora9, and I want oracle to start in runlevel 5, and to shut down when system goes to halt (runlevel 0) or reboot (runlevel 6):

[root@marvin]# ln -s /etc/rc.d/init.d/ora9 /etc/rc.d/rc5.d/S80ora9
[root@marvin]# ln -s /etc/rc.d/init.d/ora9 /etc/rc.d/rc0.d/K06ora9
[root@marvin]# ln -s /etc/rc.d/init.d/ora9 /etc/rc.d/rc6.d/K06ora9

[More info] on SysV init can be found on [The Linux Docummentation Project] site.


Republished with permission from Denis Klaric. Original URL: http://staff.in2.hr/denis/oracle/92install_rh80_en.html