title: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
body: <p>I had my database working for over a year since yesterday. Out of sudden, I am no longer able to connect.</p>
  
  <p><a href="https://i.stack.imgur.com/c6Jqt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c6Jqt.png" alt="enter image description here"></a></p>
  
  <p>Error I am getting is: </p>
  
  <pre><code>Status : Failure -Test failed: Listener refused the connection with the following error:
  ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
  </code></pre>
  
  <p>Oracle 11.2
  Windows 7</p>
  
  <p>Both db and the listener are up and running. Port 1521 is opened.</p>
  
  <pre><code>C:\Apps\Oracle\product\11.2.0\dbhome_1\BIN&gt;netstat -a -n -o| findstr "1521"
    TCP    127.0.0.1:1521         0.0.0.0:0              LISTENING       2412
  </code></pre>
  
  <p>trying to log in via sqlplus</p>
  
  <pre><code>C:\depot\SBApp\main&gt;sqlplus sbdba0/sbdba0@SBDB
  
  SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 3 10:04:29 2015
  
  Copyright (c) 1982, 2010, Oracle.  All rights reserved.
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
  <pre><code>ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
  </code></pre>
  </blockquote>
  
  <p>Listener.ora</p>
  
  <pre><code># listener.ora Network Configuration File: C:\Apps\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
  # Generated by Oracle configuration tools.
  
  SID_LIST_LISTENER =
    (SID_LIST =
      (SID_DESC =
        (SID_NAME = CLRExtProc)
        (ORACLE_HOME = C:\Apps\Oracle\product\11.2.0\dbhome_1)
        (PROGRAM = extproc)
        (ENVS = "EXTPROC_DLLS=ONLY:C:\Apps\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
      )
    )
  
  LISTENER =
    (DESCRIPTION_LIST =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )
    )
  
  ADR_BASE_LISTENER = C:\Apps\Oracle\product
  </code></pre>
  
  <p>tnsnames.ora</p>
  
  <pre><code>ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      )
      (CONNECT_DATA =
        (SID = CLRExtProc)
        (PRESENTATION = RO)
      )
    )
  
  ###################################################################################################
  #SBDB
  SBDB =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )
      (CONNECT_DATA =
        (SERVICE_NAME = SBDB)
      )
    )
  
  ifile=C:\Apps\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames_QA.ora
  
  ifile=C:\Apps\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames_PROD.ora
  </code></pre>
  
  <p>I am out of ideas, any help will be appreciated.</p>