个人工具

“UbuntuHelp:TOraOracleSetUpHowTo”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/tOraOracleSetUpHowTo}} {{Languages|UbuntuHelp:tOraOracleSetUpHowTo}} === Installing tOra with Oracle Support === I couldn't find an appropriate pa...)
 
 
(未显示同一用户的3个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:tOraOracleSetUpHowTo}}
 
{{Languages|UbuntuHelp:tOraOracleSetUpHowTo}}
 
=== Installing tOra with Oracle Support ===
 
=== Installing tOra with Oracle Support ===
I couldn't find an appropriate page specific to Ubuntu for installing tOra and having Oracle support built-in for usage.  If you install tOra for Debian or Hoary, you'll only get the MySQL and PostgreSQL connectors.  After hacking away a bit at the problem, I came up with a somewhat ok solution.
+
I couldn't find an appropriate page specific to Ubuntu for installing tOra and having Oracle support built-in for usage.  If you install tOra for Debian or Hoary, you'll only get the MySQL and [[UbuntuHelp:PostgreSQL|PostgreSQL]] connectors.  After hacking away a bit at the problem, I came up with a somewhat ok solution.
 
+
 
Much of this How-To will be built around the INSTALL included in the tora-1.3.16 (latest at this time of writing) distribution.  Much of this will be copied word-for-word until the Hoary-specific instructions below.
 
Much of this How-To will be built around the INSTALL included in the tora-1.3.16 (latest at this time of writing) distribution.  Much of this will be copied word-for-word until the Hoary-specific instructions below.
 
 
==== Installing Oracle InstantClient ====
 
==== Installing Oracle InstantClient ====
 
From tOra's INSTALL documentation:
 
From tOra's INSTALL documentation:
第22行: 第20行:
 
a) edit /etc/ld.so.conf (add /usr/local/oracle/instantclient10_1)
 
a) edit /etc/ld.so.conf (add /usr/local/oracle/instantclient10_1)
 
b) in /usr/local/oracle/instantclient10_1 create symbolic link:
 
b) in /usr/local/oracle/instantclient10_1 create symbolic link:
ln -s libclntsh.so.10.1 libclntsh.so
+
  ln -s libclntsh.so.10.1 libclntsh.so
 
c) run ldconfig
 
c) run ldconfig
 
d) provide tnsnames.ora
 
d) provide tnsnames.ora
 
e) create dir bin (/usr/local/oracle/instantclient10_1/bin) and  
 
e) create dir bin (/usr/local/oracle/instantclient10_1/bin) and  
symbolic link to sqlplus in bin: (ln -s ../sqlplus)
+
  symbolic link to sqlplus in bin: (ln -s ../sqlplus)
  
 
Apart Oracle's documentation, you do not need to set LD_LIBRARY_PATH.
 
Apart Oracle's documentation, you do not need to set LD_LIBRARY_PATH.
第36行: 第34行:
 
TNS_ADMIN=<path_to_dir_where_is_tnsnames.ora>
 
TNS_ADMIN=<path_to_dir_where_is_tnsnames.ora>
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Things to note:
 
Things to note:
 
* Oracle is now on 10.2, so your instant client downloads should be in the form of instantclient_10_2.
 
* Oracle is now on 10.2, so your instant client downloads should be in the form of instantclient_10_2.
第43行: 第40行:
 
sudo ln -s libocci.so.10.1 libocci.so
 
sudo ln -s libocci.so.10.1 libocci.so
 
</nowiki></pre>
 
</nowiki></pre>
 +
==== Compiling tOra from Source ====
 +
<ol><li>Download the latest version of tOra from http://tora.sourceforge.net/
 +
</li><li>Explode the tarball into a directory of your choice (I will assume /tmp/tora hereafter).
 +
</li><li>From tOra's INSTALL documentation:</li></ol>
  
==== Compiling tOra from Source ====
 
* Download the latest version of tOra from http://tora.sourceforge.net/
 
* Explode the tarball into a directory of your choice (I will assume /tmp/tora hereafter).
 
* From tOra's INSTALL documentation:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
Before you try to compile TOra you will need the following prerequisites:
 
Before you try to compile TOra you will need the following prerequisites:
第54行: 第51行:
 
2. Qt 2.2 or later. Requires an interface compiler of at least version 3.0.
 
2. Qt 2.2 or later. Requires an interface compiler of at least version 3.0.
 
3. Oracle 8i (At least Oracle 8.1.5), it might work partially with earlier
 
3. Oracle 8i (At least Oracle 8.1.5), it might work partially with earlier
versions of Oracle but is as of this version not supported (Please try and
+
  versions of Oracle but is as of this version not supported (Please try and
send me patches).
+
  send me patches).
 
4. PERL 5.
 
4. PERL 5.
 
5. GNU Make.
 
5. GNU Make.
第61行: 第58行:
 
Thats about it, you should be set to start trying.
 
Thats about it, you should be set to start trying.
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== Hoary-Specific requirements ====
 
==== Hoary-Specific requirements ====
 +
<ol><li>In order to build, you will need the development packages for libqt.  The correct package for this install is '''libqt3-mt-dev''', the multi-threaded libraries for Qt.  Any other libqt*-dev package will not provide you with MySQL and [[UbuntuHelp:PostgreSQL|PostgreSQL]] after installation.
 +
</li><li>Here are some additional things I did (at this point) in my environment as a bit of trial-and-error.  I don't know if these have any sway in the end-result, so feel free to experiment and add your results.</li></ol>
  
* In order to build, you will need the development packages for libqt.  The correct package for this install is '''libqt3-mt-dev''', the multi-threaded libraries for Qt.  Any other libqt*-dev package will not provide you with MySQL and PostgreSQL after installation.
+
* Downloaded and installed the libmysqlclient12-dev package.
 
+
* Downloaded and installed the postgresql-dev package.
* Here are some additional things I did (at this point) in my environment as a bit of trial-and-error.  I don't know if these have any sway in the end-result, so feel free to experiment and add your results.
+
* I had set ORACLE_HOME and TNS_ADMIN in my environment during configure and make.
** Downloaded and installed the libmysqlclient12-dev package.
+
* I also ignored the tOra INSTALL doc and added /usr/local/oracle/instantclient_10_2 to my LD_LIBARY_PATH.
** Downloaded and installed the postgresql-dev package.
+
<ol><li>Using '''libqt3-mt-dev''' on my system, configure will blow itself up looking for qt libraries to link with.  I could not find the right combination of --with-qt-* parameters to force the configure script to use the multi-threaded libs, so I patched the script directly.  So Step #2 is copy and paste the below code into a file, I'll call it: /tmp/tora/configure.pl.diff.</li></ol>
** I had set ORACLE_HOME and TNS_ADMIN in my environment during configure and make.
+
** I also ignored the tOra INSTALL doc and added /usr/local/oracle/instantclient_10_2 to my LD_LIBARY_PATH.
+
 
+
* Using '''libqt3-mt-dev''' on my system, configure will blow itself up looking for qt libraries to link with.  I could not find the right combination of --with-qt-* parameters to force the configure script to use the multi-threaded libs, so I patched the script directly.  So Step #2 is copy and paste the below code into a file, I'll call it: /tmp/tora/configure.pl.diff.
+
  
 
===== configure.pl.diff =====
 
===== configure.pl.diff =====
第81行: 第75行:
 
> my $QtSearch="libqt-mt";
 
> my $QtSearch="libqt-mt";
 
681c681
 
681c681
<     ($lib,$QtLibShared)=($file=~/<sup>(.*)\/lib(qt(?:-mt)?3?)[</sup>\/]*$/);
+
<     ($lib,$QtLibShared)=($file=~/^(.*)\/lib(qt(?:-mt)?3?)[^\/]*$/);
 
---
 
---
>     ($lib,$QtLibShared)=($file=~/<sup>(.*)\/lib(qt3?-mt)[</sup>\/]*$/);
+
>     ($lib,$QtLibShared)=($file=~/^(.*)\/lib(qt3?-mt)[^\/]*$/);
 
718c718
 
718c718
 
< ($QtLibShared)=($_[0]=~/\/lib(qt(?:-mt)?3?)[^\/]*$/);
 
< ($QtLibShared)=($_[0]=~/\/lib(qt(?:-mt)?3?)[^\/]*$/);
第101行: 第95行:
 
> kdoc -n $ProgramName -d help/api \$^ -lqt-mt -lkdeui -lkhtml
 
> kdoc -n $ProgramName -d help/api \$^ -lqt-mt -lkdeui -lkhtml
 
</nowiki></pre>  
 
</nowiki></pre>  
 +
<ol><li>Save the file.  Then patch configure with the following command (in the /tmp/tora dir):</li></ol>
  
* Save the file.  Then patch configure with the following command (in the /tmp/tora dir):
 
 
<pre><nowiki>
 
<pre><nowiki>
 
patch -p0 configure.pl configure.pl.diff
 
patch -p0 configure.pl configure.pl.diff
 
</nowiki></pre>
 
</nowiki></pre>
 +
<ol><li>Now configure, make, and make install. (Note, this will install everything in their respective dirs in /usr.  Your regular --prefix, --prefix-bin, and --prefix-lib will do the trick in configure if you want to install elsewhere.</li></ol>
  
* Now configure, make, and make install. (Note, this will install everything in their respective dirs in /usr.  Your regular --prefix, --prefix-bin, and --prefix-lib will do the trick in configure if you want to install elsewhere.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
./configure
 
./configure
 
make && make install
 
make && make install
 
</nowiki></pre>
 
</nowiki></pre>
 +
<ol><li>Once that's completed (and it takes a surprisingly long time), make sure your environment variables are set correctly (TNS_ADMIN, in particular), and run tOra.</li></ol>
  
* Once that's completed (and it takes a surprisingly long time), make sure your environment variables are set correctly (TNS_ADMIN, in particular), and run tOra.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
tora &
 
tora &
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== Test Your Install ====
 
==== Test Your Install ====
Once you've completed and tOra is loaded, check your upper left hand corner of the "New Connection" window.  In the drop-down, you should have Oracle listed and if everything went swimmingly, you should have MySQL and PostgreSQL as well.  
+
Once you've completed and tOra is loaded, check your upper left hand corner of the "New Connection" window.  In the drop-down, you should have Oracle listed and if everything went swimmingly, you should have MySQL and [[UbuntuHelp:PostgreSQL|PostgreSQL]] as well.  
 
+
 
BTW, if something went horribly wrong, a dialog will come up saying something to the effect of "No connectors provided."  And then tOra will die a horrible death.
 
BTW, if something went horribly wrong, a dialog will come up saying something to the effect of "No connectors provided."  And then tOra will die a horrible death.
 
 
==== Uninstallation ====
 
==== Uninstallation ====
 
If you need to uninstall tOra, uninstall is a valid make target and does do what it implies.  So if something goes wrong and you just want to reverse the damage done, type:
 
If you need to uninstall tOra, uninstall is a valid make target and does do what it implies.  So if something goes wrong and you just want to reverse the damage done, type:
第128行: 第119行:
 
make uninstall
 
make uninstall
 
</nowiki></pre>
 
</nowiki></pre>
 
 
 
[[category:CategoryDocumentation]]  
 
[[category:CategoryDocumentation]]  
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年12月6日 (四) 15:45的最新版本


Installing tOra with Oracle Support

I couldn't find an appropriate page specific to Ubuntu for installing tOra and having Oracle support built-in for usage. If you install tOra for Debian or Hoary, you'll only get the MySQL and PostgreSQL connectors. After hacking away a bit at the problem, I came up with a somewhat ok solution. Much of this How-To will be built around the INSTALL included in the tora-1.3.16 (latest at this time of writing) distribution. Much of this will be copied word-for-word until the Hoary-specific instructions below.

Installing Oracle InstantClient

From tOra's INSTALL documentation:

Documented steps tested on Debian linux (testing). It should
work on other Linux distributions, but some (system) filenames
may differ.

1) Oracle instant client
Download client (http://www.oracle.com/technology/software/tech/oci/instantclient/index.html)
choose your platform (linux x86) and then you download "Instant Client Package - Basic",
"Instant Client Package - SQL*Plus", "Instant Client Package - SDK".
Because Debian does not use rpm packages, I used zip archives. After
unzip in appropriate directory (/usr/local/oracle/instantclient10_1)
you need this step to do (some as root, some as oracle user):
a) edit /etc/ld.so.conf (add /usr/local/oracle/instantclient10_1)
b) in /usr/local/oracle/instantclient10_1 create symbolic link:
   ln -s libclntsh.so.10.1 libclntsh.so
c) run ldconfig
d) provide tnsnames.ora
e) create dir bin (/usr/local/oracle/instantclient10_1/bin) and 
   symbolic link to sqlplus in bin: (ln -s ../sqlplus)

Apart Oracle's documentation, you do not need to set LD_LIBRARY_PATH.

Test connection using sqlplus. When succesfull, set environment
variables for users, who will compile tora and use tora:

ORACLE_HOME=/usr/local/oracle/instantclient10_1
TNS_ADMIN=<path_to_dir_where_is_tnsnames.ora>

Things to note:

  • Oracle is now on 10.2, so your instant client downloads should be in the form of instantclient_10_2.
  • I also ran (in the instantclient directory):
sudo ln -s libocci.so.10.1 libocci.so

Compiling tOra from Source

  1. Download the latest version of tOra from http://tora.sourceforge.net/
  2. Explode the tarball into a directory of your choice (I will assume /tmp/tora hereafter).
  3. From tOra's INSTALL documentation:
Before you try to compile TOra you will need the following prerequisites:

1. A unix system which supports Qt.
2. Qt 2.2 or later. Requires an interface compiler of at least version 3.0.
3. Oracle 8i (At least Oracle 8.1.5), it might work partially with earlier
   versions of Oracle but is as of this version not supported (Please try and
   send me patches).
4. PERL 5.
5. GNU Make.

Thats about it, you should be set to start trying.

Hoary-Specific requirements

  1. In order to build, you will need the development packages for libqt. The correct package for this install is libqt3-mt-dev, the multi-threaded libraries for Qt. Any other libqt*-dev package will not provide you with MySQL and PostgreSQL after installation.
  2. Here are some additional things I did (at this point) in my environment as a bit of trial-and-error. I don't know if these have any sway in the end-result, so feel free to experiment and add your results.
  • Downloaded and installed the libmysqlclient12-dev package.
  • Downloaded and installed the postgresql-dev package.
  • I had set ORACLE_HOME and TNS_ADMIN in my environment during configure and make.
  • I also ignored the tOra INSTALL doc and added /usr/local/oracle/instantclient_10_2 to my LD_LIBARY_PATH.
  1. Using libqt3-mt-dev on my system, configure will blow itself up looking for qt libraries to link with. I could not find the right combination of --with-qt-* parameters to force the configure script to use the multi-threaded libs, so I patched the script directly. So Step #2 is copy and paste the below code into a file, I'll call it: /tmp/tora/configure.pl.diff.
configure.pl.diff
278c278
< my $QtSearch="libqt(?:-mt)?";
---
> my $QtSearch="libqt-mt";
681c681
< 						    ($lib,$QtLibShared)=($file=~/^(.*)\/lib(qt(?:-mt)?3?)[^\/]*$/);
---
> 						    ($lib,$QtLibShared)=($file=~/^(.*)\/lib(qt3?-mt)[^\/]*$/);
718c718
< 							 ($QtLibShared)=($_[0]=~/\/lib(qt(?:-mt)?3?)[^\/]*$/);
---
> 							 ($QtLibShared)=($_[0]=~/\/lib(qt3?-mt)[^\/]*$/);
901c901
<     findFile("^libqt(-mt)?3\\.a",sub {
---
>     findFile("^libqt3?-mt\\.a",sub {
923c923
< 	findFile("^libqt(-mt)?\\.a",sub {
---
> 	findFile("^libqt-mt\\.a",sub {
1529c1529
< 	kdoc -n $ProgramName -d help/api \$^ -lqt -lkdeui -lkhtml
---
> 	kdoc -n $ProgramName -d help/api \$^ -lqt-mt -lkdeui -lkhtml
  1. Save the file. Then patch configure with the following command (in the /tmp/tora dir):
patch -p0 configure.pl configure.pl.diff
  1. Now configure, make, and make install. (Note, this will install everything in their respective dirs in /usr. Your regular --prefix, --prefix-bin, and --prefix-lib will do the trick in configure if you want to install elsewhere.
./configure
make && make install
  1. Once that's completed (and it takes a surprisingly long time), make sure your environment variables are set correctly (TNS_ADMIN, in particular), and run tOra.
tora &

Test Your Install

Once you've completed and tOra is loaded, check your upper left hand corner of the "New Connection" window. In the drop-down, you should have Oracle listed and if everything went swimmingly, you should have MySQL and PostgreSQL as well. BTW, if something went horribly wrong, a dialog will come up saying something to the effect of "No connectors provided." And then tOra will die a horrible death.

Uninstallation

If you need to uninstall tOra, uninstall is a valid make target and does do what it implies. So if something goes wrong and you just want to reverse the damage done, type:

make uninstall