Oracle 10g release 1 (10.1.0.2) on Fedora core 1
Please note that Oracle Database 10g is not certified to run on Fedora Linux, therefore you should not use this combination on a production server. You can examine the Oracle certification matrix at Metalink
Contents
Downloading and unpacking installation files[edit]
Download Oracle Database 10g from Oracle Technology Network. Four files are available:
- ship.ccd.cpio.gz - Oracle 10g Companion CD
- ship.client.cpio.gz - Oracle 10g Client
- ship.crs.cpio.gz - Oracle 10g Cluster Ready Services
- ship.db.cpio.gz - Oracle 10g Database
Only ship.db.cpio.gz is required in order to install the database.
Once you downloaded the file, unpack it:
gunzip ship.db.cpio.gz cpio -idmv<ship.db.cpio
All four installation files unpack to directory named "Disk1", so rename directory before you eventually unpack another file.
You may want to create Oracle installation CD set from unpacked installation files. As I don't have a CD-burner on any of my linux boxes, I created ISO images using
mkisofs -JR -l -o ship.db.iso Disk1/
and burned CDs on Windows machine.
Preparing your system[edit]
Steps to perform as root user[edit]
Install following fedora packages using rpm -ivh package_name: From Fedora-core Disk 1:
- setarch-1.0-1.i386.rpm
From Fedora-core Disk 2:
- openmotif-2.2.2-16.1.i386.rpm
From Fedora-core Disk 3:
- compat-libstdc++-7.3-2.96.118.i386.rpm
- compat-db-4.0.14-2.i386.rpm
- compat-gcc-7.3-2.96.118.i386.rpm
- compat-libgcj-7.3-2.96.118.i386.rpm
- compat-libstdc++-devel-7.3-2.96.118.i386.rpm
- compat-libgcj-devel-7.3-2.96.118.i386.rpm
Now we have to make Oracle installer think that we have one of the supported distributions: Create a backup of your /etc/redhat-release file, an change its contents:
# cp /etc/redhat-release /etc/redhat-release.orig # echo "Red Hat Enterprise Linux AS release 3 (Taroon)" > /etc/redhat-release
Change kernel parameters by adding the following lines in /etc/sysctl.conf:
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 = 32768 65000
Update kernel configuration:
[root@fedora root]# sysctl -e -p /etc/sysctl.conf
Add the following lines to /etc/security/limits.conf file:
* soft nproc 2047 * hard nproc 16384 * soft nofile 1024 * hard nofile 65536
Add the following line to the /etc/pam.d/login file, if it does not already exist:
session required /lib/security/pam_limits.so
Create user and groups that will own oracle installation. In this exaple the username will be oracle:
[root@fedora]# groupadd oinstall [root@fedora]# groupadd dba [root@fedora]# useradd -g oinstall -G dba oracle [root@fedora]# passwd oracle
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/oracle:
[root@fedora]# mkdir -p /home/oracle/product/10g [root@fedora]# chown -R oracle.oinstall /home/oracle/*
Steps to perform as oracle user[edit]
Make gcc296 default compiler for user oracle by creating symbolic link. It is important that the directory containing the link (/home/oracle/bin) is listed in the PATH variable before /usr/bin.
[oracle@fedora oracle]$ mkdir /home/oracle/bin [oracle@fedora oracle]$ cd /home/oracle/bin [oracle@fedora bin]$ ln -s /usr/bin/gcc296 gcc
Put the following lines in oracle user .bash_profile
export ORACLE_BASE=/home/oracle export ORACLE_HOME=/home/oracle/product/10g export ORACLE_SID=orcl export ORACLE_TERM=xterm export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH ulimit -u 16384 -n 65536 # # change this NLS settings to suit your country: # example: # german_germany.we8iso8859p15, american_america.we8iso8859p1 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. In this example ORACLE_SID=orcl. You will be prompted by installer to specify SID and global database name, and you should replace the SID in .bash_profile with your own SID.
Update environment to include new variables:
[oracle@fedora]$ source /home/oracle/.bash_profile
Everything is now ready to start the oracle installer.
Running the installer[edit]
If you have Oracle 10g Database CD, login as root and mount it:
[root@fedora]# mount /mnt/cdrom
Oracle installer needs to be run from Xwindows, so start Xwindows and login as user oracle. Make sure that your envionment is correctly set up:
[oracle@fedora oracle]$ set|grep ORACLE ORACLE_BASE=/home/oracle ORACLE_HOME=/home/oracle/product/10g ORACLE_SID=orcl ORACLE_TERM=xterm [oracle@fedora oracle]$ gcc --version 2.96
Start the installer:
[oracle@fedora oracle]$ /mnt/cdrom/runInstaller
Note: if you get thew following error when running the installer from CD-ROM
bash: /mnt/cdrom/runInstaller: /bin/sh: bad interpreter: Permission denied
you should check how your CD-ROM was mounted. It should be mounted by user root, and the information about the filesystem in /etc/fstab sohuld look similar to this:
/dev/cdrom /mnt/cdrom auto exec,noauto,owner,kudzu,ro 0 0
Now the installer should be up and running.
Post-installation steps[edit]
First we want to change back the /etc/redhat-release file:
[root@fedora]# cp /etc/redhat-release.orig /etc/redhat-release
Next, modify the /etc/oratab file in order to use database startup and shutdown scripts provided by oracle. Find the line in /etc/oratab that looks similar to this:
*:/home/oracle/product/10g:N
Entries are of the form:
$ORACLE_SID:$ORACLE_HOME:<N|Y>
Change the last field (N) to Y, and you will be able to start the database using dbstart utility.
Starting database services[edit]
Note: If you just installed Oracle, the database, TNS listener and enterprise manager are already running.
Start TNS Listener:
[oracle@fedora oracle]$ lsnrctl start
You can start the database via dbstart utility:
[oracle@fedora oracle]$ dbstart
or via SQL*Plus:
[oracle@fedora oracle]$ sqlplus / as sysdba SQL*Plus: Release 10.1.0.2.0 - Production on Sat Feb 21 18:05:43 2004 Copyright (c) 1982, 2004, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 188743680 bytes Fixed Size 778036 bytes Variable Size 162537676 bytes Database Buffers 25165824 bytes Redo Buffers 262144 bytes Database mounted. Database opened. SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production With the Partitioning, OLAP and Data Mining options [oracle@fedora oracle]$
Start Enterprise manager server:
[oracle@fedora oracle]$ emctl start dbconsole
Stopping database services[edit]
Stop Enterprise manager server:
[oracle@fedora oracle]$ emctl stop dbconsole
You can stop the database via dbshut utility:
[oracle@fedora oracle]$ dbshut
or via SQL*Plus:
[oracle@fedora oracle]$ sqlplus / as sysdba SQL*Plus: Release 10.1.0.2.0 - Production on Sat Feb 21 18:11:23 2004 Copyright (c) 1982, 2004, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production With the Partitioning, OLAP and Data Mining options SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production With the Partitioning, OLAP and Data Mining options [oracle@fedora oracle]$
Stop TNS listener:
[oracle@fedora oracle]$ lsnrctl stop
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 or Download an example script.
Copy the script to /etc/rc.d/init.d as root user, edit environment variables to match your settings and modify its permissions:
[root@fedora root]# chown root.root /etc/rc.d/init.d/ora10 [root@fedora root]# chmod 755 /etc/rc.d/init.d/ora10
The script I wrote uses chkconfig utility to simplify service management. It is configured to start oracle services in runlevels 3 and 5,with start priority 95 and stop priority 1.
Initialize new service:
[root@fedora root]# chkconfig ora10 reset [root@fedora root]# chkconfig --list ora10 ora10 0:off 1:off 2:off 3:on 4:off 5:on 6:off
Now oracle services will be automatically started when entering runlevels 3 and 5, and shut down when entering any other runlevel. For more information on chkconfig utility refer to its man page. To manually start/stop oracle services you can use
[root@fedora root]# service ora10 start
and
[root@fedora root]# service ora10 stop
Republished with permission from Denis Klaric. Original URL: http://staff.in2.hr/denis/oracle/10g1install_fedora1_en.html