Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to connect to my oracle database. I can't get the listener started. Here is what I have tried.

$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 20-JAN-2012 08:19:58

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Error listening on: (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12545: Connect failed because target host or object does not exist
 TNS-12560: TNS:protocol adapter error
  TNS-00515: Connect failed because target host or object does not exist

$ cat ./admin/tnsnames.ora

 
# TNSNAMES.ORA Network Configuration File: 
# /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora 
# 

EXTPROC_CONNECTION_DATA.test = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) 
    ) 
    (CONNECT_DATA = 
      (SID = DEVDB) 
        (PRESENTATION = RO) 
      ) 
    ) 

DEVDB = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) 
    ) 
    (CONNECT_DATA = 
      (SERVICE_NAME = DEVDB.test)
    ) 
  ) 

DEBDB.test = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = TCP)(HOST = DEVDB.test)(PORT = 1521)) 
    ) 
    (CONNECT_DATA = 
      (SERVICE_NAME = DEVDB.test)
    ) 
  )

$ hostname
test

Here is an example of a successful start on an other machine with similar set up. No listner.ora file just tnsnames.ora.

$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 20-JAN-2012 11:38:51

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracletest)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                20-JAN-2012 11:38:51
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracletest)(PORT=1521)))
The listener supports no services
The command completed successfully
share|improve this question
    
dbforums.com/oracle/… When u try to connect through SQLPlus what Oracle does is is read the tnsnames.ora file which is located in the client machine.The tnsnames.ora file lists the name of the connect strings where the client has the capability to connect to..When it finds a match it goes to the relevant server and ties to connect.Now the listener checks it own files listener.ora and matches it with the incoming call request. –  nelaar Jan 20 '12 at 8:57
    
contence of my network dir $pwd /u01/app/oracle/product/10.2.0/db_1/network $ ls ./admin/ samples shrept.lst tnsnames.ora –  nelaar Jan 20 '12 at 9:35

2 Answers 2

up vote 2 down vote accepted

You have empty HOST= in your listener.ora. I would edit it to be HOST=my.ip.address. Even HOST=127.0.0.1 will do if the application is on the same host. Did you run netca properly earlier (which is recommended for beginners)?

share|improve this answer

$ vim /etc/hosts

Change line from

127.0.0.1 localhost.localdomain localhost

to

127.0.0.1 test localhost.localdomain localhost

cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=test

$ hostname
test

$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 20-JAN-2012 10:08:54

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                20-JAN-2012 10:08:55
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))
The listener supports no services
The command completed successfully
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.