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:
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.
apt-get source tora
Next we will install our Oracle packages. Just like last time, we do this:
sudo alien -i *.rpm
Now that we laid the groundwork, it’s time to set up the build environment.
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
$ cat ~/.xsessionrc
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
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
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!
Interested in working with Brad? Schedule a tech call.