Install Oracle 11g Express on CentOS 6

oracle_11g_databaseWell, last week I worked on simple PHP – Oracle project so one of the problem I must do is installing Oracle DB for testing. As some of you may know, we normally need a GUI to run install script from Oracle, or use quite installation with pre-defined response file. For simplicity, I did install Oracle 11g Express on CentOS 6 server for testing purpose. Steps are as simple as follows:

  1. Pre-requisite: http://docs.oracle.com/cd/E17781_01/install.112/e18802/toc.htm#XEINL103
  2. Install dependencies:

    [bash]yum install libaio bc flex[/bash]

  3. Download and Install Oracle 11g:
    1. First, download from http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html (should download from a GUI-enable PC/VPS/Server and re-upload to the non-GUI server)
    2. Unzip and import rpm:

      [bash]unzip -q oracle-xe-11.2.0-1.0.x86_64.rpm.zip
      cd Disk1
      rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm[/bash]

  4. Configure 11g XE Database as root user:

    [bash]/etc/init.d/oracle-xe configure[/bash]

    We will see the response screen as follows:

    [bash][[email protected] Disk1]# /etc/init.d/oracle-xe configure

    Oracle Database 11g Express Edition Configuration
    ————————————————-
    This will configure on-boot properties of Oracle Database 11g 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]:8080

    Specify a port that will be used for the database listener [1521]: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 11g Express Edition to be started on boot (y/n) [y]:y

    Starting Oracle Net Listener…Done
    Configuring database…Done
    Starting Oracle Database 11g Express Edition instance…Done
    Installation completed successfully.
    [/bash]

  5. Test the Oracle Application Express connection by accessing http://yourdomain.com:8080/apex/f?p=4950:7:6247513609753806::NO
    1. Use SYSTEM as user and the entered password when installing as password
    2. Can try by create a first database 🙂
  6. Set the required Oracle environment variables:

    [bash][[email protected] csf]# cd /u01/app/oracle/product/11.2.0/xe/bin
    [[email protected] bin]# sh oracle_env.sh [/bash]

    For other logged in users, we will need to add the following commands to .bashrc or .bash_profile of the according user:

    [bash]sh /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh[/bash]

    Then, try to access SQLPlus at the command line:

    [bash]sqlplus /nolog[/bash]

  7. If we cannot access from remote host, Allow Remote Access to Oracle 11g XE GUI by running the following command from SQL*Plus:

    [sql]SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);[/sql]

  8. I think it is enough now :-). You can create a new database as the guide at http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r41/apexstart_b/apexstart_b.htm and start experiment.
  9. Other references:
    1. PHP with Oracle 11g tutorial: http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/oow10/php_db/php_db.htm
    2. MySQL and Oracle concepts comparison: http://docs.oracle.com/cd/E12151_01/doc.150/e12155/oracle_mysql_compared.htm#BABGACIF

Leave a Reply