This discussion is archived
1 2 Previous Next 20 Replies Latest reply: Oct 9, 2012 7:50 AM by EdStevens Go to original post RSS
  • 15. Re: Changin from IPs to hostnames in tnsnames and listener heads to TNS-12541
    sb92075 Guru
    Currently Being Moderated
    elvegaa_esp wrote:
    no remote client can ever connect to system listening on 127.0.0.1
    It's a production DB. All remote clients can connect with no problem, and there is no other listener running.
    I saw this configuration in some other servers. They work too, so this can't be the source of the problem.
    If you really understood how networking actually works you would not be here looking for answers.

    Since you are convinced that you know better than I, I won't waste more of my time to convince you otherwise.

    You're On Your Own (YOYO)!
  • 16. Re: Changin from IPs to hostnames in tnsnames and listener heads to TNS-12541
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    If you see it before in other server that not mean its correct , Yes right it working but its not the right solution or recommendation . and you have to know the usage of loopback Ip
    and then you have to decide its this wrong or right ?


    Usually Loopback addresses are for testing or for accessing resources on the same computer
  • 17. Re: Changin from IPs to hostnames in tnsnames and listener heads to TNS-12541
    elvegaa_esp Newbie
    Currently Being Moderated
    All the servers that i'm seeing here has a messy /etc/hosts file, and I cant give an answer but yes, it works, I'm not lying and I'm not saing that "I know more than anyone". I'm just describing the scenario. I'm here for some ideas, not for headaches.
  • 18. Re: Changin from IPs to hostnames in tnsnames and listener heads to TNS-12541
    elvegaa_esp Newbie
    Currently Being Moderated
    I'm sure that this is not the recommended configuration. It's a little bit messy.
    May be I should find out why this configuration, I didnt made it, and then solve the tnsnames and listener host naming issue.

    Regards and thanks for your help.
  • 19. Re: Changin from IPs to hostnames in tnsnames and listener heads to TNS-12541
    elvegaa_esp Newbie
    Currently Being Moderated
    OK. I know what was the problem.

    It's nothing related with the /etc/hosts file. Although its not a recommended configuration, its correct.
    elvegaa_esp wrote:

    $ lsnrctl reload LISTENER_VCSBD
    My mistake was with the listener and lsnrctl. I had to perform a 'stop'/'start' listener instead a 'reload'. 'reload' just refresh for added/removed static services in the listener.ora. It doesn't refresh the network configuration:

    I've performed a test in a new machine. I've emulated the same scenario
    >
    $ echo $HOSTNAME
    Zeppo


    $ cat /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 zeppo localhost.localdomain localhost
    62.37.231.124 zeppo localhost.localdomain localhost


    $ ping zeppo
    PING zeppo (127.0.0.1) 56(84) bytes of data.
    64 bytes from zeppo (127.0.0.1): icmp_seq=0 ttl=64 time=0.019 ms
    64 bytes from zeppo (127.0.0.1): icmp_seq=1 ttl=64 time=0.008 ms

    --- zeppo ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1000ms
    rtt min/avg/max/mdev = 0.008/0.013/0.019/0.006 ms, pipe 2


    $ cat /usr/oracle/product/11.2.0/network/admin/tnsnames.ora

    VEGAORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 62.37.231.124)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = vegaorcl)
    )
    )

    LISTENER_vegaorcl =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 62.37.231.124)(PORT = 1521))
    )
    )



    $ cat /usr/oracle/product/11.2.0/network/admin/listener.ora

    LISTENER_vegaorcl =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 62.37.231.124)(PORT = 1521))
    )
    )

    SID_LIST_LISTENER_vegaorcl =
    (SID_LIST=
    (SID_DESC=
    (GLOBAL_DBNAME=vegaorcl)
    (SID_NAME=vegaorcl)
    (SERVICE_NAME=vegaorcl)
    (ORACLE_HOME=/usr/oracle/product/11.2.0)
    )
    )


              
              
    $ lsnrctl status listener_vegaorcl

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:22:58

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

    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    ESTADO del LISTENER
    ------------------------
    Alias listener_vegaorcl
    Versión TNSLSNR for Linux: Version 11.1.0.6.0 - Production
    Fecha de Inicio 09-OCT-2012 14:09:16
    Tiempo Actividad 0 días 0 hr. 13 min. 42 seg.
    Nivel de Rastreo off
    Seguridad ON: Local OS Authentication
    SNMP OFF
    Parámetros del Listener /usr/oracle/product/11.2.0/network/admin/listener.ora
    Log del Listener /usr/oracle/diag/tnslsnr/Zeppo/listener_vegaorcl/alert/log.xml
    Recibiendo Resumen de Puntos Finales...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=62.37.231.124)(PORT=1521)))
    Resumen de Servicios...
    El servicio "vegaorcl" tiene 2 instancia(s).
    La instancia "vegaorcl", con estado UNKNOWN, tiene 1 manejador(es) para este servicio...
    La instancia "vegaorcl", con estado READY, tiene 1 manejador(es) para este servicio...
    El servicio "vegaorclXDB" tiene 1 instancia(s).
    La instancia "vegaorcl", con estado READY, tiene 1 manejador(es) para este servicio...
    El servicio "vegaorcl_XPT" tiene 1 instancia(s).
    La instancia "vegaorcl", con estado READY, tiene 1 manejador(es) para este servicio...
    El comando ha terminado correctamente



    --- CONNECTIVITY FROM REMOTE MACHINE
    C:\oracle\ora92\network\admin>tnsping vegaorcl

    TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 09-OCT-20
    12 15:35:31

    Copyright (c) 1997 Oracle Corporation. All rights reserved.

    Archivos de parßmetros utilizados:


    Adaptador TNSNAMES utilizado para resolver el alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
    (HOST = 62.37.231.124)(PORT = 1521))) (CONNECT_DATA = (SID = vegaorcl) (SERVER =
    DEDICATED)))
    Realizado correctamente (110 mseg)
    ---- ##############################

    >


    Now, lets change the tnsnames.ora and listener.ora

    >
    $ vi tnsnames.ora
    VEGAORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = zeppo)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = vegaorcl)
    )
    )

    LISTENER_vegaorcl =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = zeppo)(PORT = 1521))
    )
    )


    $ vi listener.ora
    LISTENER_vegaorcl =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = zeppo)(PORT = 1521))
    )
    )

    SID_LIST_LISTENER_vegaorcl =
    (SID_LIST=
    (SID_DESC=
    (GLOBAL_DBNAME=vegaorcl)
    (SID_NAME=vegaorcl)
    (SERVICE_NAME=vegaorcl)
    (ORACLE_HOME=/usr/oracle/product/11.2.0)
    )
    )
              
              
    $ lsnrctl reload listener_vegaorcl

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:30:46

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

    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=zeppo)(PORT=1521)))
    TNS-12541: TNS:no hay ningún listener
    TNS-12560: TNS:error del adaptador de protocolo
    TNS-00511: No hay ningún listener
    Linux Error: 111: Connection refused
    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= *62.37.231.124* )(PORT=1521)))
    El comando ha terminado correctamente


    $ lsnrctl status listener_vegaorcl

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:31:00

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

    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=zeppo)(PORT=1521)))
    TNS-12541: TNS:no hay ningún listener
    TNS-12560: TNS:error del adaptador de protocolo
    TNS-00511: No hay ningún listener
    Linux Error: 111: Connection refused
    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= *62.37.231.124* )(PORT=1521)))
    ESTADO del LISTENER
    ------------------------
    Alias listener_vegaorcl
    Versión TNSLSNR for Linux: Version 11.1.0.6.0 - Production
    Fecha de Inicio 09-OCT-2012 14:09:16
    Tiempo Actividad 0 días 0 hr. 21 min. 43 seg.
    Nivel de Rastreo off
    Seguridad ON: Local OS Authentication
    SNMP OFF
    Parámetros del Listener /usr/oracle/product/11.2.0/network/admin/listener.ora
    Log del Listener /usr/oracle/diag/tnslsnr/Zeppo/listener_vegaorcl/alert/log.xml
    Recibiendo Resumen de Puntos Finales...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST= *62.37.231.124* )(PORT=1521)))
    Resumen de Servicios...
    El servicio "vegaorcl" tiene 2 instancia(s).
    La instancia "vegaorcl", con estado UNKNOWN, tiene 1 manejador(es) para este servicio...
    La instancia "vegaorcl", con estado READY, tiene 1 manejador(es) para este servicio...
    El servicio "vegaorclXDB" tiene 1 instancia(s).
    La instancia "vegaorcl", con estado READY, tiene 1 manejador(es) para este servicio...
    El servicio "vegaorcl_XPT" tiene 1 instancia(s).
    La instancia "vegaorcl", con estado READY, tiene 1 manejador(es) para este servicio...
    El comando ha terminado correctamente


    $ tnsping vegaorcl

    TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:31:10

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

    Archivos de parámetros utilizados:
    /usr/oracle/product/11.2.0/network/admin/sqlnet.ora


    Adaptador TNSNAMES utilizado para resolver el alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = zeppo)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = vegaorcl)))
    TNS-12541: TNS:no hay ningún listener
    >

    Now, start/stop listener, instead reload.

    >
    $ lsnrctl stop listener_vegaorcl

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:36:33

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

    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    El comando ha terminado correctamente


    $ lsnrctl start listener_vegaorcl

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:36:50

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

    Iniciando /usr/oracle/product/11.2.0/bin/tnslsnr: espere...

    TNSLSNR for Linux: Version 11.1.0.6.0 - Production
    El archivo de parámetros del sistema es /usr/oracle/product/11.2.0/network/admin/listener.ora
    Mensajes de log escritos en /usr/oracle/diag/tnslsnr/Zeppo/listener_vegaorcl/alert/log.xml
    Recibiendo en: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    Recibiendo en: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST= zeppo )(PORT=1521)))

    Conectándose a (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    ESTADO del LISTENER
    ------------------------
    Alias listener_vegaorcl
    Versión TNSLSNR for Linux: Version 11.1.0.6.0 - Production
    Fecha de Inicio 09-OCT-2012 14:36:50
    Tiempo Actividad 0 días 0 hr. 0 min. 0 seg.
    Nivel de Rastreo off
    Seguridad ON: Local OS Authentication
    SNMP OFF
    Parámetros del Listener /usr/oracle/product/11.2.0/network/admin/listener.ora
    Log del Listener /usr/oracle/diag/tnslsnr/Zeppo/listener_vegaorcl/alert/log.xml
    Recibiendo Resumen de Puntos Finales...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST= zeppo )(PORT=1521)))
    Resumen de Servicios...
    El servicio "vegaorcl" tiene 1 instancia(s).
    La instancia "vegaorcl", con estado UNKNOWN, tiene 1 manejador(es) para este servicio...
    El comando ha terminado correctamente


    $ tnsping vegaorcl

    TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 09-OCT-2012 14:38:00

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

    Archivos de parámetros utilizados:
    /usr/oracle/product/11.2.0/network/admin/sqlnet.ora


    Adaptador TNSNAMES utilizado para resolver el alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = zeppo)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = vegaorcl)))
    Realizado correctamente (10 mseg)



    ---- REMOTE CONNECTION TEST---
    C:\oracle\ora92\network\admin>tnsping vegaorcl

    TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 09-OCT-20
    12 15:53:09

    Copyright (c) 1997 Oracle Corporation. All rights reserved.

    Archivos de parßmetros utilizados:


    Adaptador TNSNAMES utilizado para resolver el alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
    (HOST = 62.37.231.124)(PORT = 1521))) (CONNECT_DATA = (SID = vegaorcl) (SERVER =
    DEDICATED)))
    Realizado correctamente (20 mseg)
    >


    It was this little mistake.
    However, I'm surprised with how a long experienced user like sb92075 (registered in '99,. bunch of posts..) didn't notice the real mistake, and go in a rush thinking of that this hosts file configuration is wrong, and blame me like a newbie with no respect at all.

    Thanks to all, but no for sb92075. You dont help anybody.

    Regards

    Edited by: elvegaa_esp on 09-oct-2012 7:06
  • 20. Re: Changin from IPs to hostnames in tnsnames and listener heads to TNS-12541
    EdStevens Guru
    Currently Being Moderated
    elvegaa_esp wrote:
    OK. I know what was the problem.

    <snip>

    ---- REMOTE CONNECTION TEST---
    C:\oracle\ora92\network\admin>tnsping vegaorcl

    TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 09-OCT-20
    12 15:53:09

    Copyright (c) 1997 Oracle Corporation. All rights reserved.

    Archivos de parßmetros utilizados:


    Adaptador TNSNAMES utilizado para resolver el alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
    (HOST = 62.37.231.124)(PORT = 1521))) (CONNECT_DATA = (SID = vegaorcl) (SERVER =
    Your HOST parameter is specifying the IP address, thus is not dependent on whatever malformed information you have in your local hosts file. I think the tnsnames.ora you showed us was from the the server, not the remote client the above example was using.

    Fundamental networking remains. Requests to 127.0.0.1 will never leave the machine from which the request is made. Oracle TNS simply sits on top of the standard network stack, and so does not change that fundamental fact. Also, if you have the same host name (alias) listed twice in your hosts file
    $ cat /etc/hosts:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1               servervcs localhost.localdomain localhost
    62.37.231.78            servervcs
    #62.37.231.68           servervcs
    ::1             localhost6.localdomain6 localhost6
     
    a lookup of 'servervcs' will stop on the first occurrence, thus resolve to 127.0.0.1, as you yourself proved:
     
     
    $ ping servervcs
    PING servervcs (127.0.0.1) 56(84) bytes of data.
    64 bytes from servervcs (127.0.0.1): icmp_seq=1 ttl=64 time=0.017 ms
    64 bytes from servervcs (127.0.0.1): icmp_seq=2 ttl=64 time=0.013 ms
     
    Both of the above were taken from your original post.
    DEDICATED)))
    Realizado correctamente (20 mseg)
    >


    It was this little mistake.
    <snip>
    Regards

    Edited by: elvegaa_esp on 09-oct-2012 7:06
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points