Oracle Express Edition is a completely free, 4gigabyte size limited database with nearly full Oracle Standard Edition feature compatibility. It also comes with the Application Express platform (APEX) and requires virtually no configuration out of the box. It is as simple as downloading the RPM file, running the install command, running the configure step and accepting the default answers. A default database instance (XE) is included with sample schemas so you can begin using the database immediately. The full install guide is found here:
1. First download the RPM from Oracle.
2. As the root user, check prerequisites, then perform the install.
glibc and libaio are required. Use the rpm command as shown. If you don't have them installed, add them from the Linux distribution media.
root# rpm -q glibc
root# rpm -q libaio
3. Check kernel parameters for adequate resources.
The RPM installer will insert the minimum recommended kernel setting of "kernel.sem" for you, but since you may want to upgrade from XE to full Oracle at a later time, its a good idea to go ahead and set various other kernel parameters to adequate values for Standard or Enterprise Edition.
/etc/sysctl.conf should have the following params set. After editing the file, either reboot or use "sysctl -p" to load the params dynamically.
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
4. As the root user, install the Oracle XE RPM.
root# rpm --install oracle-xe-univ-10.2.0.1-1.0.i386.rpm
Executing Post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to
configure the database.
5. As the root user, perform the configuration.
Run "/etc/init.d/oracle-xe configure". Be aware that it will create the oracle user and dba group during this step. You should answer Y (YES) to the question, "Do you want Oracle Database 10g Express Edition to be started on boot (y/n)" in order to install Oracle as a "service".
root# /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 :
Specify a port that will be used for the database listener :
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
Confirm the password:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:
Starting Oracle Net Listener...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"
Verify that the instance was started by checking for the smon process "ps -ef | grep smon".
root# ps -ef | grep smon
oracle 4482 1 0 11:34 ? 00:00:00 xe_smon_XE
Verify that /etc/oratab was created with the instance entry was inserted by the installer.
root# cat /etc/oratab
Verify that you can access the web port with your web browser. Make sure you have disabled firewalling, or added a rule for port 8080, your you will only be able to reach the web port locally.
You can stop here if you intend to use Oracle and APEX through the web interface as a learning experience, however, it is a better practice to setup the oracle shell for sqlplus access, DBA tasks, and even RMAN backup and recovery.
6. Setup oracle shell user
To use the Oracle tools from a UNIX shell, you need to configure a few environment variables for the oracle owner. You can also configure the same environment for other users. You can either set the variables directly in the .profile just as with Oracle Standard/Enterprise manual installation, or you can simply reference the default profile that comes with Oracle XE.
If you are still root, switch to the oracle user again.
su - oracle
Add these to ".profile" in the home directory with the proper Oracle environment variables. I use vi, you can use pico, nano, whatever.
# .profile for oracle user - This is how we would usually do it in a SE/EE install
echo "Default Oracle instance is $ORACLE_SID"
Or the shortcut, just source in the default profile.
# .profile for oracle user - XE has a default profile
Test the profile by logout and re-login as oracle user
[root@localhost ~]# su - oracle
Default Oracle instance is XE
-bash-3.2$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 31 13:06:13 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
7. Enable the HR demo account
While connected to sqlplus as sysdba, take care of the final loose end.
Enable the HR user so you can connect via the APEX web interface and use the demo schema. You need to unlock the account, then login as the HR user to set a new password. (Sure you could enable the default password, but this is not secure)
SQL> alter user hr account unlock;
SQL> connect hr/hr
ORA-28001: the password has expired
Changing password for hr
Retype new password:
Oracle XE is now ready. Within the size and memory limitations, you can deploy your application free of licensing fees. Keep in mind, however, once you need support, you'll need to upgrade to Standard Edition One, at minimum.
You can stop here if you like. If you are concerned with protecting your database and taking backups, some optional steps are included below.
Appendix A : Enable Oracle Database archive mode
This is optional but recommended. Enabling ARCHIVELOG mode will improve your recoverability and allow you to take hot backups with no downtime. Without this, you can only take cold backups or exports.
From sqlplus, switch back to SYSDBA
SQL> connect / as sysdba
Shutdown the database, then start in mount mode, and set ARCHIVELOG option before re-opening the database.
Appendix B: Configure RMAN and perform a hot backup
SQL> shutdown immediate;
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 209715200 bytes
Fixed Size 1258028 bytes
Variable Size 75501012 bytes
Database Buffers 130023424 bytes
Redo Buffers 2932736 bytes
SQL> alter database archivelog;
SQL> alter database open;
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
From the "oracle" shell user, run RMAN and enable controlfile autobackup, and take an initial hot backup.
rman target /
RMAN> configure controlfile autobackup on;
RMAN> backup database plus archivelog;
The output from the RMAN backup is a bit wordy and not included here, but look for the last two lines, which are:
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 31-AUG-09