blog van Paul Hildebrand
Posts tagged TOra
Install TOra with Oracle in Ubuntu 12.04 or Mint 13
Jul 10th
My experience is that the majority of Oracle DBA’s work with TOAD by Quest Software. Alas there is no version for linux. Although not as good as Toad there is an alternative for Linux, ie TOra. Ubuntu supplies it with its distribution, but sadly without oracle support. The rest of the article will help you to install TOra on Ubuntu 12/Mint 13 with Oracle support.
Fix any dependencies needed building TOra:
$ sudo apt-get install fakeroot alien libaio1 g++ gcc autoconf automake libqscintilla2-dev
Before going further we have to make sure the source repositories in apt are enabled.
Open with an editor the file /etc/apt/sources.list and add the following line (if not already there)
deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
Install the TOra build dependencies:
$ sudo apt-get build-dep tora
Create a directory for the build and download the sources:
$ mkdir tora $ cd tora $ apt-get source tora
Oracle client software
Next get the oracle client software. You will find it relatively quickly with google using the following search criteria: Oracle Instant Client Downloads for Linux. In this article we assume your computer has a x64 architecture, download the i386 versions when appropriate.
Download the following files (any version will do):
- oracle-instantclient11.2-basiclite-11.2.0.3.0-1.x86_64.rpm
- oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
- oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
Install the oracle client using alien
$ sudo alien -iv *.rpm
Environment variables
Add the following environment variables to ~/.bashrc
export ORACLE_HOME="/usr/lib/oracle/11.2/client64" export LD_LIBRARY_PATH="${ORACLE_HOME}/lib" export TNS_ADMIN="${ORACLE_HOME}"
Also add these variables to ~/.pam_environment
ORACLE_HOME DEFAULT=/usr/lib/oracle/11.2/client64 TNS_ADMIN DEFAULT=/usr/lib/oracle/11.2/client64
And add the LD_LIBRARY_PATH to the ldconfig:
$ echo '/usr/lib/oracle/11.2/client64/lib' | sudo tee -a /etc/ld.so.conf.d/oracle.conf $ sudo ldconfig
Now reload your terminal or execute the above export statements to enable them.
Build TOra
Add an extra symbolic link to fix some compatibility issues:
$ sudo ln -s /usr/include/oracle/11.2/client64 $ORACLE_HOME/include
Open the file debian/rules and add the following line:
DEB_CMAKE_EXTRA_FLAGS := -DORACLE_PATH_INCLUDES=/usr/include/oracle/11.2/client64 -DORACLE_PATH_LIB=/usr/lib/oracle/11.2/client64/lib -DENABLE_ORACLE=1
Now we can finally build TOra:
$ fakeroot debian/rules binary
Install TOra:
$ sudo dpkg -i ../tora_2.1.3-1build2_amd64.deb
You might need to restart or logout before it works correctly.
Credits
Real credits for this article go to Brad Hudson who had already written an article on how to install oracle support for TOra. I have just added some extra tips to make it work for Ubuntu 12/Mint 13.