Tuesday, July 21, 2009

Compiling Tora from Sources

Hi folks (Still I'm not sure if anyone reads me) today in talk about Linux I'm going to show you how to compile Tora mostly focused in Slackware 12.2 but also for Ubuntu 9.04 (Ubuntu as well)

Tora it's a really good tool for Developers and Administrators who work with Oracle under Linux. To start we need to download sources from here http://sourceforge.net I'm focusing in Tora 1.3.23 and previous versions, I'm testing version 2.0 without success yet.

PRE-REQUISITES
When I compile from sources I usually do that as Super User in a terminal, so for Slackware use
# su
Password:
if you are using Ubuntu use "sudo -i" to simulate initial login as super user
# sudo -i
[sudo] password for UR-USER:

For slackers we need to install QSCintilla so you should install 1.6 or 1.7 version you can download source file from http://ftp.aarnet.edu.au, uncompress it as shown below
# tar -xzvf qscintilla_1.7.1.orig.tar.gz
# cd QScintilla-1.71-gpl-1.7.1
# cd qt
# qmake qscintilla.pro
# make
# make install

To install in Ubuntu just type:
#apt-get install libqscintilla7 libqscintilla-dev
or install those files using Synaptic.

Before you do something in Ubuntu it's necessary to get basic compilers and QT development tools
# apt-get install build-essential qt3-dev-tools

In addition just for Ubuntu you should not forget to install gcc cpp and g++ packages version 4.2. if you don't do that you'll have a headache trying to compile. The good think is both 4.3 and 4.2 can be together without affect your system
# apt-get install gcc-4.2 gcc-4.2-base cpp-4.2 g++-4.2

After installing those packages you need to make a link between files in order to compile tora as shown below
# cd /usr/bin
# ln -s gcc-4.2 gcc
# ln -s cpp-4.2 cpp
# ln -s g++-4.2 g++

COMPILING TORA
In this case I'm going to compile Tora without KDE, also indicating I'm going to work with Oracle Instant Client and Installing it under /usr, so go ahead

Take your Tora source file and uncompress it
# tar -xjvf tora-1-3-end-of-life.tar.bz2
# cd tora-1-3-end-of-life
# ./configure --prefix=/usr --with-oracle=$ORACLE_HOME --with-oci-version=10G --with-instant-client --without-rpath --disable-new-check --with-qt-dir=/usr/lib/qt --without-kde --with-oracle-includes=/usr/lib/instantclient_11_1/sdk/include --with-oracle-libraries=$ORACLE_HOME --enable-libsuffix=
# make
# make install

Compile job it's done. To try your new Database administration and developer tool, open a terminal and type:
# tora

And Voilá you should be getting to work in Tora GUI



































COMMENTS:
While you are compiling sources if you get an error like that:
../ext/loki/loki-0.1.6/src/SmallObj.cpp:296: error: ‘UCHAR_MAX’ was not declared in this scope
../ext/loki/loki-0.1.6/src/SmallObj.cpp: In member function ‘bool Loki::Chunk::IsCorrupt(unsigned char, size_t, bool) const’:
../ext/loki/loki-0.1.6/src/SmallObj.cpp:428: error: ‘UCHAR_MAX’ was not declared in this scope
../ext/loki/loki-0.1.6/src/SmallObj.cpp:428: error: template argument 1 is invalid
../ext/loki/loki-0.1.6/src/SmallObj.cpp:428: error: invalid type in declaration before ‘;’ token
../ext/loki/loki-0.1.6/src/SmallObj.cpp:460: error: request for member ‘set’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp:475: error: request for member ‘test’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp:486: error: request for member ‘count’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp: In member function ‘bool Loki::Chunk::IsBlockAvailable(void*, unsigned char, size_t) const’:
../ext/loki/loki-0.1.6/src/SmallObj.cpp:522: error: ‘UCHAR_MAX’ was not declared in this scope
../ext/loki/loki-0.1.6/src/SmallObj.cpp:522: error: template argument 1 is invalid
../ext/loki/loki-0.1.6/src/SmallObj.cpp:522: error: invalid type in declaration before ‘;’ token
../ext/loki/loki-0.1.6/src/SmallObj.cpp:527: error: request for member ‘set’ in ‘foundBlocks’, which is of non-class type ‘int’
../ext/loki/loki-0.1.6/src/SmallObj.cpp:536: error: request for member ‘test’ in ‘foundBlocks’, which is of non-class type ‘int’
make[3]: *** [tora-SmallObj.o] Error 1
make[3]: Leaving directory `/mnt/data/linux/src/tora/tora-1-3-end-of-life/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/data/linux/src/tora/tora-1-3-end-of-life/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/data/linux/src/tora/tora-1-3-end-of-life'
make: *** [all] Error 2

It usually happens thanks to your compilers version, you should read prerequisites again step by step to fix that.

Installing Oracle Instant Client 11 under LInux

Hi folks, in Talk about Linux today I'm going to show you how to Install Oracle Instant Client version 11.1.0.6.0, I really hope you'll be able to find this topic useful , this comment is focused above all to Install it in Slackware 12.2 but I'll try to describe in simple manner how to bring it to work in Fedora 11 and Ubuntu 9.04. Ok go ahead.

INSTALLING
First at all download all necessary files from oracle site relating to Instant Client, if you are interested in connect to the Database using jdbc or just type in sqlplus or you're planning to get to work Tora, you must be get all files: basic.zip, jdbc.zip, odbc.zip, sdk.zip, sqlplus.zip and tools.zip

Before you start the process I advise to you to work as root in a terminal, in case you're using Ubuntu just type: sudo -i to simulate initial login and it will work as su. So unzip every one using gzip or GUI Tool of your choice, all content should be inside the same folder ex. instantclient_11_1. Move the folder into /usr/lib ex. /usr/lib/instantclient_11_1 as root owner of course.

make a link of libclntsh.so.11.1 to libclntsh.so and libocci.so.11.1 to libocci.so inside Oracle Client directory as shown bellow
instantclient_11_1# ln -s libclntsh.so.11.1 libclntsh.so
instantclient_11_1# ln -s libocci.so.11.1 libocci.so

SETTING UP
Last part was so easy to do, now we're going to some tricks to setting up Client to getting to work
Slackware 12.2 edit /etc/profile file
Ubuntu 9.04 (Ubuntu as well) edit /etc/bash.bashrc and /etc/profile
put as you need next enviroment Variables:
export ORACLE_BASE="/usr/lib/instantclient_11_1"
export ORACLE_HOME="${ORACLE_BASE}"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ORACLE_BASE}"
export NLS_DATE_FORMAT="YYYYMMDD"
export NLS_LANG=SPANISH_AMERICA.WE8ISO8859P1
export TNS_ADMIN=/etc/oracle/
export SQLPATH="${ORACLE_BASE}"

As you see we difined TNS_ADMIN=/etc/oracle, it means we need to creat a directory under /etc called oracle, here we need to put our setting files sqlnet.ora and tnsnames.ora, it's so important you create both files if you want to get connected to an external Database
sqlnet.ora should contains this one
NAMES.DEFAULT_DOMAIN = your-domain

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

and tnsnames.ora should contains someting like that:
Database_Name.YOUR-DOMAIN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = YOUR-HOST)(PORT = 1521))
)
(CONNECT_DATA =
(SID = DB-SID)
)
)

To have access to SQLPLUS from anywhere you must make a link tu /usr/bin
ln -s /lib/instantclient_11_1/sqlplus /usr/bin/sqlplus

In Ubuntu it's so common when you try to run sqlplus to get the next error:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
Just you need to Set Up correctly LD_LIBRARY_PATH, please read the setting up block above.

TESTING
to test your Oracle Client connection you can use sqlplus, if its ask for password Oracle Client has been installed correctly, if you get some error please check step by step again.

$ sqlplus

SQL*Plus: Release 11.1.0.6.0 - Production on Mar Jul 21 18:22:27 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Introduzca el nombre de usuario:

I really hope this topic to be helpfully for you. See you soon

Enjoy the Life, Get the Slack! to the mack.

Tuesday, June 2, 2009

¿Viejo yo?

Who me? You must be kidding! Tal como dice mi mamá "Viejos los caminos"

Resulta que cada vez que hablo con mi hijo (Pre-adolecente de 11 años) acerca de como fue mi niñez puedo ver como se agigantan sus ojos (como carictura japonesa) porque parece inconsebible la idea de no tener computadora, celular y no digamos muchos canales en la tele, honestamente me recuerda a mi viejo cuando me contaba que con una modendita de medio centavo (increible pero cierto) se podían comprar cantidades abundantes de golosinas pero como diría Don Otto Soberanis eso está más allá de la rebentazón. (de las olas del mar).

Todo ocurrió un día que mi muchacho se paró entre la tele y yo y preguntó: "papi en serio ¿vos mirabas eso?" inmediatamente pensé "¿que me habrá querido decir?" un día que estaba viendo a Simon Templar en la serie El Santo (Roger Moore The Saint) en el cable (canal TCM para quienes de pronto les interese) bueno algo tenía que responder y se me ocurrió la brillante idea de decir lo siguiente "cuando yo era niño" mi hijo inmediatamente hizo un gesto de incredulidad como pensando "mi ruko niño já, a donde iremos a parar"

Inicié contandole que en esa época acá en Guatemalasolo habían 5 canales de televisión (aunque en un inicio era solo el canal 3 pero de eso no me acuerdo mucho) en fin la programación iniciaba hasta las 3 de la tarde con programación infantil, se podía elegir entre el canal del gobierno el desaparecido canal 5 donde daban caricaturas como banner y flappy, el oso yaki y nuka y sin olvidar la canción del ejercito en la cual hasta se podía marchar mientras se cantaba ¿quien no recuerda el coro? "un soldado es un hijo un amigo un hermano, un soldado es un ser querido a quien amamos" esta canción en particular incluía todo el video donde una niña escribía una carta a su querido hermano quien estaba en la armada guatemalteca, ó Cine karate en el 7 después de las luchas con Kike breverman hasta la canción de 7 son!, poco antes de eso con la fascinación de Titanes en el ring. que por cierto que pena la que sufrí cuando Pepino se murió, ó quien no me puede decir quien no estuvo a punto de sufrir un colapso con la vida de Candy White Andrew ó Maco y no digamos Remy que lo llevó la tostada! Sin olvidar a Principe Dinosaurio, Ultra Seven y Ultra Man (Nuestra versión de Power Rangers) ó que tal Hawai Cinco cero, ó el legendario Kojak y así cualquier otra cantidad de series y caricaturas que disfrutamos en nuestra niñéz. En fin, volviendo al tema por el cual escribo esto, pude observar que mi hijo abostesaba cada vez, así que no fue nada dificil ver que será arqueólo puesto que no le interesa mucho el arte rupestre de su padre :-D

Bueno seguimos siendo unos verdaderos niños en el fondo!! aunque algunos quizá muy, pero muy en el fondo porque no se nota!!!