Thursday, August 9, 2012

Installing Oracle 11g Express Edition on RHEL 5


There are times in your life that you will need to work with software that you do not represent. In this case, I needed to install an Oracle database on a VM so that I can try to make it work with IBM Business Process Manager V8.0 first on my local machine before doing it on the actual servers.

I'm using a Red Hat Enterprise Linux version 5.6 and setting up an Oracle 11g Express Edition on it is quite simple.

Prepare the operating system

Open a terminal and run the following commands using root

groupadd -g 550 dba
groupadd -g 551 oinstall
useradd -c "Oracle software owner" -g oinstall -G dba -u 550 oracle -d /opt/oracle
chown oracle:oinstall /opt/oracle
passwd oracle

Open up /etc/sysctl.conf in a text editor or  using vi command add the following lines

kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

Download and transfer the software into the VM


Create /opt/installers directory in your VM and transfer the downloaded zip file to that directory. (via WinSCP or FTP)

Using the terminal, list the /opt/installers directory

ls /opt/installers
oracle-xe-11.2.0-1.0.x86_64.rpm.zip

Unzip and install the rpm
Unzip the archive file inside /opt/installers

cd /opt/installers
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

Use the rpm command to uninstall

rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm
Preparing…
########################################### [100%]
  1:oracle-xe
########################################### [100%]

Post installation steps

Execute the /etc/init.d/oracle-xe configure command

/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]: {HIT ENTER}
Specify a port that will be used for the database listener [1521]: {HIT ENTER}
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: {INPUT A PASSWORD}
Confirm the password: {INPUT A PASSWORD}
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]: {HIT ENTER}
Starting Oracle Net Listener…Done
Configuring database…Done
Starting Oracle Database 11g Express Edition instance…Done

Installation completed successfully.

When the installation completes, the installation directory can be located under /u01. We then set the required Oracle environment variables using the oracle_env.sh script located in /u01/app/oracle/product/11.2.0/xe/bin. To do this, we need to add the . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh to the .bashrc or .bash_profile of the user whom you want to have access to the database:

(using vi)

su - oracle
vi .bash_profile

Append the following line at the end of the file:

. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

(to save and exit press [ESC], Q, wq, [ENTER])

Finally, you should be able to access the SQL*Plus. If not, try restarting your session.

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Aug 9 23:47:08 2012

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

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL>

Do let me know if you have questions, but, also remember that I don't really know a lot about this product so you might be better off Googling if in case I can't answer your question. 

No comments: