How to use Linux as an Oracle client?
Par Pierrick, jeudi 21 septembre 2006 à 19:26 / categorie: GNU/linux / tags: / #80 / rss
I'm using Linux Ubuntu Dapper Drake 6.06. Last time I tried to install an Oracle client under Linux, I didn't succeed. It was only one year ago. Today, I need to run an Oracle client on my Linux box and I can't believe how easy it was to install. All you need is the oracle-client from Oracle. In this short post I explain how to do this.
First step is to add Oracle repository to your packages repository list. In your /etc/apt/sources.list, insert:
deb http://oss.oracle.com/debian unstable main non-free
Then you have to update your local packages index and install the oracle-xe-client packages. The Oracle client package is 25MB fat, so it make take some time to download. Be also warned that the installation procedure checks that you have at least 500MB of RAM and 1GB of swap space. I only have 996MB of swap, the installer said it was not enough and that the procedure had failed, but it works perfectly, so I suppose it was just a warning.
$ sudo apt-get update $ sudo apt-get install oracle-xe-client
In order to use sqlplus, the Oracle command client, you need to set some environment variables. Copy paste these variables in your ~./.profile . Here follows what I've found in the /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/scripts/sqlplus.sh file:
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` export SQLPATH=$ORACLE_HOME/sqlplus export PATH=$ORACLE_HOME/bin:$PATH
By default, the installer didn't create the well known tnsnames.ora configuration file. So, I create /etc/tnsnames.ora by hand, with the following content:
TALEND =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = talend-dbms)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = TALEND)
)
)
The final step is to try sqlplus:
$ sqlplus root@TALEND [...] SQL> select count(*) from sales; COUNT(*) ---------- 10000 SQL>
Commentaires
Aucun commentaire pour le moment.
Ajouter un commentaire
Les commentaires pour ce billet sont fermés.