local tnsnames.ora not referenced



I am supporting DBD::Oracle and I don't know enough on oracle side to
answer a
few questions below.

Background information.

1. I bind the DBD::Oracle with oracle 8.1.7 network libray and
put those library into /opt/oracle/dbd
.@myhost> ls -l /opt/oracle/dbd
total 18
-rwxr-xr-x 1 root root 1962 Jul 8 2004 dbdoracle-test.pl
drwxr-xr-x 3 root other 2560 Jul 8 2004 lib
drwxr-xr-x 15 root other 512 Jul 8 2004 network
drwxr-xr-x 13 root other 512 Jul 8 2004 rdbms
drwxr-xr-x 7 root other 512 Jul 8 2004 sqlplus
..@myhost>


2. Script on Client side. manual edited.
..@myhost> cat /tmp/tj2.pl
#!/usr/bin/perl
use DBI;
$ENV{'ORACLE_SID'}="FFR";
$ENV{'ORACLE_HOME'}="/opt/oracle/dbd";
my $dbh =
DBI->connect('dbi:Oracle:my_ffr.test.com','account/password','') || die
"Failed to open database: $!";
my $query1 = $dbh->prepare("select sysdate from dual");
$query1->execute;
$row=$query1->fetchrow_array();
print "$row\n";
warn $DBI::errstr if $DBI::err;
$query1->finish;
..@myhost>

3. This tj4.pl failed, I put in wrong hostname to demostrate the error
message.
..@myhost> perl /tmp/tj4.pl
DBI->connect(mymy_ffr.test.com) failed: ORA-12154: TNS:could not
resolve service name (DBD ERROR: OCIServerAttach) at /tmp/tj4.pl line 5
Failed to open database: at /tmp/tj4.pl line 5.
..@myhost>

4. If I add an tns entry on oracle server(my_ffr.test.com) then tj2.pl
will work, the system date is displayed.

..@myhost> perl /tmp/tj2.pl
19-jul-2005
..@myhost>

5. following is the tns entry I added into tnsnames.ora
< my_ffr.test.com =
< (DESCRIPTION =
< (ADDRESS = (PROTOCOL= TCP)(Host= fqdn.test.com)(Port= 1521)
< )
< (CONNECT_DATA =
< (SERVER = DEDICATED)
< (SERVICE_NAME = my_ffr.test.com)
< )
< )

Now the questions

Q1. why the local tnsnames.ora has no effect at all ? I have to
add tns entry on oracle server side.

..@myhost> ls -l /opt/oracle/dbd/network/admin/tnsnames.ora
-rw-r--r-- 1 root other 8963 Jul 18 16:48
/opt/oracle/dbd/network/admin/tnsnames.ora
..@myhost>

This behavior my be a good thing for security reason but I
am curious how I can direct DBD::Oracle to look at local
tnsnames.ora
first

Q2. After tj2.pl connect to my_ffr oracle sucessfully, the added
tns entry were commented out.
Why tj2.pl will not fail !? is listener on oracle server reading
entry in tnsnames.ora accumulativly ? even entry in tnsname.ora got
commented out, it still accept connection from tj2.pl ?

Q3. I am making a DBD::Oracle client as an package and need to include
some of the network/lib files. Anyone know what exact file under
network and lib are need to gurantee DBD::Oracle works ?

I appreicate your time

T.J. Yang

.



Relevant Pages

  • Re: local tnsnames.ora not referenced
    ... because TNS_ADMIN environment path wasn't set in tj2.pl. ... I found before I added tns entry on oracle I also added same entry ... environment setting somehow got inherited in my shell environemnt. ...
    (perl.dbi.users)
  • RE: Speed test for connecting to Oracle for Windows via ODBC
    ... I can understand frustration but your request is too nebulous for those who ... contributed - like connecting from a vmware host). ... Your "blame the network guy statements" miss the point that for a lot of us ... Speed test for connecting to Oracle for Windows via ODBC ...
    (perl.dbi.users)
  • RE: Speed test for connecting to Oracle for Windows via ODBC
    ... 'ask support' response may not be helpful in many of these cases. ... Speed test for connecting to Oracle for Windows via ODBC ... Your "blame the network guy statements" miss the point that for a lot of us ...
    (perl.dbi.users)
  • Connection issue, Server IP address wrong
    ... A user has a Desktop machine connected to the network, which has Oracle ... A while back the user decided to install Oracle 10i, ... Server version, for a sales presentation off site. ...
    (microsoft.public.windows.server.sbs)
  • Re: Pocket PC database ?
    ... But the good thing is, as soon as you have established a network, you can ... data to the centralized database and the database can also ... The easy part first - Oracle _is_ available for Windows Mobile, ... What is the best way to enable data transfer to/from pocket pcs? ...
    (microsoft.public.pocketpc.developer)