windows – Oracle 19c listener stops on connection TNS-12541 error

I have just installed Oracle 19c Standard Edition 2 on Windows 10 and created a local database.

I can connect to it with sqlplus / sysdba, but if I try to connect with sqlplus user/password@host:port, the listener automatically stops and results in ORA-12537 error. Then lsnrctl status shows TNS 12541 error. I can restart the listener with lsnrctl startmanually, but it stops again if I try to connect.

I have tried

  1. Changing HOST to 127.0.0.1, localhost or name of PC
  2. Deleting and recreating the listener with Net Configuration Assistant
  3. Re-installing oracle
  4. Deleting log file, disable DIAG_ADR ins ora files
  5. Re-starting the services
  6. Editing HOSTS file, add oracle path to Windows system variables

But same error still appears.

The error log (It wasn’t fully in English, so I used machine translation)

PS C:Windowssystem32> sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 9 09:30:45 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. all rights reserved.


Connect to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> exit
From Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0 Disconnect
PS C:Windowssystem32> lsnrctl status

LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 09-Jun-2021 09:33:04

Copyright (c) 1991, 2019, Oracle. all rights reserved.

is connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LAPTOP)(PORT=1521)))
LISTENER STATUS
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 19.0.0.0.0 - Production
Start date 09-Jun-2021 09:14:58
Uptime 0 days 0 hours 18 minutes 9 seconds
Tracking level off
Security ON: Local OS Authentication
SNMP OFF
Listener parameter file D:ProgramOraclenetworkadminlistener.ora
Listener log file D:ProgramOraclenetworkloglistener.log
Listening endpoint summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=LAPTOP)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=. pipeEXTPROC1521ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=LAPTOP)(PORT=5500))(SECURITY=(my_wallet_directory=D:PROGRAMadminorclxdb_ wallet))(Presentation=HTTP)(Session=RAW))
Service Summary...
The service "CLRExtProc" contains 1 instance.
  Instance "CLRExtProc", status UNKNOWN, contains 1 handler for this service...
Service "orcl" contains 1 instance.
  Instance "orcl", status READY, contains 1 handler for this service...
Service "orclXDB" contains 1 instance.
  Instance "orcl", status READY, contains 1 handler for this service...
Command executed successfully
PS C:Windowssystem32> sqlplus sys/123456@localhost:1521/orcl

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 9 09:33:45 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.

ERROR:
ORA-12537: TNS: Connection closed


Please enter the username: sys as sysdba
Enter the password:

Connect to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> exit
From Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0 Disconnect
PS C:Windowssystem32> lsnrctl status

LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 09-Jun-2021 09:36:15

Copyright (c) 1991, 2019, Oracle. all rights reserved.

is connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LAPTOP)(PORT=1521)))
TNS-12541: TNS: No listener
 TNS-12560: TNS: Protocol adapter error
  TNS-00511: No listener
   64-bit Windows Error: 61: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS: No listener
 TNS-12560: TNS: Protocol adapter error
  TNS-00511: No listener
   64-bit Windows Error: 2: No such file or directory

listener.ora:

# listener.ora Network Configuration File: D:ProgramOracleNETWORKADMINlistener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:ProgramOracle)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:ProgramOraclebinoraclr19.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

DIAG_ADR_ENABLED_LISTENER = OFF

tnsnames.ora:

# tnsnames.ora Network Configuration File: D:ProgramOracleNETWORKADMINtnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )


sqlnet.ora:

# sqlnet.ora Network Configuration File: D:ProgramOracleNETWORKADMINsqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

DIAG_ADR_ENABLED = OFF

HOSTS:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a "https://dba.stackexchange.com/#" symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1   localhost   LAPTOP
::1             localhost