title: Oracle 18c XE: Connecting to a PDB using SID (for legacy application)
body: <p>I just installed the Oracle 18c XE Dadtabase and created a PDB (XEPDB1) inside the CDB. I then created a new schema inside the PDF and I can connect to that schema successfully using the Service Name (SQL Developer).</p>
  <p>But my legacy application requires a SID connection, which seems to be allowed using the <code>USE_SID_AS_SERVICE_XE = on</code> line in listener.ora. I also added the SID_DESC to the SID_LIST, but I still get the error:</p>
  <blockquote>
  <p>TNS:listener does not currently know of SID given in connect descriptor</p>
  </blockquote>
  <p>This is my listener.ora:</p>
  <pre><code>DEFAULT_SERVICE_LISTENER = XE
  USE_SID_AS_SERVICE_XE = on
  
  SID_LIST_LISTENER =
    (SID_LIST =
      (SID_DESC =
        (SID_NAME = CLRExtProc)
        (ORACLE_HOME = C:\app\michael\product\18.0.0\dbhomeXE)
        (PROGRAM = extproc)
        (ENVS = &quot;EXTPROC_DLLS=ONLY:C:\app\michael\product\18.0.0\dbhomeXE\bin\oraclr18.dll&quot;)
      )
      (SID_DESC =
        (GLOBAL_DBNAME = XE
        (ORACLE_HOME = C:\app\michael\product\18.0.0\dbhomeXE)
        (SID_NAME = XEPDB1
      )
    )
  
  LISTENER =
    (DESCRIPTION_LIST =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = persik.ddns.vmware.com)(PORT = 1521))
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      )
    )
  </code></pre>
  <p>And this is the tnsnames.ora:</p>
  <pre><code>XE =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = XE)
      )
    )
  
  XEPDB1 =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = XEPDB1)
      )
    )
  
  LISTENER_XE =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  
  
  ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      )
      (CONNECT_DATA =
        (SID = CLRExtProc)
        (PRESENTATION = RO)
      )
    )
  </code></pre>