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


Relevant Pages

  • Re: TNSPing Timeout Expired Error
    ... >I am attempting to connect to a remote Oracle database using the 9i ... I can successfully ping the server on which the database ... >resides but TNSPING produces a tijmeout expired error. ... >using the exact same client configuration from another office - which ...
    (comp.databases.oracle.server)
  • Re: scheduled movement of data to remote server
    ... to move this data into tables in a remote Oracle database. ... Or would it be better to run a java file and ... data on schedule and it's tightly integrated into the database core. ... stored procedure to push data from source to target, ...
    (comp.databases.oracle.misc)
  • Re: Auto emailing records due in 7days
    ... The script looks for records that are due within the next ... I think the database is saving the words ... You can store the find request in your script step: ... Perform Find < Specify find requests> and specify your request in the dialog ...
    (comp.databases.filemaker)
  • heterogeneous query how do I get correct @@rowcount ?
    ... Writing a Stored Proc which read some data from a remote Oracle database ... and ultimately writes some data into my SQL Server 2000 database. ...
    (microsoft.public.sqlserver.programming)
  • TOAD and Oracle 9i Database local PC installation
    ... whether I need to install a copy of Oracle 9i locally ... in order to connect to a remote Oracle database? ... is it that I install TOAD alone without a local Oracle 9i database ...
    (comp.databases.oracle.tools)