Accessing a remote oracle DB

Hi,

I need to hit an external oracle DB from ROOT.

I’m trying to do TSQLServer *myDB = TSQLServer::Connect(“oracle://devdb10.cern.ch”, “username”, “pw”);

I get the follwing error:

root [0] .x dbTest.C
Error in : Oracle[.so | .sl | .dl | .a |
.dll] does not exist in
.:/raiddata2/d0usr/products/root/Linux-2-4/v4_04_02b_fbits_eh-GCC_3_4_3–opt/lib:/raiddata2/d0usr/products/root/Linux-2-4/v4_04_02b_fbits_eh-GCC_3_4_3–opt/lib:/raiddata2/d0usr/products/mesa/Linux-2-4/v6.0.1-gcc3_4_3_dzero–rh7_1/lib:/raiddata2/d0usr/products/iguana/Linux-2-4/v4.2.4f5-gcc3_4_3_dzero–rh7_1/lib/Linux__2.4:/raiddata2/d0usr/products/coin/Linux-2-4/v2.3.0-gcc3_4_3_dzero–rh7_1/lib:/raiddata2/d0usr/products/qt/Linux-2-4/v3.3.3-gcc3_4_3_dzero–rh7_1/lib:/fnal/ups/prd/sam_cpp_api/Linux-2-4/v7_2_1-GCC-3-4-3/lib/so:/fnal/ups/prd/omniORB/Linux-2-4/v3_0_4-GCC-3-1-PYTHON-2-1/lib:/fnal/ups/prd/orbacus/Linux-2-4/v3_3_4p3-GCC-3-4-2/lib:/raiddata2/d0usr/products/xerces/Linux-2/v1_5_1_eh-gcc342/lib:/raiddata2/d0usr/products/ace/Linux-2/v5_1_17a_eh-gcc342/ACE_wrappers/build/Linux2.4-GCC_3_4_2/ace:/raiddata2/d0usr/products/root/Linux-2-4/v4_04_02b_fbits_eh-GCC_3_4_3–opt/lib:/raiddata2/d0usr/products/cern/Linux-2-4/2000_eh-gcc342/lib:/raiddata2/d0usr/products/blt/Linux-2/v2_4z!
_eh-gcc342/lib:/raiddata2/d0usr/products/runtime/Linux-2-4/v1_1-glibc_2_2_4/usr/lib:./lib/Linux2.4-GCC_3_4:./shlib/Linux2.4-GCC_3_4:/raiddata2/d0dist/dist/releases/p17.09.06/lib/Linux2.4-GCC_3_4:/raiddata2/d0dist/dist/releases/p17.09.06/shlib/Linux2.4-GCC_3_4:/raiddata2/fnal/ups/prd/vdt/Linux/v1_1_14_11/globus/lib:/home/mkoms/root_stuff/package/instantclient_10_2
Error: Function dbTest() is not defined in current scope FILE: LINE:0
Possible candidates are…
filename line:size busy function type and name
*** Interpreter error recovered ***

This is after I downloaded the Basic and SDK Instant Client packages from oracle.com/technology/tech/o … index.html
, unzipped them into a directory, and pointed my $LD_LIBRARY_PATH to that directory.

I’m running ROOT 4.04/02b

What am I doing wrong?

Thank you very much,
Mikhail

Hi Mikhail,

You must build ROOT with Oracle support. Use these options :

–enable-oracle
with-oracle-incdir=your_oracle_include_path
with-oracle-libdir=your_oracle_library_path

at ./configure step.

Cheers,
Bertrand.

Hi Bertrand,

Is there any way to get that to work without rebuilding ROOT? I don’t currently have root accounts on the box I’m working on…

Thank you,
Mikhail

Hi Mikhail,

Well, unfortunately, there is no binary distribution of ROOT 4.04/02b & Oracle…

Bertrand.

Thanks Bertrand.

I guess I’ll have to see if I can get it rebuilt. I hope it doesn’t take too long :slight_smile:

Thanks again.

Hi,

Sorry for digging an old thread back up, but I’m having more problems with TSQLServer… . Here’s my short macro:

#include

void oracleTest(){

TSQLServer *db = TSQLServer::Connect(“oracle://devdb10.cern.ch”,“user”,“passw”);

TSQLResult *res;
res = db->Query(“select * from fwcaenchannel”);
}

I try to run this:

root [0] .L oracleTest.C
root [1] oracleTest()
Error in : Code: 12162 Msg: ORA-12162: TNS:net service name is incorrectly specified

Error: illegal pointer to class object db 0x0 76 oracleTest.C:8:
*** Interpreter error recovered ***

I did a little bit of research, and here’s what the ORA-12162 message means:
ORA-12162: TNS:net service name is incorrectly specified
Cause: The connect descriptor corresponding to the net service name in TNSNAMES.ORA or in the directory server (Oracle Internet Directory) is incorrectly specified.
Action: If using local naming make sure there are no syntax errors in the corresponding connect descriptor in the TNSNAMES.ORA file. If using directory naming check the information provided through the administration used for directory naming.

What does that mean? I hope someone can help out…

Thanks again,
Mikhail