Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Connecting DBD::Oracle without using TCP/IP

by Rhose (Priest)
on Dec 23, 2003 at 19:15 UTC ( #316687=note: print w/replies, xml ) Need Help??


in reply to Connecting DBD::Oracle without using TCP/IP

DBD::Oracle uses a TNS connect string to connect to the database. Depending on your Oracle client install the TNS names could be stored in a flat file called tnsnames.ora, on a names server, or in OID (Oracle internet directory) repository. Anyway, define a TNS name which will connect to the database in question and test the connection with SQL*Plus. Once you are able to connect with SQL*Plus, try connecting as below:

$dbh = DBI->connect('dbi:Oracle:'.$TNS, $User, $Pass) || die $!;

Update:
PLEASE take this with a grain of salt, as I only use TCP for connections to my databases. I played around with using the bequeath adaptor to connect to one of my test instances, and I added the following entry to the local tnsnames.ora file:

beqtst.world = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = BEQ) (PROGRAM = oracle) (ARGV0 = oraclenboprd00) (ARGS = '(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))') ) ) (CONNECT_DATA = (SID = nboprd00)) )

The ORACLE_SID of the database to which I was connecting is "nboprd00". To use this TNS name with the connection code above, set $TNS='beqtst';

One other CYA, I did not test this with DBD::Oracle... I only tested it with SQL*Plus (I do not have DBD::Oracle installed on this test system, and I am not about to play with my install an hour before I leave for holiday. *Grins*)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://316687]
help
Chatterbox?
[erix]: what's the offending signature?
[Discipulus]: 'give man a fish erix it sonds like a push towards omosexuality.. ;=)
[Discipulus]: see Re: from txt file to array erix
[erix]: yeah, I ask for the text (I don't see signatures)
[Discipulus]: dear brother karl has "Furthermore I consider that Donald Trump must be impeached as soon as possible" in his sig
[erix]: ah, thanks Discipulus
[1nickt]: erix perhaps you could kindly point out your technique to roho and everyone will be happy.
[Discipulus]: but i'm also animalist, so i' hirted by 1nickt's sig: The way forward always starts with a mammal test... grin..
[erix]: I might if I did remember. It's probably somewhere in the site docs

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-06-22 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.