Monday, September 15, 2008

install Oracle XE on Ubuntu x86_64

1. download oracle-xe_10.2.0.1-1.0_i386.deb from otn.oracle.com
2. Double click the deb file, througs you below error message
"Error: wrong architecture i386"
3. Try below command

hmc@hmc-desktop:~/Desktop$ sudo dpkg -i --force-architecture oracle-xe_10.2.0.1-1.0_i386.deb
[sudo] password for hmc:
dpkg - warning, overriding problem because --force enabled:
package architecture (i386) does not match system (amd64)
Selecting previously deselected package oracle-xe.
(Reading database ... 344121 files and directories currently installed.)
Unpacking oracle-xe (from oracle-xe_10.2.0.1-1.0_i386.deb) ...
dpkg: dependency problems prevent configuration of oracle-xe:
oracle-xe depends on libaio (>= 0.3.96) | libaio1 (>= 0.3.96); however:
Package libaio is not installed.
Package libaio1 is not installed.
dpkg: error processing oracle-xe (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
oracle-xe

4. Repeat below command to install missing packages

hmc@hmc-desktop:~/Desktop$ sudo apt-get install libaio*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting libaiksaurus0c102 for regex 'libaio*'
Note, selecting libaiksaurus-1.2-data for regex 'libaio*'
Note, selecting libaiksaurusgtk-1.2-dev for regex 'libaio*'
Note, selecting libaiksaurusgtk-1.2-0 for regex 'libaio*'
Note, selecting libaio1 for regex 'libaio*'
Note, selecting libaiksaurus-1.2-dev for regex 'libaio*'
Note, selecting libaiksaurus0 for regex 'libaio*'
Note, selecting libaiksaurusgtk0c102 for regex 'libaio*'
Note, selecting libaio-dev for regex 'libaio*'
Note, selecting libaiksaurusgtk-1.2-0c2a for regex 'libaio*'
Note, selecting libaiksaurusgtk0 for regex 'libaio*'
Note, selecting libaio for regex 'libaio*'
Note, selecting libaio1-dbg for regex 'libaio*'
Note, selecting libaiksaurus-1.2-0 for regex 'libaio*'
Note, selecting libaiksaurusgtk-bin for regex 'libaio*'
Note, selecting gaiksaurus instead of libaiksaurusgtk-bin
Note, selecting libaiksaurus-1.2-0c2a for regex 'libaio*'
Note, selecting libaiksaurusgtk-dev for regex 'libaio*'
Note, selecting libaiksaurusgtk-1.2-dev instead of libaiksaurusgtk-dev
Note, selecting libaiksaurus-bin for regex 'libaio*'
Note, selecting aiksaurus instead of libaiksaurus-bin
Note, selecting libaiksaurus-data for regex 'libaio*'
Note, selecting libaiksaurus-1.2-data instead of libaiksaurus-data
Note, selecting libaiksaurus-dev for regex 'libaio*'
Note, selecting libaiksaurus-1.2-dev instead of libaiksaurus-dev
The following packages were automatically installed and are no longer required:
ubuntustudio-icon-theme ubuntustudio-gdm-theme ubuntustudio-theme
ubuntustudio-wallpapers
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
aiksaurus gaiksaurus libaiksaurus-1.2-0c2a libaiksaurus-1.2-data
libaiksaurus-1.2-dev libaiksaurusgtk-1.2-0c2a libaiksaurusgtk-1.2-dev
libaio-dev libaio1 libaio1-dbg
The following NEW packages will be installed:
aiksaurus gaiksaurus libaiksaurus-1.2-0c2a libaiksaurus-1.2-data
libaiksaurus-1.2-dev libaiksaurusgtk-1.2-0c2a libaiksaurusgtk-1.2-dev
libaio-dev libaio1 libaio1-dbg
0 upgraded, 10 newly installed, 0 to remove and 1 not upgraded.
Need to get 513kB of archives.
After this operation, 1642kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://tw.archive.ubuntu.com hardy/main libaiksaurus-1.2-data 1.2.1+dev-0.12-5 [318kB]
Get:2 http://tw.archive.ubuntu.com hardy/main libaiksaurus-1.2-0c2a 1.2.1+dev-0.12-5 [25.2kB]
Get:3 http://tw.archive.ubuntu.com hardy/universe aiksaurus 1.2.1+dev-0.12-5 [11.9kB]
Get:4 http://tw.archive.ubuntu.com hardy/main libaiksaurusgtk-1.2-0c2a 1.2.1+dev-0.12-5 [33.8kB]
Get:5 http://tw.archive.ubuntu.com hardy/universe gaiksaurus 1.2.1+dev-0.12-5 [9524B]
Get:6 http://tw.archive.ubuntu.com hardy/main libaiksaurus-1.2-dev 1.2.1+dev-0.12-5 [28.1kB]
Get:7 http://tw.archive.ubuntu.com hardy/main libaiksaurusgtk-1.2-dev 1.2.1+dev-0.12-5 [35.7kB]
Get:8 http://tw.archive.ubuntu.com hardy/main libaio1 0.3.106-8ubuntu1 [8430B]
Get:9 http://tw.archive.ubuntu.com hardy/main libaio-dev 0.3.106-8ubuntu1 [31.4kB]
Get:10 http://tw.archive.ubuntu.com hardy/main libaio1-dbg 0.3.106-8ubuntu1 [11.2kB]
Fetched 513kB in 4s (112kB/s)
Selecting previously deselected package libaiksaurus-1.2-data.
(Reading database ... 346502 files and directories currently installed.)
Unpacking libaiksaurus-1.2-data (from .../libaiksaurus-1.2-data_1.2.1+dev-0.12-5_all.deb) ...
Selecting previously deselected package libaiksaurus-1.2-0c2a.
Unpacking libaiksaurus-1.2-0c2a (from .../libaiksaurus-1.2-0c2a_1.2.1+dev-0.12-5_amd64.deb) ...
Selecting previously deselected package aiksaurus.
Unpacking aiksaurus (from .../aiksaurus_1.2.1+dev-0.12-5_amd64.deb) ...
Selecting previously deselected package libaiksaurusgtk-1.2-0c2a.
Unpacking libaiksaurusgtk-1.2-0c2a (from .../libaiksaurusgtk-1.2-0c2a_1.2.1+dev-0.12-5_amd64.deb) ...
Selecting previously deselected package gaiksaurus.
Unpacking gaiksaurus (from .../gaiksaurus_1.2.1+dev-0.12-5_amd64.deb) ...
Selecting previously deselected package libaiksaurus-1.2-dev.
Unpacking libaiksaurus-1.2-dev (from .../libaiksaurus-1.2-dev_1.2.1+dev-0.12-5_amd64.deb) ...
Selecting previously deselected package libaiksaurusgtk-1.2-dev.
Unpacking libaiksaurusgtk-1.2-dev (from .../libaiksaurusgtk-1.2-dev_1.2.1+dev-0.12-5_amd64.deb) ...
Selecting previously deselected package libaio1.
Unpacking libaio1 (from .../libaio1_0.3.106-8ubuntu1_amd64.deb) ...
Selecting previously deselected package libaio-dev.
Unpacking libaio-dev (from .../libaio-dev_0.3.106-8ubuntu1_amd64.deb) ...
Selecting previously deselected package libaio1-dbg.
Unpacking libaio1-dbg (from .../libaio1-dbg_0.3.106-8ubuntu1_amd64.deb) ...
Setting up libaiksaurus-1.2-data (1.2.1+dev-0.12-5) ...
Setting up libaiksaurus-1.2-0c2a (1.2.1+dev-0.12-5) ...

Setting up aiksaurus (1.2.1+dev-0.12-5) ...
Setting up libaiksaurusgtk-1.2-0c2a (1.2.1+dev-0.12-5) ...

Setting up gaiksaurus (1.2.1+dev-0.12-5) ...

Setting up libaiksaurus-1.2-dev (1.2.1+dev-0.12-5) ...
Setting up libaiksaurusgtk-1.2-dev (1.2.1+dev-0.12-5) ...
Setting up libaio1 (0.3.106-8ubuntu1) ...

Setting up libaio-dev (0.3.106-8ubuntu1) ...
Setting up libaio1-dbg (0.3.106-8ubuntu1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place

5. Try again

hmc@hmc-desktop:~/Desktop$ sudo dpkg -i --force-architecture oracle-xe_10.2.0.1-1.0_i386.deb
dpkg - warning, overriding problem because --force enabled:
package architecture (i386) does not match system (amd64)
(Reading database ... 346600 files and directories currently installed.)
Preparing to replace oracle-xe 10.2.0.1-1.0 (using oracle-xe_10.2.0.1-1.0_i386.deb) ...
Unpacking replacement oracle-xe ...
Setting up oracle-xe (10.2.0.1-1.0) ...
Executing Post-install steps...
-e You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.


hmc@hmc-desktop:~/Desktop$ sudo /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 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]:

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"

6. and edit your ~/.bashrc of id oracle

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


7. If you like rlwrap, define the alias for sqlplus in .bashrc

alias sqlplus='rlwrap sqlplus'

hmc@hmc-desktop:~$ sudo su - oracle
oracle@hmc-desktop:~$ pwd
/usr/lib/oracle/xe
oracle@hmc-desktop:~$ sqlplus "/as sysdba"
-su: sqlplus: command not found
oracle@hmc-desktop:~$ . .bashrc
oracle@hmc-desktop:~$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 15 21:31:23 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> select * from v$instance;

INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
HOST_NAME
----------------------------------------------------------------
VERSION STARTUP_T STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT
----------------- --------- ------------ --- ---------- ------- ---------------
LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO EDITION
---------- --- ----------------- ------------------ --------- --- -------
1 XE
hmc-desktop
10.2.0.1.0 15-SEP-08 OPEN NO 1 STOPPED
ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO XE



Cheers!