5 Jan 2008

oracle 10 on Linux

working with oracle now I wanted a system for experimenting. I find reporting tasks a lot easier to be done from a *nix system as from windows, altough I haven't used oracle so far (experiences from other db systems). Unfortunately my employer mostly favours windows.

So I have decided to install Oracle 10 on a linux system. The first install was tedous, I have decided to download the deb from oracle.com. After finding out there are some apt channels, I have added the following source to /etc/apt/sources.list and installed as follows:

# echo -en "\n# oracle 10\n >> /etc/apt/sources.list"
# echo -en "deb http://oss.oracle.com/debian unstable main non-free\n" >> \
/etc/apt/sources.list
$ wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install -y oracle-xe oracle-xe-client cl-sql-oracle


run the post configuration script:
$ sudo /etc/init.d/oracle-xe configure


make sure the service is running:
$ sudo /etc/init.d/oracle-xe start


then add a new user (make it a dba)
<http://127.0.0.1:8080>

restart the database service:
sudo /etc/init.d/oracle-xe restart


generate a tns file in your home directory, save it unter ~/tnsnames.ora:
<FQDN> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 10.0.0.33)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = <HOSTNAME>)
)
)


replace <FQDN> with fulyl qualified domain name and <HOSTNAME> with the actual hostname.

then you should be able to connect to your database. use sqlplus to do so:
$ sqlplus <user>/<pass>@<HOSTNAME>


Now you should have a setup with one database administrator.