Thread: [cx-oracle-users] newbie question : sqlplus not working but can get cx_oracle to send sql queries
Brought to you by:
atuining
From: hari j. <ha...@gm...> - 2010-09-08 17:01:15
|
Hi , First of thanks to Anthony and cxtools/computronix for this excellent module. I am using it successfully on windows, connection to a Oracle 10g database from 32 bit windows XP running python 2.6. However I wanted to switch my development environment to Ubuntu Lucid 10.04 running in 64 bit mode. After some effort I could get the cx_Oracle version 5.0.4 to install with the oracle 11.1 , 32 bit , i386 instantclient libraries. My scripts all work just fine despite the hybrid mode i.e 64 bit kernel, python and 32 bit instantclient libraries. My question pertains to getting oracle sqlplus to work with the same setup. Since its a 64 bit system I do not have Oracle 10g -Express edition installed on it. The only thing oracle I have is the 11_1 instantclient. When I launch sqlplus I get the following error: harijar@ubuntuinux64bit:~/instantclient/instantclient_11_1$ ./sqlplus Error 6 initializing SQL*Plus Message file sp1<lang>.msb not found SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory I do have the ORACLE_HOME and LD_LIBRARY_PATH and SQLPATH and PATH pointing to the instantclient/instantclient_11_1 directory. I know this is a cx_Oracle mailing list , but I was hoping that someone here knows how to solve this problem. So my question is how can I have my cake ( cx_oracle with instantclient 11_1) and eat it too , i.e use sqlplus that comes with version 11_1 on my 64 bit linux box. Initially on this same machine , I could get the sqlplus that came with instantclient 10_1 to work just fine. But I could not compile cx_Oracle to work with 10.1 instantclient libraries . So I switched to 11_1 Thanks in advance Hari |
From: Anthony T. <ant...@gm...> - 2010-09-08 17:17:22
|
Hi, You're welcome for the module. I'm happy to see others making as good use of it as I already am. :-) I am not at my Linux box at the moment but I believe you should not need to set ORACLE_HOME at all when using the instant client. You also need to set LD_LIBRARY_PATH to the path where the libraries are actually found. From your description below it looks like you were setting it to the base directory. Then again, I am using the RPM package to install the instant client so it may be set up differently. Rather than bother the mailing list with this, though, please send a listing of what you have to me personally and I'll look at it tonight if I get a chance. Also, please list all of the different versions of Oracle that you have installed on your machine and their locations and versions. It is most definitely possible to have both SQL*Plus and cx_Oracle working on the same machine! Anthony On Wed, Sep 8, 2010 at 11:01 AM, hari jayaram <ha...@gm...> wrote: > Hi , > First of thanks to Anthony and cxtools/computronix for this excellent > module. I am using it successfully on windows, connection to a Oracle > 10g database from 32 bit windows XP running python 2.6. > > However I wanted to switch my development environment to Ubuntu Lucid > 10.04 running in 64 bit mode. > > After some effort I could get the cx_Oracle version 5.0.4 to install > with the oracle 11.1 , 32 bit , i386 instantclient libraries. > My scripts all work just fine despite the hybrid mode i.e 64 bit > kernel, python and 32 bit instantclient libraries. > > My question pertains to getting oracle sqlplus to work with the same setup. > Since its a 64 bit system I do not have Oracle 10g -Express edition > installed on it. The only thing oracle I have is the 11_1 > instantclient. > > When I launch sqlplus I get the following error: > > harijar@ubuntuinux64bit:~/instantclient/instantclient_11_1$ ./sqlplus > Error 6 initializing SQL*Plus > Message file sp1<lang>.msb not found > SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory > > > I do have the ORACLE_HOME and LD_LIBRARY_PATH and SQLPATH and PATH > pointing to the instantclient/instantclient_11_1 directory. > > > I know this is a cx_Oracle mailing list , but I was hoping that > someone here knows how to solve this problem. > > So my question is how can I have my cake ( cx_oracle with > instantclient 11_1) and eat it too , i.e use sqlplus that comes with > version 11_1 on my 64 bit linux box. > Initially on this same machine , I could get the sqlplus that came > with instantclient 10_1 to work just fine. But I could not compile > cx_Oracle to work with 10.1 instantclient libraries . So I switched to > 11_1 > > Thanks in advance > > Hari > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Mark H. <mh...@pi...> - 2010-09-08 19:07:06
|
On 9/8/10 10:01 AM, hari jayaram wrote: > My question pertains to getting oracle sqlplus to work with the same setup. > Since its a 64 bit system I do not have Oracle 10g -Express edition > installed on it. The only thing oracle I have is the 11_1 > instantclient. Here's a setup that might work: http://stackoverflow.com/questions/764871/installing-oracle-instantclient-on-linux-without-setting-environment-variables > |
From: Robert <web...@gm...> - 2010-09-08 20:21:30
|
This has nothing to do with cx_oracle. but if I were you I would also have echo'd those env variables and show to the people you're asking for help. On Wed, Sep 8, 2010 at 1:01 PM, hari jayaram <ha...@gm...> wrote: > harijar@ubuntuinux64bit:~/instantclient/instantclient_11_1$ ./sqlplus > Error 6 initializing SQL*Plus > Message file sp1<lang>.msb not found > SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory > |
From: hari j. <ha...@gm...> - 2010-09-08 20:40:10
|
I didnt send the follow up email to the list ..but here is the setup. I have the following set to the directory that has the *.so files export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/hari/instantclient/instantclient_11_1" export PATH="$PATH:/home/hari/instantclient/instantclient_11_1" export SQLPATH="/home/hari/instantclient/instantclient_11_1" export ORACLE_HOME="/home/hari/instantclient/instantclient_11_1" That directory has ~/instantclient/instantclient_11_1$ ls -1 adrci BASIC_README genezi glogin.sql libclntsh.so.11.1 libnnz11.so libocci.so.11.1 libociei.so libocijdbc11.so libsqlplusic.so libsqlplus.so ojdbc5.jar ojdbc6.jar sdk sqlplus SQLPLUS_README To compile and install cx_office . I had also symlinked libclntsh.so.11.1 to libclntsh.so in the same directory and set the ORACLE_HOME I could then sudo setup.py build and , sudo -E setup.py install the cx_oracle module. The module works just fine ON This setup : :~/instantclient/instantclient_11_1$ ./sqlplus Error 6 initializing SQL*Plus Message file sp1<lang>.msb not found SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory It is quite weird. Sometimes it gives the above error and other times it Segmentation faults I unset ORACLE_HOME and removed the symlink from libclntsh.so.11.1 to libclntsh.so and I get the same behavior, segfaults or Error 6 with SP2-0750. On the same setup with all the environment variables setup to point to 11_1, I can still run the 10_1 version of sql*plus So this is indeed strange behavior. I was wondering if it is trivial to compile cx_oracle to run with the 10_1 client libraries, so I can have a homogenoeous system. Thanks again..and hoping there is a quick fix Hari On Wed, Sep 8, 2010 at 4:21 PM, Robert <web...@gm...> wrote: > This has nothing to do with cx_oracle. > but if I were you I would also have echo'd those env variables and > show to the people you're asking for help. > > > On Wed, Sep 8, 2010 at 1:01 PM, hari jayaram <ha...@gm...> wrote: >> harijar@ubuntuinux64bit:~/instantclient/instantclient_11_1$ ./sqlplus >> Error 6 initializing SQL*Plus >> Message file sp1<lang>.msb not found >> SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory >> > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Anthony T. <ant...@gm...> - 2010-09-09 03:27:22
|
On Wed, Sep 8, 2010 at 2:40 PM, hari jayaram <ha...@gm...> wrote: > I didnt send the follow up email to the list ..but here is the setup. > > I have the following set to the directory that has the *.so files > > export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/hari/instantclient/instantclient_11_1" > export PATH="$PATH:/home/hari/instantclient/instantclient_11_1" > export SQLPATH="/home/hari/instantclient/instantclient_11_1" > export ORACLE_HOME="/home/hari/instantclient/instantclient_11_1" I am using the instant client RPM so it lays things out a little differently. Specifically, I have folders like this /usr/lib/oracle/11.2/client/bin /usr/lib/oracle/11.2/client/lib It also adds the file /etc/ld/so.conf.d/oracle-instantclient11.2.conf which sets the library loader path automatically. What that tells me, though, is that you should NOT set ORACLE_HOME. Its also possible that you have another installation of Oracle somewhere in the PATH or LD_LIBRARY_PATH that is conflicting. Make sure the one you want is FIRST in the path -- from the above you are setting them as the LAST item which means anything already set there is going to cause problems. Take a look at those values and see what is in there already. > I was wondering if it is trivial to compile cx_oracle to run with the > 10_1 client libraries, so I can have a homogenoeous system. It should not be a problem. What problem are you seeing? > Thanks again..and hoping there is a quick fix I think so. Just look more carefully at your environment variables. :-) Anthony |
From: hari j. <ha...@gm...> - 2010-09-13 13:33:49
|
Thanks Everyone , I followed the instructions on stackoverflow posted by Mark Harrison. The instructions called for putting everything manually into /usr/include ( all the *.h files ) /usr/lib ( the *.so files ) and /etc ( the tnsanames.ora). ANd this then gets the instantclient version 11_1 working. This brute force approach did get things working..It may be that the sqlplus binary was not getting the libraries from my LD_LIBARRY_PATH because putting the *.so containing directory at the start still gave me the same error. Thanks for your help Hari On Wed, Sep 8, 2010 at 11:19 PM, Anthony Tuininga <ant...@gm...> wrote: > On Wed, Sep 8, 2010 at 2:40 PM, hari jayaram <ha...@gm...> wrote: >> I didnt send the follow up email to the list ..but here is the setup. >> >> I have the following set to the directory that has the *.so files >> >> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/hari/instantclient/instantclient_11_1" >> export PATH="$PATH:/home/hari/instantclient/instantclient_11_1" >> export SQLPATH="/home/hari/instantclient/instantclient_11_1" >> export ORACLE_HOME="/home/hari/instantclient/instantclient_11_1" > > I am using the instant client RPM so it lays things out a little > differently. Specifically, I have folders like this > > /usr/lib/oracle/11.2/client/bin > /usr/lib/oracle/11.2/client/lib > > It also adds the file > > /etc/ld/so.conf.d/oracle-instantclient11.2.conf > > which sets the library loader path automatically. What that tells me, > though, is that you should NOT set ORACLE_HOME. Its also possible that > you have another installation of Oracle somewhere in the PATH or > LD_LIBRARY_PATH that is conflicting. Make sure the one you want is > FIRST in the path -- from the above you are setting them as the LAST > item which means anything already set there is going to cause > problems. Take a look at those values and see what is in there > already. > >> I was wondering if it is trivial to compile cx_oracle to run with the >> 10_1 client libraries, so I can have a homogenoeous system. > > It should not be a problem. What problem are you seeing? > >> Thanks again..and hoping there is a quick fix > > I think so. Just look more carefully at your environment variables. :-) > > Anthony > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |