[SOLVED] Connecting to remote oracle database using perl??
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How to connect to remote oracle database using perl??
This is what I tried.
Code:
#usr/bin/perl
use DBI;
use strict;
use warnings;
use DBI;
$ENV{ORACLE_SID} = "oracle9i";
$ENV{ORACLE_HOME} = "/opt/oracle";
my $dbname = "test";
my $dbuser = "test";
my $dbpass = "test";
my $dbh = DBI->connect("dbi:Oracle:host=192.168.1.99;$dbname", $dbuser, $dbpass)
|| die "Unable to connect to $dbname: $DBI::errstr\n";
How to connect to remote oracle database using perl??
This is what I tried.
Code:
#usr/bin/perl
use DBI;
use strict;
use warnings;
use DBI;
$ENV{ORACLE_SID} = "oracle9i";
$ENV{ORACLE_HOME} = "/opt/oracle";
my $dbname = "test";
my $dbuser = "test";
my $dbpass = "test";
my $dbh = DBI->connect("dbi:Oracle:host=192.168.1.99;$dbname", $dbuser, $dbpass)
|| die "Unable to connect to $dbname: $DBI::errstr\n";
But I am unable to connect.
Any help is highly appreciated
I do this quite a lot, here's how mine is set:
Code:
my $gDBH = DBI->connect("dbi:Oracle:$dbhost;sid=$dbsid;port=$dbport",$user,$pass)
or Fail_Out("Unable to connect: $DBI::errstr\n");
There is another method as well, that looks more 'oracle-ish':
Have you verified that you can get to the listening port (probably 1521) from wherever the script is running? It's possible there is a firewall or something preventing it.
I assume you checked the usual suspects - IP, password, user, listener status, port, etc.
Have you verified that you can get to the listening port (probably 1521) from wherever the script is running? It's possible there is a firewall or something preventing it.
I assume you checked the usual suspects - IP, password, user, listener status, port, etc.
Actually I don't have any DBD::Oracle driver installed on my PC.
But I had it on my remote machine.Is that the problem?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.