title: Oracle throws ORA-12514 after shutdown immediate
body: <p>My goal is to get my container database into a mount mode to execute a system alter statement to enable flashback functions. </p>
  
  <p><a href="http://docs.oracle.com/database/121/ADFNS/adfns_flashback.htm#ADFNS611" rel="nofollow">Configuring Your Database for Flashback Transaction</a></p>
  
  <p>Environment: OS Win 8.1 64-bit, Oracle 12c (12.1.0.2.0) 64-Bit</p>
  
  <p>I verified that both my listener and db service are running.</p>
  
  <p><strong>Listener.log</strong></p>
  
  <blockquote>
    <p>Tue Sep 08 13:31:42 2015 System parameter file is
    C:\OracleServer\product\12.1.0\dbhome_1\network\admin\listener.ora Log
    messages written to
    C:\OracleServer\diag\tnslsnr\NA-D02979\listener\alert\log.xml Trace
    information written to
    C:\OracleServer\diag\tnslsnr\NA-D02979\listener\trace\ora_9672_20416.trc
    Trace level is currently 0</p>
    
    <p>Started with pid=9672 Listening on:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.105.118)(PORT=1521)))
    Listening on:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    Listening on:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
    Listener completed notification to CRS on start</p>
    
    <p>TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN
    CODE Listening on:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=NA-D02979.vgnet.volgrp.com)(PORT=5500))(Security=(my_wallet_directory=C:\ORACLESERVER\admin\CDB1\xdb_wallet))(Presentation=HTTP)(Session=RAW))
    Dynamic address is already listened on
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    08-SEP-2015 13:32:25 * service_register * cdb1 * 0 08-SEP-2015
    13:33:22 * service_update * cdb1 * 0</p>
  </blockquote>
  
  <p><strong>Results of SqlPlus</strong></p>
  
  <blockquote>
    <p>C:\Users\jeff>sqlplus sys/**********@CDB1 as sysdba</p>
    
    <p>SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 8 13:44:18 2015</p>
    
    <p>Copyright (c) 1982, 2014, Oracle.  All rights reserved.</p>
    
    <p>Connected to: Oracle Database 12c Enterprise Edition Release
    12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options</p>
    
    <p>SQL> shutdown immediate</p>
    
    <p>Database closed.</p>
    
    <p>Database dismounted.</p>
    
    <p>ORACLE instance shut down.</p>
    
    <p>ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor</p>
    
    <p>Warning: You are no longer connected to ORACLE.</p>
    
    <p>SQL> startup mount</p>
    
    <p>SP2-0640: Not connected </p>
    
    <p>SQL> ^C </p>
    
    <p>C:\Users\jeff>sqlplus> sys/**********@CDB1 as sysdba</p>
    
    <p>SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 8 13:46:24 2015</p>
    
    <p>Copyright (c) 1982, 2014, Oracle.  All rights reserved.</p>
    
    <p>ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor</p>
    
    <p>Enter user-name:</p>
  </blockquote>
  
  <p>When I connect to my container DB as sysdba, I can issue the shutdown immediate command, but as soon as the database dismounts, the listener no longer knows about the database and I am unable to issue the "startup mount" command.</p>
  
  <p><strong>Listener.ora</strong></p>
  
  <blockquote>
    <p>SID_LIST_LISTENER =   (SID_LIST =</p>
  
  <pre><code>(SID_DESC =
  
    (SID_NAME = CLRExtProc)
  
    (ORACLE_HOME = C:\OracleServer\product\12.1.0\dbhome_1)
  
    (PROGRAM = extproc)
  
    (ENVS = "EXTPROC_DLLS=ONLY:C:\OracleServer\product\12.1.0\dbhome_1\bin\oraclr12.dll")
  
  ) 
  </code></pre>
    
    <p>(SID_DESC =</p>
  
  <pre><code> (GLOBAL_DBNAME = CDB1)
  
   (ORACLE_HOME = C:\app\oracle\product\11.2.0\dbhome_1)
  
   (SID_NAME = CDB1)
  
  )   )
  </code></pre>
    
    <p>LISTENER =   (DESCRIPTION_LIST =    (DESCRIPTION =</p>
  
  <pre><code>  (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.105.118)(PORT = 1521))
  </code></pre>
  </blockquote>
  
  <pre><code>  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  </code></pre>
  
  <blockquote>
  <pre><code>  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  
  )   )
  </code></pre>
  </blockquote>
  
  <p><strong>TNSNames.ora</strong></p>
  
  <blockquote>
    <p>LISTENER_CDB1 =</p>
  
  <pre><code> (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  </code></pre>
    
    <p>CDB1 =</p>
  
  <pre><code> (DESCRIPTION =
  
     (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.105.118)(PORT = 1521))
  
     (CONNECT_DATA =
  
      (SERVER = DEDICATED)
  
       (SERVICE_NAME = CDB1.vgnet.volgrp.com)
  
     )
  
   )
  </code></pre>
    
    <p>ORACLR_CONNECTION_DATA =</p>
  
  <pre><code> (DESCRIPTION =
  
     (ADDRESS_LIST =
  
       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  
     )
  
     (CONNECT_DATA =
  
       (SID = CLRExtProc)
  
       (PRESENTATION = RO)
  
     )
  
   )
  </code></pre>
  </blockquote>
  
  <p>I have defined a static SID to my container database. </p>
  
  <p><strong>Second Round Results</strong></p>
  
  <p>From the following results, I followed what Alex Pool had documented in the answer. I am on the same machine as the database. I have set ORACLE_SID to cdb1, then every time I try to connect, I am getting a ORA-12560: TNS:protocol adapter error. Why is my listener still throwing TNS errors when I am trying to connect based on SID?</p>
  
  <pre><code>C:\Users\jeff&gt;%ORACLE_SID%
  'cdb1' is not recognized as an internal or external command,
  operable program or batch file.
  
  C:\Users\jeff&gt;sqlplus sys/********** as sysdba
  
  SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 9 08:05:25 2015
  
  Copyright (c) 1982, 2014, Oracle.  All rights reserved.
  
  ERROR:
  ORA-12560: TNS:protocol adapter error
  
  Enter user-name: ^C
  C:\Users\jeff&gt;sqlplus / as sysdba
  
  SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 9 08:05:36 2015
  
  Copyright (c) 1982, 2014, Oracle.  All rights reserved.
  
  ERROR:
  ORA-12560: TNS:protocol adapter error
  
  Enter user-name: ^C
  C:\Users\jeff&gt;sqlplus /nolog
  
  SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 9 08:05:50 2015
  
  Copyright (c) 1982, 2014, Oracle.  All rights reserved.
  
  SQL&gt; connect / as sysdba
  ERROR:
  ORA-12560: TNS:protocol adapter error
  
  SQL&gt;
  </code></pre>