Oracle XE database on Ubuntu

Oracle XE Database on Ubuntu OS

 

Follow me on above links

please refer following link to Install XE database on Ubuntu

http://justalittlebrain.wordpress.com/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/

However i found that there needs something little more to be done to make it run after installing and rebooting , thats what i am trying to document here

1. Downloads

Download libaio_0.3.104-1_i386.deb into /Downloads folder

from http://oss.oracle.com/debian/dists/unstable/main/binary-i386/libaio_0.3.104-1_i386.deb

Download oracle-xe-universal_10.2.0.1-1.1_i386.deb from

http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/oracle-xe-universal_10.2.0.1-1.1_i386.deb

2. Installation

Open terminal and login as root, and your root password can be / might be your system password

sudo su

Enter password : ********

cd /Downloads

sudo apt-get install libc6-i386

dpkg -i --force-architecture libaio_0.3.104-1_i386.deb

dpkg -i --force-architecture oracle-xe-universal_10.2.0.1-1.1_i386.deb

After Installation , ( During Installation select the option to start XE during OS Start up , even thou this takes some time at start up , but i had experienced some problems if not started at startup )

sudo /etc/init.d/oracle-xe configure

Edit ensure that Oracle Home & Oracle Sid is set

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_HOME

export ORACLE_SID=XE

export PATH

3. After Ubuntu is restarted, ( Note this needs to be done only once and if XE does not start )

Some times it might be a challenge to start XE database , so here is what you need to do

sudo su - root

Enter password : ********

cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

gedit nls_lang.sh

Important :: Change to this in first line  #!/bin/bash

also Ensure that earlier first line is commented , Save and Quit

why we do that refer this link Error message which i got

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found

4. Start Listener,

cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

./oracle_env.sh

./lsnrctl start

( If that does not start listener , give the following commands )

If listener does not start and gives following error then set these environmental variables

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 16-NOV-2010 22:57:01
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Message 1070 not found;

No message file for product=network, facility=TNSTNS-12545: Message 12545 not found;

No message file for product=network, facility=TNS TNS-12560: Message 12560 not found;

No message file for product=network, facility=TNS  TNS-00515: Message 515 not found;

No message file for product=network, facility=TNS   Linux Error: 2: No such file or directory

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_HOME

export ORACLE_SID=XE

export PATH

./lsnrctl start

( Assuming that the listener has started this time , even if not try using Oracle user , this would not ask for password )

sudo su - oracle

Enter password : ********

cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

./sqlplus

username : sys as sysdba

password : *******

SQL>  startup

ORACLE instance started.

Total System Global Area  805306368 bytes

Fixed Size    1261444 bytes

Variable Size  213909628 bytes

Database Buffers  587202560 bytes

Redo Buffers    2932736 bytes

Database mounted.

Database opened.

SQL> select * from dual;

D

-

X

SQL> exit

You could as well try this command logged in as root

/etc/init.d/oracle-xe restart

5. Unlocking hr user

./sqlplus

Enter user-name: hr

Enter password:

ERROR:ORA-28000:

the account is locked

Enter user-name: sys as sysdba

Enter password: *********

ALTER USER  HR ACCOUNT UNLOCK;

(This would ask for new password)

connect hr/*******;

select * from tab;

Starting and Stopping Oracle DB ( Incase its Auto Started you might need to stop it )

sudo su

********

/etc/init.d/oracle-xe stop

/etc/init.d/oracle-xe start

/etc/init.d/oracle-xe restart