Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-12170: TNS:Connect timeout occurred

Re: ORA-12170: TNS:Connect timeout occurred

From: joel garry <joel-garry_at_home.com>
Date: 17 Jan 2007 14:14:38 -0800
Message-ID: <1169072078.500176.217280@a75g2000cwd.googlegroups.com>

bartona_at_ohsu.edu wrote:
> I have read all topics regarding to this error but not found any answer
> that would help: I have Oracle 10g (10.1) installed under Linux. I
> can connect just fine using sqlplus from the local machine and I can
> connect remotely with any application (e.g. sqldeveloper). However,
> when I try to connect to the database locally from a perl script, I get
> the ORA-12170 error message.
>
> use DBI;
>
> $ENV{"ORACLE_HOME"} = "/u01/app/oracle/OraHome_1";
>
> $odsn="DBI:Oracle:xxx";
> $ouid="yyy";
> $opwd="zzz";
>
> $odbh= DBI->connect ($odsn,$ouid,$opwd);
>
> The necessary environmental variables are set:
>
> ORACLE_SID=xxx
> ORACLE_HOME=/u01/app/oracle/OraHome
>
> The perl script obviously finds the instance xxx because if I change
> the instance name xxx to a different name, then I get a different error
> message (in that case TNS:could not resolve the connect identifier

Hmmm... could this mean that perl is using the network to try to connect, as opposed to the local bequeath connection?

Try using sqlplus to connect using the a/b_at_c syntax. On my peecee with XE, XE added an entry like
XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX)(PORT = 1521))     (CONNECT_DATA =

      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)

    )
  )

(where the x'd out part is my hostname, of course). This might give a clue as to what perldbi wants, assuming it wants to do everything network-like.

Or, modify tnsnames.ora for the local connection to use BEQ, search for that in the net services admin guide
http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14212/troublestng.htm and

http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14268/asoappa.htm
and see metalink Note:69725.1 (apologies if any of this is bogus since
I haven't done much on O10).  Note the adapters command shows what
protocols you can use.

> specified). So, DBI understands my xxx SID. The error is not caused
> by a busy network because I am connecting locally, and sqlplus is able
> to connect.
>

jg

--
@home.com is bogus.
Linus surprised at resilience of linux kernel:
http://www.zdnet.com.au/news/software/soa/Torvalds_surprised_by_resilience_of_2_6_kernel/0,130061733,339273095,00.htm
Received on Wed Jan 17 2007 - 16:14:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US