Aario's blog about life and technology

Eclipse SQl Explorer, Oracle 11g and Kubuntu 11.04

Hi Guys,
This is my long story about how I managed to connect my Kubuntu 11.04 to Oracle SQL to work with those tables in Oracle Database Server in our office. For accessing tables in the database and working with SQL queries, first I searched appdb.winehq.org to see whether TOAD is working on wine or not (As you may know, TOAD is a Tool for Oracle Advanced Database and Wine is a compatibility layer which enables Linux users run Windows applications). But I figured out that TOAD is not fully compatible with wine because all the scores there was gold or silver. Not platinium.
Then I decided to run Tora. An open-source alternative to TOAD. Tora for Kubuntu 11.04 won’t support Oracle. It’s only for mysql (And God knows how many hours I spend to try all ways of getting it to work with oracle but no success!).
Then I headed for SQL Explorer. But it needs several dependencies to run. As it needs oracle to connect to SQL databases, I downloaded these three packages:

  • oracle-instantclient11.2-basiclite-11.2.0.1.0-1.i386.rpm
  • oracle-instantclient11.2-devel-11.2.0.1.0-1.i386.rpm
  • oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.i386.rpm

For links, I searched the first name in google, and it took me to Oracle Client download page. In the opened page I searched names and I found links to download them. But downloading them was another story!
Oracle site asked me for accepting the term mentioned above of the download links page to be able to click on links themselves! Then it requested me a user name and password. Scince I do not have it, I tried to create one. It lead me to a form with several fields from my first name and last name to what my coligoues use to call me during launch in office! ๐Ÿ˜€ Unfurtunately some of combo lists in that form wasn’t compatible with linux. I mean in Firefox and Chromium I wan’t able to open them to select from. Thus I aksed the good guys in http://www.bugmenot.com to provide me a user name and password to download from http://www.oracle.com. Their first password worked just like a charm! ๐Ÿ˜€
After I went back to the oracle site I mentioned above and downloaded those three packages, I put them all in one folder (You say oracleclient), opened a terminal window and went to the folder and typed:

sudo su
apt-get install alien
alien -i oracle-instantclient11.2-*.rpm

It took a while for it to install them all. Then I ran:

apt-get install sun-java6-jre

Remember that the default-jre package which install open-source jre has problems with combo-boxes in SQLExplorer windows and that the program crashed several times with it for me. I prefered to install the sun proprietary version.
I downloaded SQL Explorer v3.6.1 from here. Then I extracted the downloaded the .tgz file to /opt/SQLExplorer. The folder which I created myself (You need to know how to create and extract into a system folder with root permissions).
The I just clicked and ran the sqlexplorer file in the extraction folder. And it started working.


For cunnecting to the database I clicked on Create new connection profil button on top left corner of work-space and it opened a new window.

In opened window I entered a name for the new connection. The combo-box there didn’t contain the work Oracle in it’s list. So to add the Oracle as a driver for this multi-purpose SQL software, I clicked on Add/Edit Drivers button. It opened a new window.
In the new window, on left column, I double clicked SQL Explorer and then JDBC Drivers under in. It opened a long list on right. For the first time, the work Oracle Thin Driver was with a x sign beffore it. So it was disabled. The only enabled option was JDBC ODBC Bridge. So I selected theย Oracle Thin Driver and clicked on Edit button. It opened a new window.
In the new window, I went to Extra Class Path tab. Clicked on Add Jars and from the opened dialoge I searched the path “/usr/lib/oracle/11.2/client/lib” for “ojdbc6.jar” file and opened it. Then clicked on List Drivers and after many seconds it filled the Drvier Class Name edit box automatically with “oracle.jdbc.OracleDriver” (Actually I don’t think you can enter this text by hand. You must find the driver files installed by the rpm packages I told you about and then it will automatically fill that box for you). Then I clicked on Ok. On the window opened in background the Item Oracle Thin Driver was now with a tick before it just like in screen shot. So I selected it and clicked Ok. Back in the first window, I selected the Oracle Thin Driver from the Driver combo-box and it filled the URL edit box automatically with:

jdbc:oracle:thin:@<server>:1521:<database_name>

I entered IP address of our Oracle Database server in office as <server>. I held the port to 1521. I entered the TNS Name for <database_name>. Selected Auto Login and Entered my user name and password. And Finally I clicked Ok.
In the Connections List on left column I could see my created connection. So I Opened it and after a while it connected to the database. Hiewwwwwwwwwwh!;)
That wasn’t as easy as this. Actually I tried several ways to get it work for many hours! here I’m just told you the final solution.

Have a nice day and don’t hesitate to tell me about your opinions and questions in comments:)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s