July 9, 2009

Oracle 10g on Ubuntu 9.04 x86_64

I installed Oracle 10g for testing a particular piece of code. My development environment is:
$ uname -om ; lsb_release -a|grep ^De
x86_64 GNU/Linux
Description:    Ubuntu 9.04
and before installing I read some horror stories of people trying to run Oracle on Debian and/or x86_64. These were old posts, so I went on to try it out. In the end I had no hitches and it just works. :) After downloading the deb package, I installed some core libraries someone recommended. I have no idea if all of these are required (why gcc/make when this is a binary package?) but for the reference, this is what I installed before the oracle deb. BTW, that blog has good tuning tips.
sudo apt-get install gcc libaio1 lesstif2 lesstif2-dev make libc6 libc6-i386 libc6-dev-i386 libstdc++5 lib32stdc++6 lib32z1 ia32-libs
Oracle was a breeze to install:
$ dpkg -i --force-architecture oracle-xe-universal_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 ... 234278 files and directories currently installed.)
Unpacking oracle-xe-universal (from oracle-xe-universal_10.2.0.1-1.0_i386.deb) ...
Setting up oracle-xe-universal (10.2.0.1-1.0) ...
update-rc.d: warning: /etc/init.d/oracle-xe missing LSB information
update-rc.d: see 
Executing Post-install steps...
-e You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.


 $ /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]:8888

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:8888/apex"
Apex works so I am happy, but how about a command line console? Ah, there's SQL*Plus. I needed to set up some environment variables (note the unorthodox install location of the binary), which I based on the packaged shell script "/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh" I put this in /etc/environment:
export ORACLE_HOME="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server"
PATH="${PATH}:${ORACLE_HOME}/bin"
export ORACLE_SID=XE
Testing the admin account, and checking the platform. Oracle is running in 32-bit mode, while the platform is 64-bit.
$ sqlplus SYS AS SYSDBA

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 9 15:10:54 2009

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

Enter password:

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

SQL> select platform_name from v$database;

PLATFORM_NAME
--------------------------------------------------------------------------------
Linux IA (32-bit)
The SQL*Plus help files need to be manually loaded:
cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/sqlplus/admin/help
  sqlplus SYS AS SYSDBA @helpdrop.sql
  sqlplus SYS AS SYSDBA @hlpbld.sql helpus.sql
In conclusion, I was happy to get it running without running a virtual Centos server. =)

No comments: