Connecting remote Oracle Database server from a Perl script running on Unix, without Oracle client

StackOverflow https://stackoverflow.com/questions/7614481

  •  05-02-2021
  •  | 
  •  

Question

I have a Unix machine which I need to connect to a remote Oracle database server though Perl/Shell script. I have searched online but did not find a thorough information on whether it's possible to connect the Unix machine with the Oracle DB server without installing an Oracle client.

Was it helpful?

Solution

I suppose that you don't want / have the opportunity of installing the Oracle Client (that's the better choice). If you don't mind the performance and use Java as a bridge, you can take a look at DBD::JDBC module. It has a server you need to start from the command line with Java.

From the documentation: the DBD::JDBC server is a Java application intended to be run from the command line. It may be installed, along with whatever JDBC driver you wish to use (i.e classes12.jar), on any host capable of accessing the database you wish to use via JDBC.

Perl applications using DBD::JDBC will open a socket connection to this server. You will need to know the hostname and port where this server is running. You can install the server at the same machine you are running the Perl script, or other if you want.

I use this solution at scenarios like yours, where I cannot install the Oracle Client and I don't have high performance requirements in database access.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top