Arguably Oracle 10g Enterprise Edition is the most commonly used database for enterprise applications. Financial institutions, government organizations, manufacturing companies, etc. all use this database for their enterprise needs. This blog talks about installing Oracle 10g Enterprise Edition on Kubuntu 8.0.4. Ever since its launch, Kubuntu and its GNOME cousin Ubuntu, have become a very popular flavor of GNU Linux for the desktop. I have been using the Ubuntu versions for quite some time now, and needless to say I have not felt the need to switch back to any other OS ever since.

During my attempts at installing Oracle, I was hugely helped by Tomasz Węgrzanowski blog. He deserves a big thanks. Its available at:
http://t-a-w.blogspot.com/2007/11/installing-oracle-10g-enterprise.html

I followed most of the steps described in Tomasz’s blog, but some I found were not required. So here’s my attempt at a slightly simpler instruction set.

It is assumed that Oracle 10g database software is already downloaded and there is a working version of Kubuntu 8.0.4. These software can be downloaded from:

Also, the steps are for the 32-bit version of the database.

My installation target directory was /opt/oracle10g. Make sure that the target installation directory is writable by the user under which you want to install Oracle.

Oracle installation expects a few binaries in certain directories, namely basename and awk. The installer expects both these binaries to be available under /bin. So we need to create a couple of links to these directories:


prosenjit@vito:~$ sudo ln -s /usr/bin/basename /bin/basename
prosenjit@vito:~$ sudo ln -s /usr/bin/awk /bin/awk

You can test these by invoking /bin/awk and /bin/basename from a console window.

Once this is done, its time to run the installer. To do so change into the directory where you have unzipped the Oracle distribution and invoke the following command:

prosenjit@vito:~$ ./runInstaller -ignoresysprereqs

The -ignoresysprereqs flag instructs the installer to ignore the supported Linux distribution check. Since Kubuntu is still not supported by Oracle as an official release platform, this flag is necessary.

Running the installer should show up a GUI. Follow the instructions till the installer asks you to run one or more scripts. For me there was only one script:

/opt/oracle10g/root.sh

The location of the script depends on the target directory you have chosen and also on the operating system. Once this is done, come back to the GUI and perform the next steps. This should install Oracle properly in your system.

To start Oracle certain environment settings have to be done. Usually I prefer to put these entries into my .bashrc file. That way I do not have to do so everytime I want to start or stop Oracle. Here are my settings:

export ORACLE_HOME=/opt/oracle10g
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_OWNR=prosenjit
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=oradab10 (During installation I had created a database
with the SID oradab10)

Thats about it. Other than this you might need to do some work on the listener.ora and tnsnames.ora file.

My tnsname.ora file has the following:

oradab10 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = oradab10)
)
)

My listenr.ora has the following entry:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle10g)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = oradab10)
(ORACLE_HOME = /opt/oracle10g)
)
)

To start Oracle first you need to start the listener. Open a console window and type in the following command:

prosenjit@vito:~$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-JUL-2008 22:59:26

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

Starting /opt/oracle10g/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /opt/oracle10g/network/admin/listener.ora
Log messages written to /opt/oracle10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 30-JUL-2008 22:59:26
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle10g/network/admin/listener.ora
Listener Log File /opt/oracle10g/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "oradab10" has 1 instance(s).
Instance "oradab10", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

Now start the Oracle database with the following command:

prosenjit@vito:~$ dbstart
Processing Database instance "oradab10": log file /opt/oracle10g/startup.log

To verify that the Oracle process was started invoke the following command at the console:

prosenjit@vito:~$ ps -ef|grep ora

You should get an output similar to:


root 5602 5497 0 21:15 ? 00:00:00 hald-addon-storage: polling /dev/scd0 (every 2 sec)
1000 6277 1 0 22:59 ? 00:00:00 /opt/oracle10g/bin/tnslsnr LISTENER -inherit
1000 6351 1 0 23:00 ? 00:00:00 ora_pmon_oradab10
1000 6353 1 0 23:00 ? 00:00:00 ora_psp0_oradab10
1000 6355 1 0 23:00 ? 00:00:00 ora_mman_oradab10
1000 6357 1 0 23:00 ? 00:00:00 ora_dbw0_oradab10
1000 6359 1 0 23:00 ? 00:00:00 ora_lgwr_oradab10
1000 6361 1 0 23:00 ? 00:00:00 ora_ckpt_oradab10
1000 6363 1 0 23:00 ? 00:00:00 ora_smon_oradab10
1000 6365 1 0 23:00 ? 00:00:00 ora_reco_oradab10
1000 6367 1 0 23:00 ? 00:00:00 ora_cjq0_oradab10
1000 6369 1 0 23:00 ? 00:00:00 ora_mmon_oradab10
1000 6371 1 0 23:00 ? 00:00:00 ora_mmnl_oradab10
1000 6373 1 0 23:00 ? 00:00:00 ora_d000_oradab10
1000 6375 1 0 23:00 ? 00:00:00 ora_s000_oradab10
1000 6379 1 0 23:00 ? 00:00:00 ora_qmnc_oradab10
1000 6383 1 1 23:00 ? 00:00:00 ora_j000_oradab10
1000 6385 1 0 23:00 ? 00:00:00 ora_j001_oradab10
1000 6387 1 0 23:00 ? 00:00:00 ora_j002_oradab10
1000 6389 1 0 23:00 ? 00:00:00 ora_j003_oradab10
1000 6391 1 0 23:00 ? 00:00:00 ora_j004_oradab10
1000 6395 1 0 23:00 ? 00:00:00 ora_q000_oradab10
1000 6397 1 0 23:01 ? 00:00:00 ora_q001_oradab10
1000 6400 6249 0 23:01 pts/1 00:00:00 grep ora

To stop a running instance issue the following command:

prosenjit@vito:~$ dbshut

This will shutdown your database, but the listener is still running. To stop the listener:

prosenjit@vito:~$ lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-JUL-2008 23:03:15

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
The command completed successfully

Thats pretty much it. Oh, I had faced a problem while starting the Oracle instance when I rebooted the machine. It turned out to be a problem with the /etc/oratab file. The entry in my /etc/oratab file is:

oradab10:/opt/oracle10g:Y

The ending Y seemed to make all the difference.

Hope this helps.

Advertisements