How to Install and Configure Oracle on Linux
Oracle RDBMS is a full-featured relational database management system from Oracle Corporation. It includes a set of administration tools, and precompilers for most programming languages. This article will cover how to install and configure an Oracle database on Linux.
The installation file for Oracle 8.0.5 Enterprise Edition is named Oracle8051EE_Intel.tgz. It can be downloaded from ftp://technet.oracle.com/. If needed, the glibc patch file glibcpatch.tgz can be downloaded from ftp://ftp.oracle.com/pub/www/otn/linux/.
Oracle currently uses glibc 2.0 rather than glibc 2.1. Oracle has supplied a patch which, when combined with compatibility RPM packages, allows it to run on Red Hat 6.0. I chose to use the Linux-Mandrake 6.0 distribution for this installation. If you are not using 6.0, you can skip the steps for installing the compatibility RPMs and the glibc patch. It is possible to install Oracle on other distributions, but since Oracle uses Red Hat for its development, Red Hat (or some variation of Red Hat) is preferred.
The C Development package must be installed when you install Linux. If you want to install Oracle's Intelligent agent, you must have tcl-8.0.3-20.i386.rpm installed. To install the JDBC drivers, you must define a path to your classesxxx.zip file.
I recommend creating a minimum of three partitions for Oracle. This allows you to use Oracle's Optimum Flexible Architecture (OFA) standard. Using OFA gives you the capability to segregate data from indexes and have multiple control files. The partitions should be named u01, u02 and u03. You can create more partitions if you have the disks to support them. I have two disks on my machine, so I created a partition of 1GB for /u01 and 150MB for /u02. I then created a directory called /u03 to give me the equivalent of another mount point. The first partition (/u01) is where the Oracle executables and all associated files will be placed during the installation process. The remaining mount points will be used for data files, indexes and control files.
A multitude of directories are created during the installation process. Some of the more important ones are:
$ORACLE_HOME/bin contains the executables for the database and administrative software.
$ORACLE_HOME/rdbms/admin contains the SQL scripts used to create the catalog, and other useful scripts too numerous to cover here. Refer to the Oracle Database Administration Manual for an explanation of the scripts contained in this directory.
$ORACLE_BASE/admin/SID/bdump contains the alert log for the instance. The name of the alert log is alert_SID.log, where SID is the system identifier for the instance (i.e., alert_greg.log for this installation). This file is extremely important in determining where problems lie. Any time you have an error or database crash, this is the first place to look for information on what might have happened to cause the problem.
$ORACLE_HOME/network/admin contains the tnsnames.ora and listener.ora files. Both of these files are described in the section on modifying configuration files.
$ORACLE_HOME/precomp/demo/proc contains several Pro*C example programs.
The data files, indexes and control files will be placed in /oradata/SID, where SID is the system identifier for the instance (i.e., /u01/oradata/greg, /u02/oradata/greg and /u03/oradata/greg for this installation).
The installation is broken down into 8 steps:
Pre-installation sets up the groups and users, and performs all the tasks prior to actually installing the software.
Software installation is the process of installing the software.
Documentation installation is the process of installing the on-line documentation for Oracle. This must be done in a separate step due to a bug in the installation process.
Binary patching is the process of applying the glibc patch supplied by Oracle.
Database creation creates the initial database.
Post-installation is the process of running a post-install script as root.
Configuration file modification is the process of identifying and modifying the configuration files used by the database and Net8.
Testing and automation is the final process of determining that the database is installed and configured properly, and setting the instance up to start automatically when the machine is rebooted.
Download the compatibility RPMs from Red Hat. The necessary RPMs are compat-binutils-5_2-2_9_1_0_23_1_i386.rpm, compat-glibc-5_2-2_0_7_1_i386.rpm, compat-egcs-5_2-1_0_3a_1_i386.rpm, compat-egcs-c++-5_2-1_0_3a_1_i386.rpm and compat-libs-5_2-1_i386.rpm. Issue the following commands to install the RPMs:
rpm -ivh compat-binutils-5_2-2_9_1_0_23_1_i386.rpm rpm -ivh compat-glibc-5_2-2_0_7_1_i386.rpm rpm -ivh compat-egcs-5_2-1_0_3a_1_i386.rpm rpm -ivh compat-egcs-c++-5_2-1_0_3a_1_i386.rpm rpm -ivh compat-libs-5_2-1_i386.rpm
Edit /etc/passwd for root and change the shell from /bin/bash to /bin/sh. This will make the installation scripts supplied by Oracle run without errors.
Create the groups and users used by Oracle. At a minimum, you will need a group called dba for the oracle user. You may also want to create a group called oper for the operation of the database. Refer to the Database Administrator's Guide for Oracle to determine whether you want to create this group. In the following example, I used only the dba group, with a group ID of 601. You may need to use a different group ID if 601 is already in use on your system. Be sure to change the password for the oracle user.
groupadd -g 601 dba useradd oracle -g 601 passwd oracle
Edit /etc/passwd as root to change the default shell.
Create the directories for your mount points if you didn't create them as partitions. Repeat the commands for all three mount points if necessary.
mkdir /u01 chown -R oracle.dba /u01
Change to the directory where you have unpacked the Oracle8051EE_Intel.tgz file (this is your staging directory for the installation process), and run the script to create the /etc/oratab file. This file is used by Oracle's startup script to determine which instances are running on the machine, and whether they should autostart when the machine is rebooted. More on this file later.
cd /home/oracle/orainst/orainst ORACLE_OWNER=oracle; export ORACLE_OWNER sh oratab.shSee Figure 1 for prompts and their replies.
Log out as root and log in as oracle. Make sure umask is set to 022 by typing umask. If it is not set to 022, you will need to add a line to your .profile file. Set the following environment variables in oracle's .profile:
ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/8.0.5 ORACLE_SID=greg #(replace with your system #identifier) ORACLE_TERM=386 PATH=$PATH:/u01/app/oracle/product/8.0.5/bin TMPDIR=/var/tmp export ORACLE_BASE ORACLE_HOME ORACLE_SID\ ORACLE_TERM export PATH TMPDIR umask 022 #(only if the umask is not already #set to 022)
Log out, then log back in as oracle. Make sure the environment variables are set by using the env command, and that /bin:/usr/bin:/usr/local/bin is in your path.
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- Designing Electronics with Linux
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Build a Skype Server for Your Home Phone System
- Validate an E-Mail Address with PHP, the Right Way
- A Topic for Discussion - Open Source Feature-Richness?
- Why Python?
- Tech Tip: Really Simple HTTP Server with Python
2 hours 10 min ago
- Reply to comment | Linux Journal
2 hours 18 min ago
- Understanding the Linux Kernel
4 hours 32 min ago
7 hours 2 min ago
- Kernel Problem
17 hours 5 min ago
- BASH script to log IPs on public web server
21 hours 32 min ago
1 day 1 hour ago
- Reply to comment | Linux Journal
1 day 1 hour ago
- All the articles you talked
1 day 4 hours ago
- All the articles you talked
1 day 4 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?