Installing TOra with Oracle Support on Ubuntu 10.10

Posted in: Technical Track

Good afternoon sports fans. I’ve had a couple of requests to update my world famous blog on installing TOra. Frankly I have been wanting to get this out for a while but duties other than blogging have taken precedence. That and I think my blogging ran out of entropy and needed some other IO to get going again. Well it’s now time for you all to let out that breath you have been holding since the ‘perfect 10’ was released (on 10.10.10 no less).

Once again the instructions are much the same, but there was a couple of things I had to change which were mostly around the order of things. I installed this on Kubuntu 10.10 x86_64 systems with the newest Oracle 11.2 client. The version of TOra this time around is 2.1.2 which works fine except for one really really frustrating thing, that I will mention at the end to keep you in suspense. I ran through this 3 times on 3 separate systems (VM, work and home) and in all cases I got through it mostly unharmed with only a few humps. So here we go, it’s time to…

Make some place to build the package

Normally I will create a safe haven for this type of work, away from the other clutter on my drive. When doing this I did it all under ~/Documents/blogs/tora-meercat with subdirectories for oracle and building tora separate. It’s all up to you, but I keep it sorted because they probably will not get deleted for my normal retentions of ~30 years (and counting).

Hereby referred to as /path/to/tora.

Get the packages

First thing you’ll want is the newest oracle client packages. You can get them from the Oracle instant client download page. You need the following:

  • oracle-instantclient11.2-basiclite-11.2.0.2.0.x86_64.rpm
  • oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm
  • oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm

Now we need the utilities and dependencies to build the package. I had to swap the order from last time because the TOra build deps now need packages that we used to install later. Say yes to any suggestions it has, some of them may already be installed.

sudo apt-get install libqt3-mt-dev libqt3-compat-headers libqscintilla-dev build-essential g++ gcc autoconf automake flex zlib1g-dev docbook-xsl debhelper alien libaio1 dpatch fakeroot xsltproc texi2html texinfo libqt3-mt-psql libqt3-mt-odbc config-package-dev cmake qt4-dev-tools

And now the TOra build deps.

sudo apt-get build-dep tora

Now go to your build directory and get the source.

cd /path/to/tora
apt-get source tora

Next we will install our Oracle packages. Just like last time, we do this:

sudo alien -i *.rpm

Environment Variables

Now that we laid the groundwork, it’s time to set up the build environment.

export ORACLE_HOME="/usr/lib/oracle/11.2/client64"
export LD_LIBRARY_PATH="${ORACLE_HOME}/lib"
export TNS_ADMIN="${ORACLE_HOME}"

This time around we did not set the CMAKE environment. The reason is simple. It did not work, and was apparently not needed. I am not sure why, but here we are. Instead we’re back to making a symbolic link to the oracle includes.

sudo ln -s /usr/include/oracle/11.2/client64 $ORACLE_HOME/include

Once again I want to ensure that I the above environment variables are available when we run this in our X desktop. We’ve done this different ways in past blogs, today we’re going to add them to our .xsessionrc.


$ cat ~/.xsessionrc
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME

You’ll need to log out and in again for it to take effect, so run it from the command line until you get a chance to do that.

Increment the version (not required)

Feel free to skip to the next section.

This time I wanted to choose the “increase my package version to avoid update issues” method we’ve discussed in previous editions of this blog. Check back to the older blogs to see the other methods of avoiding updates overwriting your package, but I like to mix things up a bit. If you want to do this, change the bottom to whatever you like but a note that the system is VERY picky about the formatting. Watch all the spacing and line breaks, they all need to be there. There is also a double space between the email address and date, so watch for it.


cat << EOF >> /path/to/tora/tora-2.1.2/debian/changelog
> tora (2.2.2-1) unstable; urgency=low
>
> * Package renumbered to prevent updates from clobbering it
> -- Brad Hudson Mon, 10 Jan 2011 12:24:00 -0500
> EOF

Interlude. Do you recall a few weeks back when I posted a comment that the blog was about done? This is where I was. Then 2+ weeks of back to back (to back) raging infernos. Then a bit of time to decompress. Now, where were we … :)

Compile and create the .deb file

Easy as pie. Here’s a twist, run this using the time util and see how long it takes to compile. On my work PC it took 6m57.792s, give or take a ms.


time fakeroot debian/rules binary

Install it

If all goes to plan you should have a .deb package file, install it as below. Your package name may differ if you chose not to increment the version as I had above.


sudo dpkg -i tora_2.2.2-1ubuntu1_amd64.deb

To test it, simply run tora in the same shell in which you compiled it. Your menu item will not see Oracle until you log out and in again.

One really frustrating thing

I have run through this process on at least 3 systems. It works on all 3 and functions correctly while I am using it, I can run basic sql and browse the schema (which is about all I really ever use it for). It also has a problem on all 3. No matter where I launch the program from it will hang when I try to close it. I have been unable to locate the source of grief, but I have ruled out connectivity for sure because I have done this from both local and remote network segments. It does not have this issue when Oracle support is not available. I never had this issue in previous versions, it may be a bug. I ran an strace on the program and once it hangs it does not seem to be doing anything, but I can still ctrl-c (or xkill) the program. I have not been able to find any open bug reports on it but my time has been very limited. If you find something out about this or find a cure please post a comment. I’ll do same if I get to solving it.

That’s it for this edition. I guess I am only two months away from having another one of these due out. Thanks for reading!

email
Want to talk with an expert? Schedule a call with our team to get the conversation started.

About the Author

Brad is just a guy, you know? I fought my way up in the world tooth-and-nail. Starting in broadcasting and music to travel to computer support to development of mid size xBase programs. Finally I settled into the wonderful world of system administration where I have honed my skills doing many diverse tasks. I started using Solaris in the mid 80's and built my first Linux system on a 386 using 30-some floppy disks and never looked back.

8 Comments. Leave new

Tweets that mention Installing TOra with Oracle Support on Ubuntu 10.10 (Maverick Meercat) | The Pythian Blog -- Topsy.com
February 14, 2011 10:01 am

[…] This post was mentioned on Twitter by Alex Gorbachev, Larry King. Larry King said: Installing TOra with Oracle Support on Ubuntu 10.10 (Maverick … https://bit.ly/gHuEXE #Ubuntu […]

Reply

hi,

thanks for this howto, now I have Tora on my Maverick “pure” Ubuntu (not kubuntu).

A Tip: if someone have the error like “qmake-qt4 not found blabalba” this is because the alternative of qmake is set on qt3 and we need qt4, so the tip is:

sudo update-alternatives –config qmake
choose the qmake-qt4 (for me is 2)
retry with: time fakeroot debian/rules binary

bye :)

Reply

I have another tip about another error:

I’m using “old” full oracle client 11.1 but this error can appear for everyone:

dpkg-shlibdeps: failure: no dependency information found for /oracle/home/path/to/libclntsh.so.ORANUM.VERSION (used by debian/tora/usr/bin/tora)

According with this article (https://www.debian-administration.org/articles/529) the dependency can be safely ignored. So we can modify debian/rules adding this rule:

vim debin/rules
under: DEB_DBG_PACKAGES := tora-dbg
add: DEB_DH_SHLIBDEPS_ARGS := — –ignore-missing-info
:wq

retry with: time fakeroot debian/rules binary

Tora work good for me :)

Reply

sorry i need help
I have followed this guide, but i have this error.

I have made some difference with guide:
1 I don’t use fakeroot, but “sudo su”
2 I don’t make “Increment the version (not required)”
3 in “Environment Variables” I have made variables in runtime (export each login)

https://pastebin.com/dvkx8Kz1

Reply

On Ubuntu 10.10 32-bit with full client 11.2, the line in debian/rules that worked for me is:

DEB_DH_SHLIBDEPS_ARGS := -X*

Compiled without any other issues after that. Working great. :-)

Reply
Trenton D. Adams
April 19, 2011 4:06 pm

For me, this does not work at all. I am required to issue “./configure –with-oracle=$ORACLE_HOME” and “make install” which goes to /usr/local/tora

Reply
Install TOra with Oracle in Ubuntu 12.04 or Mint 13
July 10, 2012 3:49 pm

[…] Real credits for this article go to Brad Hudson who had already written an article on how to install oracle support for TOra. I hav just added some extra tips to make it work for […]

Reply

I have converted rpm packages from here https://www.oracle.com/technetwork/topics/linuxsoft-082809.html to deb but I can’t get oracle thin or oracle tns option. I’m using linux mint 17.0 (qiana). Can you give me more tricks? Thx

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *