title: Cannot resolve ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
body: <p>I am trying to figure out how to enable the listener for my pdb in sql developer.  I have a pdb named mydatabase, with schemas created.  I have an application connecting with string:</p>
  <pre><code>jdbc:oracle:thin:@//172.21.0.2:1521/mydatabase.localdomain
  </code></pre>
  <p>I have tried</p>
  <pre><code>alter session set container mydatabase
  alter system set address....
  alter system register
  </code></pre>
  <p>Is there a way in sql developer to easily fix this?</p>
  <p>Below is the output from my lsnrctl:</p>
  <pre><code>oracle@45a14a439b6e /]$ lsnrctl service mydatabase.localdomain
  
  LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 28-AUG-2021 03:12:47
  
  Copyright (c) 1991, 2016, Oracle.  All rights reserved.
  
  Connecting to (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
  Services Summary...
  Service &quot;ORCLCDB.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
      Handler(s):
        &quot;DEDICATED&quot; established:31 refused:0 state:ready
           LOCAL SERVER
  Service &quot;ORCLCDBXDB.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
      Handler(s):
        &quot;D000&quot; established:0 refused:0 current:0 max:1022 state:ready
           DISPATCHER &lt;machine: 45a14a439b6e, pid: 90&gt;
           (ADDRESS=(PROTOCOL=tcp)(HOST=45a14a439b6e)(PORT=43969))
  Service &quot;ca90769ec9bc014be053020015ac01c1.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
      Handler(s):
        &quot;DEDICATED&quot; established:31 refused:0 state:ready
           LOCAL SERVER
  Service &quot;ca910bc928b70229e053020015acdbee.localdomain&quot; has 2 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
      Handler(s):
        &quot;DEDICATED&quot; established:31 refused:0 state:ready
           LOCAL SERVER
    Instance &quot;ORCLCDB&quot;, status READY, has 2 handler(s) for this service...
      Handler(s):
        &quot;D000&quot; established:0 refused:0 current:0 max:1022 state:ready
           DISPATCHER &lt;machine: 45a14a439b6e, pid: 90&gt;
           (ADDRESS=(PROTOCOL=tcp)(HOST=45a14a439b6e)(PORT=43969))
        &quot;DEDICATED&quot; established:10 refused:0 state:ready
           LOCAL SERVER
  Service &quot;orclpdb1.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
      Handler(s):
        &quot;DEDICATED&quot; established:31 refused:0 state:ready
           LOCAL SERVER
  Service &quot;mydatabase.localdomain&quot; has 2 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
      Handler(s):
        &quot;DEDICATED&quot; established:31 refused:0 state:ready
           LOCAL SERVER
    Instance &quot;ORCLCDB&quot;, status READY, has 2 handler(s) for this service...
      Handler(s):
        &quot;D000&quot; established:0 refused:0 current:0 max:1022 state:ready
           DISPATCHER &lt;machine: 45a14a439b6e, pid: 90&gt;
           (ADDRESS=(PROTOCOL=tcp)(HOST=45a14a439b6e)(PORT=43969))
        &quot;DEDICATED&quot; established:10 refused:0 state:ready
           LOCAL SERVER
  The command completed successfully
  </code></pre>
  <hr />
  <p>After repeating the steps from stackoverflow.com/questions/63458885/…</p>
  <p>from the app server:</p>
  <pre><code>root@c6420aec9bfa:/opt/authserver# netcat -v 172.21.0.2 1522
  netcat: connect to 172.21.0.2 port 1522 (tcp) failed: Connection refused
  root@c6420aec9bfa:/opt/authserver# netcat -v 172.21.0.2 1521
  Connection to 172.21.0.2 1521 port [tcp/*] succeeded!
  </code></pre>
  <p>from the oracle server: (no port 1522)</p>
  <pre><code>tcp        0      0 172.21.0.2:58646        172.21.0.2:1521         ESTABLISHED
  .
  .
  </code></pre>
  <p>lsnrctl status:</p>
  <pre><code>Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=1b73269c0a29)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=1b73269c0a29)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.2.0/dbhome_1/admin/ORCLCDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))
  Services Summary...
  Service &quot;ORCLCDB.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
  Service &quot;ORCLCDBXDB.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
  Service &quot;ca90769ec9bc014be053020015ac01c1.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
  Service &quot;ca910bc928b70229e053020015acdbee.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
  Service &quot;orclpdb1.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
  Service &quot;mydatabase.localdomain&quot; has 1 instance(s).
    Instance &quot;ORCLCDB&quot;, status READY, has 1 handler(s) for this service...
  The command completed successfully
  </code></pre>
  <p>NOTE: this is a docker environment. docker shows 1521 and 1522 exposed.</p>