DBA Tips Archive for Oracle |
Install Oracle9i on Red Hat Linux 7.1 - 7.2
by Jeff Hunter, Sr. Database Administrator
Contents
Overview
http://otn.oracle.com/software/products/oracle9i/htdocs/linuxsoft.html
% gunzip Linux9i_Disk1.cpio.gz Linux9i_Disk2.cpio.gz Linux9i_Disk3.cpio.gz
% cpio -idmv < Linux9i_Disk1.cpio
If you used Netscape 4.x to download the files it has this horrid, evil habit
of uncompressing the files but leaving the extension the same.
% cpio -idmv < Linux9i_Disk1.cpio.gz
Swap Space Considerations
% free
- OR -
% cat /proc/swaps
- OR -
% cat /proc/meminfo | grep MemTotal
As root, make a file that will act as additional swap space, let's say about 300 MB:
Now we should change the file permissions:
Finally we format the "partition" as swap and add it to swap space:
Known Issue #1 : (Error with Oracle 9.0.1 during linking of ins_plsql.mk)
You will see this bug show up during the "link" phase at around 62% when trying to link PL/SQL (ins_plsql.mk)
You have three options to get around this bug:
NOTE: This is the prefered method.
Cause: <BUG:1843232>
The "-z defs" is set in the variable LD_SELF_CONTAINED in the genclntsh script.
Download the following binutils from:
As root:
Download the following binutils from:
As root:
Make sure that you DO NOT set these environment variables in your profile (login) script
when installing Oracle9i.
They will cause the installer to fail during the linking of the OEM Agent (ins_oemagent.mk) and Context (ins_ctx.mk)!
There seems to be a bug in SQL*Plus that does not allow you to perform
a shutdown followed by a startup in the same SQL*Plus session.
If you attempt to perform a startup and shutdown in the same session,
you will be confronted with an ORA-01041 and ORA-03113 error.
What seems to be happening is a problem with the allocation of shared
memory segments. If you mistakenly try this, you have two options
to recover from it:
Below is an example of the problem and how to solve it by
removing the shared memory segments created by the
startup command after shutting down the database:
As per the JDK documentation, install JDK under /usr/local.
Download from: http://java.sun.com
Install as root:
Download from: http://www.blackdown.org
Install as root:
% groupadd -g 115 dba
Create Oracle Directories:
% mkdir /u01
% mkdir /u03
% mkdir /u04
% mkdir /u05
% mkdir /u06
% mkdir /u07
% mkdir /u08
% mkdir /u09
% mkdir /u10
% mkdir /opt/bin
Oracle Environment Variable Settings:
An example ".bash_profile" is provided in the Configuration Files / Scripts section below.
% DISPLAY=<Any X-Windows Host>:0.0
NOTE:
If you forgot to set the DISPLAY environment variable and you get the following error:
Xlib: connection to ":0.0" refused by server
you will then need to execute the following command to get "runInstaller" working again:
If you don't do this, the Installer will hang without giving any error messages.
Also make sure that "runInstaller" has stopped running in the background. If not, kill it.
% cd /Disk1
Copyright (c) 1998-2013 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter
and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express,
prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate,
but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from
relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
This article is a comprehensive guide for installing
Oracle9i (9.0.1 and 9.2.0) on the Red Hat Linux 7.1 and 7.2
operating environment.
Keep in mind the following assumptions:
Downloading / Unpacking Oracle9i Installation Files
(If you do not currently have an account with Oracle OTN, you will need to create one. This is a FREE account!)
% cpio -idmv < Linux9i_Disk2.cpio
% cpio -idmv < Linux9i_Disk3.cpio
NOTE:
Thanks to
William Johnson
for figuring this out. I was not sure why I had this problem, but I
was not able to "gunzip" the 3 downloaded files. It was complaining that the files where not
in "zipped" format. I then went for broke and tried to "cpio" the files without unzipping them
(keeping the ".gz" ending to the files) and it worked.
% cpio -idmv < Linux9i_Disk2.cpio.gz
% cpio -idmv < Linux9i_Disk3.cpio.gz
/Disk1
/Disk2
/Disk3
% dd if=/dev/zero of=tempswap bs=1k count=300000
% chmod 600 tempswap
% mke2fs tempswap
% mkswap tempswap
% swapon tempswap
The "binutils" package that ships with Red Hat 7.1 and Red Hat 7.2
will not work with Oracle 9i.
Known Issue #2 : (Error with Oracle9i during the linking of ins_oemagent.mk and ins_ctx.mk)
# LD_SELF_CONTAINED="-z defs"
Versions of ld prior to version 2.11 ignored the "-z defs" flag. ld
version 2.11 and later have the ability to use this flag. Because of this the
genclntsh script fails to produce the libclntsh.so library on a machine running
ld > 2.11.
NOTE:
If you decide to not take the option
of removing "-z defs" from the genclntsh file, you should try this method.
http://www.ibiblio.org/pub/Linux/kernel.org/pub/linux/devel/binutils/binutils-2.10.91.0.4-1.i386.rpm
% rpm -Uvh --force --nodeps binutils-2.10.91.0.4-1.i386.rpm
ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/os/i386/RedHat/RPMS/binutils-2.10.0.18-1.i386.rpm
% rpm -Uvh --force --nodeps binutils-2.10.0.18-1.i386.rpm
If you have ever installed Oracle8i on Red Hat Linux, you may be aware of several environment variables
that had to be set in your .profile or .bash_profile:
Known Issue #3 : Oracle 9.2.0 Only : (ORA-01041 / ORA-03113 during connect after shutting down the database in same SQL*Plus session)
When shutting down the database using SQL*Plus, you will need to do one of
the following in order to startup the database again:
Install the Java Development Kit (JDK)
SQL> connect / as sysdba
OEMDB on dbautil: ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 458759 root 777 196608 2 dest
0x00000000 1212424 root 777 196608 2 dest
0x00000000 1277961 root 777 196608 2 dest
0x00000000 1409034 root 777 196608 2 dest
0x00000000 2392075 root 777 196608 2 dest
0x00000000 10485772 oracle 640 4194304 10
0x00000000 2457613 root 777 196608 2 dest
0x00000000 10518542 oracle 640 33554432 10
0x00000000 10551311 oracle 640 33554432 10
0x00000000 10584080 oracle 640 33554432 10
0x00000000 10616849 oracle 640 33554432 10
0x00000000 10649618 oracle 640 33554432 10
0x00000000 10682387 oracle 640 33554432 10
0x00000000 10715156 oracle 640 33554432 10
0xc8131978 10747925 oracle 640 4194304 40
0x00000000 8126486 root 777 196608 2 dest
------ Semaphore Arrays --------
key semid owner perms nsems status
0x0db4c224 851970 oracle 640 154
------ Message Queues --------
key msqid owner perms used-bytes messages
OEMDB on dbautil: sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 25 17:20:33 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
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
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 458759 root 777 196608 2 dest
0x00000000 1212424 root 777 196608 2 dest
0x00000000 1277961 root 777 196608 2 dest
0x00000000 1409034 root 777 196608 2 dest
0x00000000 2392075 root 777 196608 2 dest
0x00000000 2457613 root 777 196608 2 dest
0x00000000 8126486 root 777 196608 2 dest
------ Semaphore Arrays --------
key semid owner perms nsems status
------ Message Queues --------
key msqid owner perms used-bytes messages
SQL> startup open
ORA-03113: end-of-file on communication channel
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
OEMDB on dbautil: ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 458759 root 777 196608 2 dest
0x00000000 1212424 root 777 196608 2 dest
0x00000000 1277961 root 777 196608 2 dest
0x00000000 1409034 root 777 196608 2 dest
0x00000000 2392075 root 777 196608 2 dest
0x00000000 11468812 oracle 640 4194304 0
0x00000000 2457613 root 777 196608 2 dest
0x00000000 11501582 oracle 640 33554432 0
0x00000000 8126486 root 777 196608 2 dest
------ Semaphore Arrays --------
key semid owner perms nsems status
------ Message Queues --------
key msqid owner perms used-bytes messages
% ipcrm shm 11468812 11501582
OEMDB on dbautil: sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 25 17:39:30 2002
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup open
ORACLE instance started.
Total System Global Area 252776588 bytes
Fixed Size 450700 bytes
Variable Size 218103808 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL>
In order to use Oracle's HTTP [Apache] Server, you will need to download an appropiate JDK.
This can include either Sun's JDK 1.3.1 or Blackdown 1.1.8_v3. In the past, Oracle
has always recommended Blackdown. I prefer Sun's JDK myself and have been
successful using it with 9i.
Create Oracle Account and Directories
Then create a symbolic link to the JDK under /usr/local/java.
% cp j2sdk-1_3_1_01-linux-i386.bin /usr/local
% chmod 755 j2sdk-1_3_1_01-linux-i386.bin
% ./j2sdk-1_3_1_01-linux-i386.bin
% ln -s /usr/local/jdk1.3.1_01 /usr/local/java
% cp jdk118_v3-glibc-2.1.3.tar.bz2 /usr/local
% bzip2 -dc jdk118_v3-glibc-2.1.3.tar.bz2
% tar xvf jdk118_v3-glibc-2.1.3.tar
% ln -s /usr/local/jdk118_v3 /usr/local/java
Create Oracle User Account:
Run the Oracle Installer
% useradd -u 173 -c "Oracle Software Owner" -d /u01/app/oracle -g "dba" -m -s /bin/bash oracle
% passwd oracle
% mkdir /u01/app
% mkdir /u01/app/oracle
% mkdir /u01/app/oracle/admin
% mkdir /u01/app/oracle/admin/O901DB
% mkdir /u01/app/oracle/admin/O901DB/adhoc
% mkdir /u01/app/oracle/admin/O901DB/adump
% mkdir /u01/app/oracle/admin/O901DB/arch
% mkdir /u01/app/oracle/admin/O901DB/backups
% mkdir /u01/app/oracle/admin/O901DB/bdump
% mkdir /u01/app/oracle/admin/O901DB/cdump
% mkdir /u01/app/oracle/admin/O901DB/create
% mkdir /u01/app/oracle/admin/O901DB/dba
% mkdir /u01/app/oracle/admin/O901DB/exp
% mkdir /u01/app/oracle/admin/O901DB/logbook
% mkdir /u01/app/oracle/admin/O901DB/pfile
% mkdir /u01/app/oracle/admin/O901DB/release
% mkdir /u01/app/oracle/admin/O901DB/report
% mkdir /u01/app/oracle/admin/O901DB/tuning
% mkdir /u01/app/oracle/admin/O901DB/udump
% mkdir /u01/app/oracle/product
% chown -R oracle:dba /u01/app/oracle
% mkdir /u03/app
% mkdir /u03/app/oradata
% mkdir /u03/app/oradata/O901DB
% chown -R oracle:dba /u03/app/oradata
% mkdir /u04/app
% mkdir /u04/app/oradata
% mkdir /u04/app/oradata/O901DB
% chown -R oracle:dba /u04/app/oradata
% mkdir /u05/app
% mkdir /u05/app/oradata
% mkdir /u05/app/oradata/O901DB
% chown -R oracle:dba /u05/app/oradata
% mkdir /u06/app
% mkdir /u06/app/oradata
% mkdir /u06/app/oradata/O901DB
% chown -R oracle:dba /u06/app/oradata
% mkdir /u07/app
% mkdir /u07/app/oradata
% mkdir /u07/app/oradata/O901DB
% chown -R oracle:dba /u07/app/oradata
% mkdir /u08/app
% mkdir /u08/app/oradata
% mkdir /u08/app/oradata/O901DB
% chown -R oracle:dba /u08/app/oradata
% mkdir /u09/app
% mkdir /u09/app/oradata
% mkdir /u09/app/oradata/O901DB
% chown -R oracle:dba /u09/app/oradata
% mkdir /u10/app
% mkdir /u10/app/oradata
% mkdir /u10/app/oradata/O901DB
% chown -R oracle:dba /u10/app/oradata
% chown oracle:dba /opt/bin
As the "oracle" user account:
Configuration Files / Scripts
% export DISPLAY
Xlib: Client is not authorized to connect to Server
% rm -rf /tmp/OraInstall
% ./runInstaller
Example:
.bash_profile
$HOME/.bash_profile for the "oracle" user account.
initO901DB.ora
Sample instance parameter script for Oracle9i. Place this file in ~oracle/admin/O901DB/pfile
before running the RUN_CRDB.sh script below.
create_database901.tar
An example "create database" set of scripts. Untar the file to ~oracle/admin/O901DB/create.
If you decide to change the name of the ORACLE_SID, here are the files that need to be changed:
The main script to run is: RUN_CRDB.sh.
Monday, 02-Jan-2012 15:09:56 EST
Page Count: 39765