Pages

Saturday, October 19, 2013

Installing Oracle 11g Database Express on Ubuntu 13.10

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.

$ sudo apt-get install alien libaio1

$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
$ cd Disk1
$ sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
$ sudo dpkg --install oracle-xe-11.2.0-1.0.x86_64.deb

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

Add oracle user to sudo group.
$ sudo adduser oracle sudo

Create password for oracle.
$ sudo passwd oracle

On Ubuntu, /run/shm is mounted and /dev/shm is a link to it. But /dev/shm should be mounted to avoid ORA-00845: MEMORY_TARGET not supported on this system.

$ sudo vi /etc/rc2.d/S01shm-mount

#! /bin/sh
case "$1" in
       start)
                rm /dev/shm 2>/dev/null
                mkdir /dev/shm 2>/dev/null
                mount -t tmpfs shmfs -o size=2048m /dev/shm
                ;;
       *)
                echo error
                exit 1
                ;;
esac

$ sudo chmod 755 /etc/rc2.d/S01shm-mount

$ sudo mkdir /var/lock/subsys

Change the path for awk in /etc/init.d/oracle-xe

if [ -z "$AWK" ]; then AWK=/bin/awk; fi
to
if [ -z "$AWK" ]; then AWK=/usr/bin/awk; fi

Create XE database.
$ su - oracle
$ sudo /etc/init.d/oracle-xe configure

Press to accept the defaults
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:

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 the database creation logs in $ORACLE_HOME/config/log

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 NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
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

1 comment:

BHAVANI SHEKHAR said...

Thanks for sharing this installation that helps us to work on vm boxes with Ubuntu platform. But felt here in this post Where is the schema creation?

Post a Comment