Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access two Oracle databases with different versions (8i and 9) using perl?

Tags:

oracle

perl

dbi

dbd

I'm currently accessing an Oracle database version 9i (9.2.0.8.0) using perl modules DBI (1.613) and DBD::Oracle (1.26). The current scope of the project now requires that I access a version 8i (8.1.7.4.0 ) Oracle database and, according to the DBD::Oracle project, I can only access this second database with a DBD::Oracle version 1.20 or below.

I know I could possibly use the DBD version 1.20 to access both databases, but I was wondering if its possible to have installed the two versions of the DBD module and use the acceptable version for each database (less prone to errors).

like image 845
Isabelle Avatar asked Dec 12 '22 17:12

Isabelle


2 Answers

I don't believe that the server version has any bearing on the DBD::Oracle version you can use, only the version of the client libraries that you install. The 9.2, 10.1, and 10.2 versions of the Oracle client libraries support connecting to Oracle server 8.1.7.4, and the latest version of DBD::Oracle remains compatible with all client libraries from 9.2 up, so I don't think that you will actually have any problem at all. However, if you install the version 11 client, you will lose the ability to connect to server versions below 9.2.0.

like image 56
hobbs Avatar answered Feb 23 '23 00:02

hobbs


Install the different versions of DBI/DBD::Oracle into two different places, see INSTALL_BASE/--install_base. Access them seperately by setting PERL5LIB appropriately.

local::lib helps you automate this whole affair.

like image 37
daxim Avatar answered Feb 23 '23 00:02

daxim