Pages

Saturday, April 12, 2014

Installing Oracle 11gR2 Database Express on CentOS 7

Oracle 11g Database XE is a free edition of oracle database. XE uses only a single CPU and only one instance with the maximum memory of 1GB. The maximum user data in Oracle Database XE is 11GB.

Download Oracle 11gR2 Database Express Edition from http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
$ cd Disk1
$ sudo yum localinstall oracle-xe-11.2.0-1.0.x86_64.rpm

It creates oracle user and installs oracle binaries in /u01/app/oracle

Create password for oracle.
$ sudo passwd oracle

Grant sudo privilege to oracle user.
$ sudo /usr/sbin/visudo
oracle ALL=(ALL) ALL

Create XE Database.
$ su - oracle
$ sudo /etc/init.d/oracle-xe configure
[sudo] password for oracle:

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 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:
Confirm the password:

Passwords do not match.  Enter the password:
Confirm the password:

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

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

You can find HR schema, the database creation logs in $ORACLE_HOME/config/log, datafiles in $ORACLE_HOME/oradata/XE, and listener configuration in $ORACLE_HOME/network/admin.

The password for the INTERNAL and ADMIN Oracle Application Express user accounts is initially the same as the SYS and SYSTEM user accounts.

For Bash shell, enter the environment variables into the .bash_profile

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=XE
export PATH=$ORACLE_HOME/bin:$PATH

To start listener and database as oracle user.
$ su - oracle
$ lsnrctl start
$ sqlplus / as sysdba
SQL> startup

To stop database and listener as oracle user.
$ su - oracle
$ sqlplus / as sysdba
SQL> shutdown immediate
$ lsnrctl stop