DBI / DBD Oracle connect question 
Author Message
 DBI / DBD Oracle connect question

Using...

$dbh = DBI->connect('dbi:Oracle:TEST1', 'test1', 'test1' , {Printerror => 0,
RaiseError => 1} );

I get Oracle error ORA-12154 TNS: could not resolve service name (DBD Error:
OCIServerAttach)

Yet I don't really want to use TNS (I think) - I want to do an old fashioned
connect to SID TEST1 using userid/passwd test1/test1 equivalent to

ORACLE_HOME=/opt/oracle.....
ORACLE_SID=TEST1
sqlplus test1/test1

Can someone explain what is going on? I'm quite happy to admit I might have
a configuration error either in the DBD installation or in Oracle but what
do I do about it?

How does DBI differentiate between the types of (Oracle) connect string it
can receive anyway? This is one area where I feel the O'Reilly "Programming
the perl DBI" is a bit short on explained examples :-}

Many thanks

Bill



Fri, 19 Sep 2003 18:20:44 GMT  
 DBI / DBD Oracle connect question

Quote:

> Using...

> $dbh = DBI->connect('dbi:Oracle:TEST1', 'test1', 'test1' , {Printerror => 0,
> RaiseError => 1} );

> I get Oracle error ORA-12154 TNS: could not resolve service name (DBD Error:
> OCIServerAttach)

> Yet I don't really want to use TNS (I think) - I want to do an old fashioned
> connect to SID TEST1 using userid/passwd test1/test1 equivalent to

no, you do want a TNS listener, it's part of the DB.

Quote:

> ORACLE_HOME=/opt/oracle.....
> ORACLE_SID=TEST1
> sqlplus test1/test1

> Can someone explain what is going on? I'm quite happy to admit I might have
> a configuration error either in the DBD installation or in Oracle but what
> do I do about it?

find the file tnsnames[.ora]  (u never said what platform so it depends on that
too)

tnsnames is similar to /etc/hosts  -> maps DB names  (SID) to DB locations
(host::port:: +bits)
(a TNS listener is a server/daemon listenining on a TCPIP port for (possible
remote) DB connection)

Quote:

> How does DBI differentiate between the types of (Oracle) connect string it
> can receive anyway? This is one area where I feel the O'Reilly "Programming
> the perl DBI" is a bit short on explained examples :-}

perldoc DBD::Oracle

hope that helps
Wayne



Sat, 20 Sep 2003 03:37:11 GMT  
 DBI / DBD Oracle connect question


Quote:
> Using...

> $dbh = DBI->connect('dbi:Oracle:TEST1', 'test1', 'test1' , {Printerror =>
> 0, RaiseError => 1} );

> I get Oracle error ORA-12154 TNS: could not resolve service name (DBD
> Error: OCIServerAttach)

> Yet I don't really want to use TNS (I think) - I want to do an old
> fashioned connect to SID TEST1 using userid/passwd test1/test1 equivalent
> to

> ORACLE_HOME=/opt/oracle.....
> ORACLE_SID=TEST1
> sqlplus test1/test1

> Can someone explain what is going on? I'm quite happy to admit I might
> have a configuration error either in the DBD installation or in Oracle
> but what do I do about it?

> How does DBI differentiate between the types of (Oracle) connect string
> it can receive anyway? This is one area where I feel the O'Reilly
> "Programming the perl DBI" is a bit short on explained examples :-}

> Many thanks

> Bill

To not use the listener to connect to a local database use
connect('dbi:Oracle:')

This will connect to the local default SID (or probably that in
ORACLE_SID).



Sat, 20 Sep 2003 19:03:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. NT ORACLE PERL DBD DBI->connect format

2. DBI/DBD/Oracle connect won't work (ORA-12154)

3. NT ORACLE PERL DBD DBI->connect format

4. DBD-Oracle: Problems connecting to Oracle

5. perl/Hyperwave DBI/DBD ODBC + Oracle questions

6. perl/Hyperwave DBI/DBD ODBC + Oracle questions

7. dbi dbd::ORACLE insert questions

8. DBI - DBD Oracle question grouping selects

9. perl/Hyperwave DBI/DBD ODBC + Oracle questions

10. Perl 5.003, DBI, DBD and Oracle question

11. Oracle DBD/DBI on HP-UX: can't load Oracle.sl

12. Unable to connect to Oracle through SQL*NET V2 and DBD 0.38

 

 
Powered by phpBB® Forum Software