1 2 Previous Next 17 Replies Latest reply: Dec 27, 2010 8:59 AM by 790073 RSS

    TNS-12542: TNS:address already in use

    user10243788
      Hi,
      I have restored the image of my Win XP having Oracle 11g database onto a vm ware virtual disk on another PC.
      When i try to start the listener i am getting the error TNS-12541: TNS:no listener,starting the listener is giving the error TNS-12542: TNS:address already in use

      I am able to login to database by typing 'conn / as sysdba' but i need the listener to be up as i have to use an applicuation that requires the listener to be up.

      I have deleted the listener.ora and tnsnames.ora and recreated then using netca
      Used parameter files:
      D:\app\Ahmed\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
      
      
      Used TNSNAMES adapter to resolve the alias
      Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
      (HOST = 192.168.113.128)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = edwdev))
      )
      TNS-12541: TNS:no listener
      
      D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>lsnrctl start
      
      LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2010 16:40
      :11
      
      Copyright (c) 1991, 2010, Oracle.  All rights reserved.
      
      Starting tnslsnr: please wait...
      
      TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
      System parameter file is D:\app\Ahmed\product\11.2.0\dbhome_1\network\admin\list
      ener.ora
      Log messages written to d:\app\ahmed\diag\tnslsnr\home-9e3bae43d0\listener\alert
      \log.xml
      Error listening on: (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
      TNS-12542: TNS:address already in use
       TNS-12560: TNS:protocol adapter error
        TNS-00512: Address already in use
         32-bit Windows Error: 48: Unknown error
      
      Listener failed to start. See the error message(s) above...
      Listener.ora file
      EDWDEV =
        (DESCRIPTION_LIST =
          (DESCRIPTION =
            (ADDRESS = (PROTOCOL = TCP)(HOST = home-9e3bae43d0)(PORT = 1521))
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          )
        )
      
      ADR_BASE_EDWDEV = D:\app\Ahmed
      
      SID_LIST_EDWDEV =
        (SID_LIST =
          (SID_DESC =
            (SID_NAME = CLRExtProc)
            (ORACLE_HOME = D:\app\Ahmed\product\11.2.0\dbhome_1)
            (PROGRAM = extproc)
            (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Ahmed\product\11.2.0\dbhome_1\bin\oraclr11.dll")
          )
        )
      Tnsnames.ora
      EDWDEV =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.113.128)(PORT = 1521))
          )
          (CONNECT_DATA =
            (SERVICE_NAME = edwdev)
          )
        )
      
      ORACLR_CONNECTION_DATA =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          )
          (CONNECT_DATA =
            (SID = CLRExtProc)
            (PRESENTATION = RO)
          )
        )
      SQLNET.ora
      SQLNET.AUTHENTICATION_SERVICES= (NTS)
      
      NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
      I have googled one of the solutions is
      http://www.dba-oracle.com/t_ora_12542_tns_address_already_in_use.htm
      1) Locate the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
      On the Edit menu, click Add Value, and then add the following registry value:
      Value Name: MaxUserPort Data Type: REG_DWORD Value: 65534

      Valid Range: 5000-65534 (decimal) Default: 0x1388 (5000 decimal)

      I do not find add value in my edit of registry

      can someone help me solve this error
        • 1. Re: TNS-12542: TNS:address already in use
          Srini Chavali-Oracle
          >
          (ADDRESS = (PROTOCOL = TCP)(HOST = home-9e3bae43d0)(PORT = 1521))
          >

          I believe the issue is possibly here - with the "-" special character in the hostname. Try a hostname without special characters. I assume you are using a supported OS (Win XP Pro, not any Home version of Windows)

          HTH
          Srini
          • 2. Re: TNS-12542: TNS:address already in use
            user10243788
            thanks for replying srini, yes i am using win xp pro SP2
            I changed the hostname to IP in the listener.ora i am getting the following error
            D:\app\Ahmed\product\11.2.0\dbhome_1\network\admin\listener.ora
            # Generated by Oracle configuration tools.
            
            EDWDEV =
              (DESCRIPTION_LIST =
                (DESCRIPTION =
                  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.113.128)(PORT = 1521))
                  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
                )
              )
            D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>lsnrctl start
            
            LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2010 17:17
            :43
            
            Copyright (c) 1991, 2010, Oracle.  All rights reserved.
            
            Starting tnslsnr: please wait...
            
            TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
            System parameter file is D:\app\Ahmed\product\11.2.0\dbhome_1\network\admin\list
            ener.ora
            Log messages written to d:\app\ahmed\diag\tnslsnr\home-9e3bae43d0\listener\alert
            \log.xml
            Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=home-9e3bae43d0)(PORT=15
            21)))
            
            Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
            TNS-12541: TNS:no listener
             TNS-12560: TNS:protocol adapter error
              TNS-00511: No listener
               32-bit Windows Error: 61: Unknown error
            Why is it still taking hostname and not ip, also now its giving an error no listener.
            • 3. Re: TNS-12542: TNS:address already in use
              Srini Chavali-Oracle
              You will need to change the actual hostname of the XP Pro host, not just in the listener.ora file.

              Srini
              • 4. Re: TNS-12542: TNS:address already in use
                Chinar
                Change port number with other.For example instead of (PORT=1521) with (PORT=1522) in listener.ora file.Also change hostname (HOST =..) with IP address and start listener again then post result there.
                • 5. Re: TNS-12542: TNS:address already in use
                  user10243788
                  thanks for replying srini and chinar

                  I changed the hostname to home and tried still i got hte below error
                  D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>lsnrctl start
                  
                  LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2010 17:46
                  :06
                  
                  Copyright (c) 1991, 2010, Oracle.  All rights reserved.
                  
                  Starting tnslsnr: please wait...
                  
                  TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
                  System parameter file is D:\app\Ahmed\product\11.2.0\dbhome_1\network\admin\list
                  ener.ora
                  Log messages written to d:\app\ahmed\diag\tnslsnr\home\listener\alert\log.xml
                  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=home)(PORT=1521)))
                  
                  Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                  TNS-12541: TNS:no listener
                   TNS-12560: TNS:protocol adapter error
                    TNS-00511: No listener
                     32-bit Windows Error: 61: Unknown error
                  put IP instead of hostname and changed port to 1522 and saved the listener.ora
                  EDWDEV =
                    (DESCRIPTION =
                      (ADDRESS_LIST =
                        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.113.128)(PORT = 1522))
                      )
                      (CONNECT_DATA =
                        (SERVICE_NAME = edwdev)
                      )
                    )
                  D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>lsnrctl start
                  
                  LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2010 17
                  :01
                  
                  Copyright (c) 1991, 2010, Oracle.  All rights reserved.
                  
                  Starting tnslsnr: please wait...
                  
                  TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
                  System parameter file is D:\app\Ahmed\product\11.2.0\dbhome_1\network\admin\l
                  ener.ora
                  Log messages written to d:\app\ahmed\diag\tnslsnr\home\listener\alert\log.xml
                  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=home)(PORT=1521)))
                  
                  Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                  TNS-12541: TNS:no listener
                   TNS-12560: TNS:protocol adapter error
                    TNS-00511: No listener
                     32-bit Windows Error: 61: Unknown error
                  its still taking the port as 1521!
                  thanks again for your help guys
                  • 6. Re: TNS-12542: TNS:address already in use
                    sb92075
                    TNS-12560: TNS:protocol adapter error
                    Can result for a couple of different reasons
                    1) The OS service for listener must be running.
                    2) OS hostname must be consistent at all levels & resolve to a single IP#.

                    Oracle is victim & not culprit.
                    The root cause & solution are at OS/networking level & independent of Oracle.
                    • 7. Re: TNS-12542: TNS:address already in use
                      user10243788
                      I have oracle 10g as well installed, but i have deleted the listener.ora and tnsnames.ora from that admin location and also set the oracle_home and oracle_sid to 11g location still i wonder why its taking the port as 1521, i have restarted xp as well
                      D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>echo %ORACLE_HOME%
                      D:\app\Ahmed\product\11.2.0\dbhome_1
                      
                      D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>echo %ORACLE_SID%
                      edwdev
                      • 8. Re: TNS-12542: TNS:address already in use
                        sb92075
                        i have deleted the listener.ora
                        Since at least V10, no listener.ora file is required.
                        Every listener defaults to use port 1521.
                        Only a single listener should be running on any system & it should be same version as highest installed version of Oracle RDBMS.
                        • 9. Re: TNS-12542: TNS:address already in use
                          user10243788
                          thanks for replying sb92075
                          All the services are started
                          OracleOraDb11g_home1TNSListener
                          OracleOraDb11g_home1TNSListenerEDWDEV
                          OracleServiceEDWDEV
                          Also
                          C:\Documents and Settings\Ahmed>ping home
                          
                          Pinging home [192.168.113.128] with 32 bytes of data:
                          
                          Reply from 192.168.113.128: bytes=32 time=1ms TTL=128
                          Reply from 192.168.113.128: bytes=32 time<1ms TTL=128
                          Reply from 192.168.113.128: bytes=32 time<1ms TTL=128
                          Reply from 192.168.113.128: bytes=32 time<1ms TTL=128
                          I know Oracle is the victim here...but what could be causing this problem, thanks again
                          • 10. Re: TNS-12542: TNS:address already in use
                            Srini Chavali-Oracle
                            What is the value of the TNS_ADMIN environment variable (using the echo command) ?

                            HTH
                            Srini
                            • 11. Re: TNS-12542: TNS:address already in use
                              user10243788
                              srini tns_admin is not set,
                              D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>echo %TNS_ADMIN%
                              %TNS_ADMIN%
                              should i set this?
                              • 12. Re: TNS-12542: TNS:address already in use
                                user10243788
                                set tns_admin
                                D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>echo %TNS_ADMIN%
                                D:\app\Ahmed\product\11.2.0\dbhome_1\NETWORK\ADMIN 
                                D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>lsnrctl stop
                                
                                LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2010 18:40
                                :20
                                
                                Copyright (c) 1991, 2010, Oracle.  All rights reserved.
                                
                                Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                                TNS-12541: TNS:no listener
                                 TNS-12560: TNS:protocol adapter error
                                  TNS-00511: No listener
                                   32-bit Windows Error: 61: Unknown error
                                
                                D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>lsnrctl start
                                
                                LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2010 18:40
                                :24
                                
                                Copyright (c) 1991, 2010, Oracle.  All rights reserved.
                                
                                Starting tnslsnr: please wait...
                                
                                Service OracleOraDb11g_home1TNSListener already running.
                                TNS-12560: TNS:protocol adapter error
                                 TNS-00530: Protocol adapter error
                                
                                D:\app\Ahmed\product\11.2.0\dbhome_1\BIN>tnsping edwdev
                                
                                TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 25-DEC-2
                                010 18:41:14
                                
                                Copyright (c) 1997, 2010, Oracle.  All rights reserved.
                                
                                Used parameter files:
                                D:\app\Ahmed\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
                                
                                
                                Used TNSNAMES adapter to resolve the alias
                                Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
                                (HOST = 192.168.113.128)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = edwdev))
                                )
                                TNS-12541: TNS:no listener
                                • 13. Re: TNS-12542: TNS:address already in use
                                  sb92075
                                  http://www.lmgtfy.com/?q=TNS-00511:+No+listener+32-bit+Windows+Error:+61:+Unknown+error
                                  • 14. Re: TNS-12542: TNS:address already in use
                                    Chinar
                                    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                                    In above statement is clearly explain what is a problem.So : last error TNS:no listener and protocol adapter error it means your hosname is wrong or not specified in listener.ora file. I suggest that change this file and write there IP address of comp.Because in above statement HOST=nothing.And about previous error:+TNS-12542: TNS:address already in use+ to avoid this error you have to use other port then *1521* like use 1522 in listener.ora file
                                    1 2 Previous Next