Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 31682 invoked from network); 11 Dec 2006 14:05:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2006 14:05:18 -0000 Received: (qmail 44279 invoked by uid 500); 11 Dec 2006 14:05:19 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 44253 invoked by uid 500); 11 Dec 2006 14:05:19 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 44242 invoked by uid 99); 11 Dec 2006 14:05:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 06:05:19 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [132.77.4.194] (HELO wisemail.weizmann.ac.il) (132.77.4.194) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 06:05:09 -0800 Received: from Wisdomain-MTA by wisemail.weizmann.ac.il with Novell_GroupWise; Mon, 11 Dec 2006 16:04:41 +0200 Message-Id: <457D8176.17BB.001B.0@wisemail.weizmann.ac.il> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Mon, 11 Dec 2006 16:04:09 +0200 From: "Malka Cymbalista" To: , Subject: Re: Connecting to more than one Oracle database Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part7C584949.0__=" X-Virus-Checked: Checked by ClamAV on apache.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part7C584949.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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@weizmann.ac.il 08-934-3036 --=__Part7C584949.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Description: HTML
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@weizmann.ac.il
08-934-3036 --=__Part7C584949.0__=--