我刚刚安装了 Oracle 19c 和 SQL Developer。我打开 SQL Developer 并尝试建立一个新连接,但我得到了
“侦听器拒绝连接并出现以下错误:ORA-12505,TNS:侦听器当前不知道连接描述符中给出的 SID (CONNECTION_ID=HYjeJ...==)”。
我正在尝试与
Username: SYS
Role: SYSDBA
Hostname: localhost
SID: xe (this is the default, I know nothing about it)
我尝试使用“ALTER USER SYS IDENTIFIED BY oracle ACCOUNT UNLOCK;”更改 SYS 用户密码 正如这里推荐的那样。我只能使用 SYS 作为 SYSDBA 登录 SQL Plus,并且没有密码。我试图创建一个用户并设置他们的个人资料以允许登录,但这样做会出错。
编辑:
lsnrctl status
LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 08-MAR-2021 19:39:44
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 04-MAR-2021 07:42:09
Uptime 4 days 11 hr. 57 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\Desktop\Drawer\Tutorials\Oracle\WINDOWS.X64_193000_db_home\network\admin\listener.ora
Listener Log File C:\Desktop\Drawer\Tutorials\Oracle\diag\tnslsnr\AlbuGierke\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=AlbuGierke)(PORT=5500))(Security=(my_wallet_directory=C:\DESKTOP\DRAWER\TUTORIALS\ORACLE\admin\orcl\xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "0154b89e82cd4245957cd2ed1b57502d" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "52448234712340b69f274bcc790ecfe0" has 1 instance(s).
Instance "orcl", 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 "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclpdb" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
编辑二:
将@EdStevens 解决方案更进一步,我通过SELECT * FROM all_users ORDER BY CREATED;
在 SQL Plus 中运行命令来识别可用用户。然后,我使用安装时创建的 PDBADMIN 用户(在 19c 发布时似乎已经创建了几个用户)来完成连接。