Andy,
There are two ways of specifying your connections with DBD-Oracle. You can
either use the tnsnames.ora file and then connect based on the ORACLE_SID or
you can specify the host/port for the connection in your application. Here
is an example of the latter, just substitute your username/password.
$dbh=DBI->connect("dbi:Oracle:host=db1.host.edu;port=1522;sid=db2","Username
","Password")
If you can't connect using the ORACLE_SID , does this work with client
applications such as sqlplus i.e. does:
sqlplus user/[EMAIL PROTECTED]
work from the command line?
Cheers
Andy
-----Original Message-----
From: Andy Squires [mailto:[EMAIL PROTECTED]
Sent: 15 January 2004 15:33
To: [EMAIL PROTECTED]
Subject: Remote connection to Oracle
Hi everyone,
I'm having that age-old problem of trying to connect with Oracle. On one
server there are two Oracle
databases, say called db1 and db2. I'm connecting to them from another
server. I've had no problem
connecting with db1 with a call like:
my $dbh = DBI->connect('DBI:Oracle:db1.host.edu','userid/passwd', '');
I should mention that the name of the host where the databases are is called
db1.host.edu. So I may be
confusing the name of the server and the first database because they have
the same name.
Anyway, I can't seem to connect to the second database, db2, even when I set
up all the environment
variables to point to the second instance of Oracle. I do know db2 is using
port 1522. It wasn't clear
to me from the documentation in Oracle.pm where to put the port number in
the connection string, or even
if I need to.
I am setting ORACLE_SID to the name of the database instance.
Any suggestions? This is using DBD-Oracle 0.59 and Oracle 8.1.7.
Thanks,
Andy
| Andy Squires -- Programmer / Analyst
|
| E-Administration -- American University
|
| (202) 885-2785
|
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
__________________________
This email and any files transmitted with it are confidential and intended solely for
the use of the individual or entity to whom they are addressed. The contents are
confidential and may be privileged.
Any views or opinions expressed are those of the sender and may not reflect the views
or opinions of the company and the company accepts no liability in respect thereof.
If you have received this email in error please notify [EMAIL PROTECTED] immediately.
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________