RE: Connecting to more than one Oracle database
- From: Ron.Reidy@xxxxxxxxxxxxxxxxxx (Ron Reidy)
- Date: Mon, 11 Dec 2006 09:04:24 -0700
What errors are you getting (ORA- or TNS-)?
Are you defining the other variables necessary - NLS* LD_LIBRARY_PATH,
etc. for your ORACLE_HOME?
Can you tnsping the DBs from your web server? What about connecting via
SQL*Plus?
--
Ron Reidy
Lead DBA
Array BioPharma, Inc.
-----Original Message-----
From: Malka Cymbalista [mailto:Malki.Cymbalista@xxxxxxxxxxxxxx]
Sent: Monday, December 11, 2006 7:04 AM
To: modperl@xxxxxxxxxxxxxxx; dbi-users@xxxxxxxx
Subject: Re: Connecting to more than one Oracle database
Hello to all of you, Last week I sent an email asking how to connect to
more than one remote Oracle database. My problem was that in my
startup.pl file, I am setting the following environment variables:
ORACLE_HOME, ORACLE_SID, TWO_TASK and TNS_ADMIN. If I am trying to
connect to 2 different databases, then ORACLE_SID and TWO_TASK are not
the same and I did not know what to do.
SEveral people answered me and said that I should not define
ORACLE_SID and TWO_TASK in startup.pl but that I should define both
databases in tnsnames.ora and simply connect giving the name of the
database.
So now, I am doing the following:
My tnsnames.ora looks like:
asdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = computer1.weizmann.ac.il)(PORT
= 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = asdb.weizmann.ac.il)
)
)
asdb2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = computer2.weizmann.ac.il)(PORT
= 1521))
)
(CONNECT_DATA =
(SID = ORCL92)
)
)
I connect in the following manner:
DBI->connect("DBI:Oracle:asdb","user1","password1");
and
DBI->connect("DBI:Oracle:asdb2","user2","password2");
I have a script that works from the command line but does not work when
I run it from the web. When I run from the web it gives very
inconsistent results. Sometimes it succeeds in connecting to the first
database I specify and sometimes it can't connect to either. I tried
specifying the environment variables ORACLE_SID and TWO_TASK from within
the script but that didn't seem to help consistently. That is,
sometimes it worked and sometimes it didn't and we couldn't figure out
exactly when it would or would not work.
Does anyone know how I can connect via the web to 2 different oracle
databases sitting on 2 different machines from within the same script.
Thanks for any help.
Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@xxxxxxxxxxxxxx
08-934-3036
This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.
.
- Follow-Ups:
- Re: Connecting to more than one Oracle database
- From: Rohit V Bhute
- Re: Connecting to more than one Oracle database
- References:
- Re: Connecting to more than one Oracle database
- From: Malka Cymbalista
- Re: Connecting to more than one Oracle database
- Prev by Date: RE: Connecting to more than one Oracle database
- Next by Date: Re: Connecting to more than one Oracle database
- Previous by thread: Re: Connecting to more than one Oracle database
- Next by thread: Re: Connecting to more than one Oracle database
- Index(es):
Relevant Pages
|
|