1751779 Members
4447 Online
108781 Solutions
New Discussion юеВ

Re: DBD-Oracle

 
SOLVED
Go to solution
Reymond  Keiluhu
Honored Contributor

DBD-Oracle

Hello All,

I'm quite new to perl-dbd/dbi world. I have installed and run successfully perl DBD-Oracle module. but I'm bit curious about something, which is, you know when we build DBD-Oracle from the source we must set the environment variable for ORACLE_HOME, ORACLE_USERID, ORACLE_SID etc.

my question is, how do we build an DBD-Oracle on one perl instance to connect more than one instance of Oracle? is it possible to do that without installing different perl instance located on different location?
thanks.
/rk
7 REPLIES 7
H.Merijn Brand (procura
Honored Contributor

Re: DBD-Oracle

As long as all the Oracle instances are the same (in respect to Oracle version and bitness), you can use one DBI/DBD script to connect to multiple databases simultaneously

# man DBI

and

# man DBD::Oracle

and then look for the $dbh->connect () calls
There you can define the database to connect to

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Florian Heigl (new acc)
Honored Contributor

Re: DBD-Oracle

From what I remember DBD-Oracle will respect the current values of ORACLE_SID et all.
yesterday I stood at the edge. Today I'm one step ahead.
Reymond  Keiluhu
Honored Contributor

Re: DBD-Oracle

thanks for the response.

does it mean that we cannot utilize one perl instance to connect to different oracle instance located on different machine?
/rk
Oviwan
Honored Contributor

Re: DBD-Oracle

Hy, of course you can if i understood your question right. look the attachement.

Regards
Reymond  Keiluhu
Honored Contributor

Re: DBD-Oracle

ok that's answer my question, and the restriction apply as mentioned by Procura.

the next question, if we can specify username & password for each database in the script, why do we need to specify environment variable ORACLE_USERID when we build DBD-Oracle? is that only the default?
/rk
H.Merijn Brand (procura
Honored Contributor
Solution

Re: DBD-Oracle

Yes. It is needed for building and testing.

Those %ENV variables are used to connect () if no specific DBI_DSN is passed.
Exploring deeper functionality of connect () will open a parallel universe :)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Reymond  Keiluhu
Honored Contributor

Re: DBD-Oracle

solved. thanks a lot guys.
/rk