problems using DBI:Proxy

problems using DBI:Proxy

am 08.12.2005 13:25:31 von claude.b

I have problems using DBI:Proxy / DBI:Proxyserver with an Oracle
database. In fact, I am not sure that I start the proxy properly.

I'd like to connect to a remote Oracle database (called 'abc') running
on machine A (ip=1.2.3.4), port 1521.

First, on A, I created a proxy startup file:
-------------------------
$ cat ./testProxy0.pl
#!/usr/bin/perl -- # -*-Perl-*-
use DBI::ProxyServer;
use strict;
use diagnostics;
DBI::ProxyServer::main(@ARGV);
-------------------------

Then I run it, and... get an error:
-------------------------
$ ./testProxy0.pl -localaddr 1.2.3.4 --localport 1521
running...
Uncaught exception from user code:
Cannot create socket: Address already in use at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon.pm line 548. at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon/Log.pm line 136.
Net::Daemon::Log::Fatal('DBI::ProxyServer=HASH(0x8275980)',' Cannot create socket: Address already in use') called at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon.pm line 548
Net::Daemon::Bind('DBI::ProxyServer=HASH(0x8275980)') called at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/DBI /ProxyServer.pm line 234
DBI::ProxyServer::main('-localaddr',1.2.3.4,'--localport',15 21) called at ./testProxy0.pl line 5
-------------------------

Now, changing the port to a free value (1521 is used by Oracle) gets
rid of the error. Is this the way to go? Is this 'free' port the value
that the DBI:Proxy should send a request to? But then, I don't
understand how to tell the proxy what port is the database running at.

Can you help? Thanks for your time.
--
Claude

Re: problems using DBI:Proxy

am 09.12.2005 17:05:44 von shildret

On Thu, 2005-12-08 at 14:25 +0200, Claude wrote:
> I have problems using DBI:Proxy / DBI:Proxyserver with an Oracle
> database. In fact, I am not sure that I start the proxy properly.
>
> I'd like to connect to a remote Oracle database (called 'abc') running
> on machine A (ip=1.2.3.4), port 1521.
>

Port 1521 is used by Oracle (if setup that way) for tnslistener. You
can't bind to that port since it is already in use. As the error
message indicated. On the server that has Oracle use the dbiproxy
command that is installed when DBI is is installed. something like

dbiproxy --port 3333 &

...then you can connect to this proxy server from other servers.

i.e.

$ENV{DBI_AUTOPROXY} = 'hostname=srvA;port=3333';

my $dbh = DBI->connect('dbi:Oracle:sid', 'user', 'passwsd');


...etc.

Do some reading :-)

perldoc dbiproxy


> First, on A, I created a proxy startup file:
> -------------------------
> $ cat ./testProxy0.pl
> #!/usr/bin/perl -- # -*-Perl-*-
> use DBI::ProxyServer;
> use strict;
> use diagnostics;
> DBI::ProxyServer::main(@ARGV);
> -------------------------
>
> Then I run it, and... get an error:
> -------------------------
> $ ./testProxy0.pl -localaddr 1.2.3.4 --localport 1521
> running...
> Uncaught exception from user code:
> Cannot create socket: Address already in use at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon.pm line 548. at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon/Log.pm line 136.
> Net::Daemon::Log::Fatal('DBI::ProxyServer=HASH(0x8275980)',' Cannot create socket: Address already in use') called at /usr/lib/perl5/vendor_perl/5.8.0/Net/Daemon.pm line 548
> Net::Daemon::Bind('DBI::ProxyServer=HASH(0x8275980)') called at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/DBI /ProxyServer.pm line 234
> DBI::ProxyServer::main('-localaddr',1.2.3.4,'--localport',15 21) called at ./testProxy0.pl line 5
> -------------------------
>
> Now, changing the port to a free value (1521 is used by Oracle) gets
> rid of the error. Is this the way to go? Is this 'free' port the value
> that the DBI:Proxy should send a request to? But then, I don't
> understand how to tell the proxy what port is the database running at.
>
> Can you help? Thanks for your time.
--
Scott T. Hildreth