Thursday, September 24, 2009

How to install Oracle XE under Ubuntu

Installation of Oracle database under the Ubuntu linux system is very simple. You have to go through a few simple step which could make you feel a real DB administrator :). So...

1) Add adequate key to your apt repository

waldekd@waldekd-laptop:~$ wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
--2009-09-24 20:45:31-- http://oss.oracle.com/el4/RPM-GPG-KEY-oracle
Resolving oss.oracle.com... 141.146.12.120
Connecting to oss.oracle.com|141.146.12.120|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1744 (1.7K) [text/plain]
Saving to: `STDOUT'

100%[==================================================================================================================>] 1,744 --.-K/s in 0.01s

2009-09-24 20:45:31 (158 KB/s) - `-' saved [1744/1744]

OK


2) Update your repository

waldekd@waldekd-laptop:~$ sudo aptitude update
Hit http://pl.archive.ubuntu.com intrepid Release.gpg
Ign http://pl.archive.ubuntu.com intrepid/main Translation-en_US
Ign http://pl.archive.ubuntu.com intrepid/restricted Translation-en_US
Ign http://pl.archive.ubuntu.com intrepid/universe Translation-en_US
Ign http://pl.archive.ubuntu.com intrepid/multiverse Translation-en_US
Hit http://pl.archive.ubuntu.com intrepid-updates Release.gpg


3) Install Oracle DB

ldekd@waldekd-laptop:~$ sudo aptitude install oracle-xe
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
The following NEW packages will be installed:
libaio{a} oracle-xe
0 packages upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 221MB/221MB of archives. After unpacking 405MB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
Get:1 http://oss.oracle.com unstable/non-free oracle-xe 10.2.0.1-1.1 [221MB]
Fetched 188MB in 26min20s (119kB/s)
Selecting previously deselected package libaio.
(Reading database ... 6132459 files and directories currently installed.)
Unpacking libaio (from .../libaio_0.3.104-1_i386.deb) ...
Selecting previously deselected package oracle-xe.
Unpacking oracle-xe (from .../oracle-xe_10.2.0.1-1.1_i386.deb) ...
Processing triggers for man-db ...
Setting up libaio (0.3.104-1) ...

Setting up oracle-xe (10.2.0.1-1.1) ...
update-rc.d: warning: /etc/init.d/oracle-xe missing LSB style header
Executing Post-install steps...
-e You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.


Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done


4) Make some initial configuration

waldekd@waldekd-laptop:~$ sudo /etc/init.d/oracle-xe configure
[sudo] password for waldekd:

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 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:

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

Starting Oracle Net Listener...Done
Configuring Database...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"


5) Log in to an application to manage DB



6) Here you are :)



7) Sometimes after your system has been restarted there are some problems with user's permissions (you've got message "User [your_login] is not a member of group 'dba'". To solve it you have to simply add your user to dba group be using the following statement (change "waldekd" with your login):

waldekd@waldekd-laptop:~$ sudo usermod -a -G dba waldekd

No comments:

Search This Blog