Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

is this a viable option?

11 views
Skip to first unread message

Jack Craig

unread,
Oct 1, 2012, 1:29:53 PM10/1/12
to dbi-...@perl.org
Hi Folks,

I have an html / perl app running on host A,

i want to do a remote oracle query on host B from host A.

Assuming proper credentials, is this a viable configuration?

This as opposed to running perl dbi module installed on host B.

TIA, jackc...

Jon

unread,
Oct 1, 2012, 1:34:18 PM10/1/12
to Jack Craig, dbi-...@perl.org
Hello Jack,

If I'm understanding you correctly, you want to run a perl app on your
webserver and have it connect to your database server?

What's wrong with setting the host name/ip if your DB server in the DSN?

e.g.:

my $dsn = "dbi:*SQL Platform*:*database_name*:*host_name*:*port"
*

Am I maybe misunderstanding your question?

Best Regards,
Jon A

Martin J. Evans

unread,
Oct 1, 2012, 2:15:11 PM10/1/12
to Jack Craig, dbi-...@perl.org
Yes.

Install Oracle Instant Client (you need the sdk, client, sqlplus).
Untar it somewhere accessible from your web user.

Add untarred_dir/bin to PATH and export it.

Run sqlplus with the correct args to connect to your Oracle to prove the
client works.

Download DBD::Oracle. Assuming Unix or Linux, set LD_LIBRARY_PATH (or
equivalent) to point to the dir you untarred instant client into. Do the
usual with DBD::Oracle - perl Makfile.PL, make, make test, make install.

Write Perl code using DBI module to issue query and get results.

Martin

Martin Hall

unread,
Oct 2, 2012, 3:35:13 AM10/2/12
to dbi-...@perl.org

If there's a database link between the two databases, you could connect
to database A from Perl and execute a query against B over the DBLink
without doing a Perl connect to B.

On 01/10/2012 18:29, Jack Craig wrote:
-cheers

Martin
0 new messages