Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> Localhost doesnt work in listener.ora or tnsnames.ora
wazzag
post Jul 29 2010, 01:59 PM
Post #1


Newbie
*

Group: Members
Posts: 4
Joined: 29-July 10
Member No.: 43,585



Hi,

I want to be able to use "localhost" in my tnsnames.ora and listener.ora files but for some reason its not working.

just concentrating on the listener, when I have the following in my listener.ora the database doesnt register with the listener:

########################################
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))
########################################

This is even after using the "alter system register" command. I'm checking whether my database is registering using "lsnrctl services".

With the following in listener.ora all is fine:
########################################
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.152)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))
########################################

So why wont it work with localhost?! I'm running Oracle 11G on XP Pro.

I can ping localhost.

Please help!

Thanks,
W
Go to the top of the page
 
+Quote Post
SteveC
post Jul 29 2010, 02:33 PM
Post #2


Advanced Member
***

Group: Members
Posts: 2,835
Joined: 11-March 08
Member No.: 18,933



You installed a loopback adapter?
Go to the top of the page
 
+Quote Post
burleson
post Jul 29 2010, 05:26 PM
Post #3


Advanced Member
***

Group: Members
Posts: 11,640
Joined: 26-January 04
Member No.: 13



Hi,

>> but for some reason its not working.

Please post the error message and number!

Usually a "localhost" error is a problem with your DNS.

Start by replacing the localhost with the IP address and get that working.

Then, see why your localhost names is not resolved in /etc/hosts

CODE
# cat /etc/hosts | grep localhost

192.168.100.16    myhost.us.mycompany.com   myhost
127.0.0.1         localhost                 localhost.localdomain


If you are on Windows, it's likely some registry crap.

See here, how to configure localhostr a PC:

http://download.oracle.com/docs/cd/B28359_...2010/ap_net.htm

*************************************************
>> I can ping localhost.

You can ping using the hostname? That's a clue!

I use these steps to diagnose connectivity issues:

http://www.dba-oracle.com/t_troubleshootin...vity_errors.htm


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post
wazzag
post Jul 30 2010, 02:22 AM
Post #4


Newbie
*

Group: Members
Posts: 4
Joined: 29-July 10
Member No.: 43,585



Thanks for the response. When I use the IP address I have no problems at all.

Using "localhost" :

LISTENER.ORA
-----------------
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

TNSNAMES.ORA
------------------
orcl_localhost =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)



C:\Documents and Settings\Warren>lsnrctl services

LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 30-JUL-2010 08:13:29

Copyright © 1991, 2007, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully

***********

C:\Documents and Settings\Warren>sqlplus asp/asp@orcl_localhost

SQL*Plus: Release 11.1.0.6.0 - Production on Fri Jul 30 08:17:53 2010

Copyright © 1982, 2007, Oracle. All rights reserved.

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Enter user-name:

***********
My hosts entry:

127.0.0.1 localhost

C:\Documents and Settings\Warren>ping localhost

Pinging DF-WG-LAP2 [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
***********

I haven't installed a loopback adaptor - this sounds promising!

Thanks for the help again guys,
Warren
Go to the top of the page
 
+Quote Post
wazzag
post Jul 30 2010, 06:40 AM
Post #5


Newbie
*

Group: Members
Posts: 4
Joined: 29-July 10
Member No.: 43,585



Nope - just installed a loopback adaptor, as described here http://download.oracle.com/docs/cd/B19306_...qs.htm#CHDGIFBC, and it didnt fix it :-(
Go to the top of the page
 
+Quote Post
burleson
post Jul 30 2010, 07:09 AM
Post #6


Advanced Member
***

Group: Members
Posts: 11,640
Joined: 26-January 04
Member No.: 13



Hi Warren,

>> The listener supports no services

That's not right! You need to add the SID_LIST to your istener!

http://www.dba-oracle.com/t_sample_listener_ora_files.htm

CODE
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = dnsname)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/xxx)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = mysid.com)
      (ORACLE_HOME =/u01/app/oracle/product/xxx)
      (SID_NAME = mysid)
    )
  )



*******************************************************
Sorry, I don't do windows, but you should be able to narrow this down by following my checklist:

http://www.dba-oracle.com/t_troubleshootin...vity_errors.htm

- It works with the IP address, so you know it's related to the DBS resolution

- You can ping using localhost

The next step is to see if you can tnsping

Please add the sid_list and try tnsping and report back!


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post
wazzag
post Jul 30 2010, 09:19 AM
Post #7


Newbie
*

Group: Members
Posts: 4
Joined: 29-July 10
Member No.: 43,585



Adding the SID_LIST has fixed it!
So why did this work when I was using IP adresses and no SID_LIST?

So I wonder if the loopback adaptor was needed?


Thanks a lot for your help!
Go to the top of the page
 
+Quote Post
burleson
post Jul 30 2010, 06:39 PM
Post #8


Advanced Member
***

Group: Members
Posts: 11,640
Joined: 26-January 04
Member No.: 13



>> Adding the SID_LIST has fixed it!

Great! Glad we could help!

Tell your friends . . .

***************************************
>> So why did this work when I was using IP adresses and no SID_LIST?

Who knows?

Play around in TEST and see!


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1st November 2014 - 04:34 AM