Install Oracle XE on Linux Centos 5

This is a quick guide on how to install Oracle XE on a Linux Centos 5 machine:

Download Oracle XE from Oracle.com: http://www.oracle.com/technetwork/database/express-edition/downloads/102xelinsoft-102048.html. For Linux Centos release, you will download your desired .rpm file (Universal or Western European)

Copy you .rpm to the Linux machine, either using WinScp or setting up a FTP server.

Log in as root (or sudo as root) and change the folder where you copied your .rpm file.

Install the dependencies:

yum install libaio

yum install bc

Install Oracle XE:

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

A successful installation will result in the following message:

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.

Configure Oracle XE:

/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]:

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:
Password can't be null. Enter password:
Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: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:8080/apex"

Setup remote access to the Database Home Page

[UPDATE] To set HTTP Access to allow remote connects:

Connect as sys with sqlplus:

SQL> exec dbms_xdb.setListenerLocalAccess(l_access => FALSE);

At this point the database home page GUI is available only from the host machine and no remotely.

For this action, To enable remote access from the Linux GUI, you will need to install Gnome desktop environment & FireFox web browser on you machine.

If you are connected remotely to the machine, you will have to set up a VNC connection:

yum groupinstall "GNOME Desktop Environment"

yum install firefox

yum install vnc-server

More details on how to install, configure and connect to a VNC server on Centos 5, here.

Connect to your machine using a VNC Client.

To enable remote access goto /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts and run ./DatabaseHomePage.sh. This script will automatically start FireFox and launch the DB home page. Login using the username system and the password provided before, when configuring Oracle XE (Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM…). If FireFox doesn't start automatically, just launch it from the Gnome menu.

After you are logged in, go to Administration -> Manage HTTP Access and select Available from local server and remote clients:

apex ninjas oracle xe centos install

Setup the environment variables

As root, open /etc/bashrc in the editor and append the following line at the end of the file:

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

Also execute the script above in the command line and check if the Oracle paths are setup correctly:

echo $ORACLE_HOME

/usr/lib/oracle/xe/app/oracle/product /10.2.0/server/

Start the Oracle Database

As root, execute:

/etc/init.d/oracle-xe start

 

Now, you can access the Oracle Database Home Page from a remote desktop computer using: http://yourserverip:8080/apex.

Also, you can run queries on the database logging on your server and launching SQL plus: sqlplus /nolog

Leave a Reply