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

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

I know that I could use DBD version 1.20 to access both databases, but I was wondering if it is possible to install two versions of the DBD module and use an acceptable version for each database (less error prone).

+4
source share
3 answers

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

+5
source

Install the different versions of DBI / DBD :: Oracle in two different places, see INSTALL_BASE / --install_base . Access them separately by installing PERL5LIB accordingly.

local :: lib helps you automate this whole thing.

+4
source

If you want to access two versions of the database from the same program run, you can do the following:

  • install both versions on your system using local :: lib

  • start the DBD :: Proxy server with @LIB configured to load one version of DBD :: Oracle

  • run the script using @LIB configured to load another version of DBD :: Oracle

  • in your script, connect to one database using DBD :: Oracle as usual, and the other through a proxy.

+3
source

Source: https://habr.com/ru/post/1332214/


All Articles