Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to connect Oracle DB in Linux Env.

by Generoso (Parson)
on Sep 09, 2011 at 13:30 UTC ( #925088=note: print w/ replies, xml ) Need Help??


in reply to How to connect Oracle DB in Linux Env.

From your post I see missing either the SID or SERVICE and port elements on the connect parameters.

my $dbh = DBI->connect('dbi:Oracle:host=localhost;sid=ORCL;port=1521', + 'scott', 'tiger', { RaiseError => 1, AutoCommit => 0 }); my $dbh = DBI->connect('dbi:Oracle:host=localhost;service=my.service.n +ame.com;port=1521','scott', 'tiger', { RaiseError => 1, AutoCommit => + 0 });


Comment on Re: How to connect Oracle DB in Linux Env.
Download Code
Re^2: How to connect Oracle DB in Linux Env.
by pawank86 (Novice) on Sep 09, 2011 at 20:12 UTC

    Hi Generoso, I tried the above code also but getting the same error of need explicit attach. I used SID = 'ORCL', DB port = 1521 and for host i used the IP address of Linux machine where DB is deployed, (machine which i want to connect). Please let me know other possible solutions.

      Have you tried to connect to the database via sqldeveloper form ORACLE it is free; you can downloaded and install it and set up a connection and test if the connecting parameters are the correct ones.

      Have not work with it on UNIX only in windows and is a good tool to debug your sql before you use it on a program or perl script

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://925088]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2015-07-03 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls