Anda di halaman 1dari 4

Oracle 10g XE on CentOS5 SerengetiSys Labs Configuring Oracle Database 10g XE on Linux v1.

Oracle Database 10g XE Server Installation on Linux CentOS5 Step by Step HowTo

By Kefa Rabah, krabah@globalopenversity.org April 16, 2009 SerengetiSys Labs

Introduction
If you all your database work using the open source MySQL but always had a passion for the
beauty and power of Oracle but couldn’t afford the big bucks – now you can, without having to
spend a dim. Oracle has finally let loose the good old Oracle database which you can use as a
backend database which is known as Oracle Database Express Edition (Oracle Database XE) and
is available as free download and use for all your database work.

You can find the software HERE but you will need to create an Oracle account first. Be warned
that the Oracle site can be a little frustrating. You will want to download Oracle Database 10g
Express Edition (either Western European or Universal version depending on your language
requirements), which represents the Server, and Oracle Database 10g Express Client, which
allows remote access to the server from another machine.

Oracle provides detailed documentation on these, including an Installation Guide, a Getting


Started Guide and an Online Tutorial. While these are welcome, they tend to cover more options
than you really need and so they can be a bit confusing. This note trims off that excess verbage
and explains what I needed to do to install the database on a Linux CentOS 5 server.

Part 1: Oracle 10g XE Server Installation

1. Check the prerequisites in the Installation Guide


For hardware these are basically 512 MB memory, 1.5 GB disk.
You'll need at least 1024 MB of swap space. Check that with:

# free –m

If the total for the Swap line is less that 1024 then you need to add a swapfile of an appropriate
size. I'll try and add a short note about that to this site when I get the chance - otherwise google
for it.

You'll need the Linux packages glibc (2.3.2 or higher) and libaio (0.3.96 or higher). You should
have glibc already there but you'll have to install libaio (as root), so make sure you do the su –
command fast, just to be on the safe side:

# yum install libaio

There are also a bunch of kernel parameters listed in the installation guide. I didn't have to mess
with these.

2. Install the Downloaded RPM


Change to the directory where downloaded the package and issue the command as shown:

[root@server04 software-tmp]# rpm -ivh oracle-xe-10.2.0.1-1.0.i386.rpm


Preparing... ########################################### [100%]
1:oracle-xe ########################################## [100%]
Executing Post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to
configure the database.

If you've met all the prerequisites, the rpm should install smoothly. Next let’s run the scripts as
instructed above.
1
© April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org A GOV HowTo Technical Publication


Oracle 10g XE on CentOS5 SerengetiSys Labs Configuring Oracle Database 10g XE on Linux v1.0

3. Run the Configuration Script


To run the configuration script, issue the following command:

# /etc/init.d/oracle-xe configure

Oracle Database 10g Express Edition Configuration


-------------------------------------------------
This will configure on-boot properties of Oracle Database 10g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8081

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:

Starting Oracle Net Listener...Done


Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:8081/apex"
]#

Note: In simple terms, you accept the defaults for the two questions about ports, provide an
administrator password and set the database to start on boot. However, if you are like me with
many servers running on my testing lab, then you may want to change the port to different
number e.g., 8081. As can be observed, the script will then do a load of work in the background
to configure things properly for you.

This can take quite a while. Run top in another cup of coffee for company and stick around if you
want reassurance that things are happening.

4. Access the Database via its Web Site

On the server with the database, open up a browser and go to http://localhost:8081/apex.

Login as system and give the password that you set earlier. If you want to access this site from
other machines on your network then go Administration->Manage HTTP Access and select
Available from Local Server and Remote Clients.

You can enable a test database by going to Administration->Database Users->Manage


Users and clicking on HR. Provide a password (such as 'hr') and change Account Status to
unlocked and click the Alter User button. This test database is handy for testing later on.

5. Set Some Environment Variables

As root, open /etc/bashrc in an editor and add this line at the bottom of the file:

. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

2
© April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org A GOV HowTo Technical Publication


Oracle 10g XE on CentOS5 SerengetiSys Labs Configuring Oracle Database 10g XE on Linux v1.0

When you create a shell this will set a few environment variables that are required in order to
access the database. These include LD_LIBRARY_PATH, ORACLE_HOME and ORACLE_SID.
Look for them in the output of printenv when you create a new shell.

Now verify that Oracle environment is set correctly, as follows:

]# echo $ORACLE_HOME
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/

That's it for installing the server... Enjoy!

Part 2: Oracle XE Client Installation

If you need to do remote database management, then you would install this on a remote
machine that you want to access the database server over the network.

1. Check the prerequisites

Gain to be on the safe side check that the glibc and libaio packages, as above:

# yum install libaio -y

2. Install the Downloaded RPM

This gave me a couple of errors but they didn't appear to be a problem...

# rpm -ivh oracle-xe-client-10.2.0.1-1.0.i386.rpm


Preparing... ################################## [100%]
df: `/usr/lib/oracle': No such file or directory
expr: syntax error
/var/tmp/rpm-tmp.86099: line 23: [: -lt: unary operator expected
1:oracle-xe-client ##################################### [100%]
Executing Post-install steps...

3. Setup the Environment Variables

As root, open /etc/bashrc in an editor and add this line at the bottom of the file:

. /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin/oracle_env.sh

4. Access the Remote Server

If your paths are setup correctly then you can access sqlplus from a shell. Here I am accessing
the HR test database on server testbed. The correct syntax is username/password@host

# sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 29 10:21:21 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect system/password


Connected.

SQL> SELECT * FROM Customer;

You see lots of output returned by the server, indicating that everything is set up correctly.

3
© April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org A GOV HowTo Technical Publication


Oracle 10g XE on CentOS5 SerengetiSys Labs Configuring Oracle Database 10g XE on Linux v1.0

That's it... you’re done – Enjoy! As you can see it is a very fairly simple and straight forward
installation and configuration. I hope you have great fun working with Oracle on Linux like me. Be
on the look out on more progress on application of Oracle on Linux.

-----------------------

Kefa Rabah is the Founder and CIO, of Serengeti Systems Group Inc. Kefa is knowledgeable in
several field of Science & Technology, IT Security Compliance and Project Management, and
Renewable Energy Systems. Rabah is also the founder of Global Open Versity, a Center of
Excellence in eLearning.

4
© April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada

www.globalopenversity.org A GOV HowTo Technical Publication

Anda mungkin juga menyukai