I tried to connect my Netbeans Java project to Oracle Database but it showed the error ORA:12505 TNS:listener does not currently know of SID given in connect descriptor Even when I used SQL Developer to connect, I received the same error.
Does anyone know how to fix it? Thank you in advance.
NOTE: I use command SQLPlus in CMD and it work fine. My listener is not resting.
UPDATE: Here is my listener.ora file context:
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = C:\Oracle) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\bin\oraclr19.dll") ) )
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
and here is the result of lsnrctl status
LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 13-MAY-2021 18:36:25
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for 64-bit Windows: Version 19.0.0.0.0 - Production Start Date 13-MAY-2021 17:28:29 Uptime 0 days 1 hr. 7 min. 56 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File C:\Oracle\network\admin\listener.ora Listener Log File
C:\Oracle\base\diag\tnslsnr\DESKTOP-A10GTQJ\listener\alert\log.xml Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DESKTOP-A10GTQJ)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=DESKTOP-A10GTQJ)(PORT=5500))(Security=(my_wallet_directory=C:\ORACLE\BASE\admin\system\xdb_wallet))(Presentation=HTTP)(Session=RAW)) Services Summary... Service "48f123709e024effbc4514551f7222c6" has 1 instance(s). Instance "system", status READY, has 1 handler(s) for this service... Service "52448234712340b69f274bcc790ecfe0" has 1 instance(s). Instance "system", status READY, has 1 handler(s) for this service... Service "CLRExtProc" has 1 instance(s). Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "orclpdb" has 1 instance(s). Instance "system", status READY, has 1 handler(s) for this service... Service "system" has 1 instance(s). Instance "system", status READY, has 1 handler(s) for this service... Service "systemXDB" has 1 instance(s). Instance "system", status READY, has 1 handler(s) for this service... The command completed successfully
lsnrctl status
. – pmdba