Added a new listener to my 'listeners.ora' file. How can I connect directly to it with SQLPlus? (skipping tnsnames.ora for now) I updated my listeners.ora file to include a new listener on port 1523. I then started the listener with lnsrctl start. I'd now like to connect to the database on that port via SQLPlus without specifying an entry in tnsnames.ora but I'm struggling.

So far, using the 'ezconnect method' I'm getting the following error:

SQL&gt; connect system/Pa33w0rd@//localhost:1523/db2
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor


And my listener.ora file looks like this:

# listener.ora Network Configuration File: C:\app\benfi\virtual\product\12.2.0\dbhome_2\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\benfi\virtual\product\12.2.0\dbhome_2)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\benfi\virtual\product\12.2.0\dbhome_2\bin\oraclr12.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    )
  )

LIST2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1523))
    )
  )
By default, PMON process registers with one listener and considers that "good enough."

This article describes how to set up two listeners and then how to manually register your database with the second listener.

You need to register the listener with the database:

alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=&lt;IP address or hostname&gt;)(PORT=1523))' scope=both;


You may need to issue this statement to list BOTH listeners. Otherwise, it may default to only the new, manually configured, one upon restart.

alter system set local_listener='Listener 1' scope=both;

See the Oracle Docs, where it shows how to add two listeners via comma-separation.

ALTER SYSTEM SET LOCAL LISTENER=["]listener_address["][,...];


Note that this link lists several other methods depending on the environment and what you're trying to achieve, so you may want to read that link if this first method fails to get what you want.