ORAPERL and Networked Databases...
Hello,
Quote:
>...I'm trying to pinpoint just where this experiment is breaking down --
>in oraperl, our Oracle setup, or both.
>...basically, I'm trying to open an Oracle database on another machine
>using a database name of (for example)
> T:oit.itd.umich.edu:db_name
>On the Mac side (according to person in the office most familiar with
>Oracle, and that's mostly on the Mac-client end), this expression needs
>to be written as
> T:141.211.162.10:db_name
>for things to work. oraperl kept giving me messages about "141..." not
>being a valid name, so I added the "true" name and IP address to
>/etc/hosts (on the machine on which I was testing), which gave me a
>different error -- that "orasrv" was probably not in /etc/services.
>It is. And other TCP/IP clients seem to be working fine.
>I haven't found in the docs whether oraperl even supports the "T:..."
>construct, but I haven't found any indication that it doesn't. And we
>sadly don't have the UNIX Pro*C docs in the office, which is leaving me
>stymied. :-feh
>So...any advice/samples/pointers that other oraperl developers can offer
>would be greatly appreciated!
>Roger
>(SunOS 4.1.3, oraperl v2.4, ORACLE 6.x...)
The solution is pretty simple: just set the following environment variables:
setenv TWO_TASK T:oit.itd.umich.edu:db_name
setenv ORACLE_SID db_name
setenv ORACLE_HOME /usr/local/oracle
The last one should point to the oracle home directory at your site. Then to
login to the (remote) database you simply call:
$DB = &ora_login('', $DBUser, $DBPassword);
where $DBUser holds the oracle username and $DBPassword the corresponding
password.
Hope this helps.
Cheers,
Informatiseringscentrum | phone: +31-20-525 2302
Universiteit van Amsterdam | +31-20-525 2741
Turfdraagsterpad 9, NL-1012 XT AMSTERDAM | fax : +31-20-525 2084
*** PGP Public Key available on servers *** | home : +31-20-675 0989