我非常着急,我按照这些步骤创建了一个新的 Oracle 数据库,并使用 sys 和 system 密码 "oracle"。创建成功后,但是当我尝试远程连接到这个数据库时,通过 SQLDeveloper 我收到了一个错误信息。
ORA-01017 invalid username/password denied
对于手动创建并授予连接权限的用户scott/tiger,这很有效。
新创建的实例为TEST。如果我通过sqlplus连接 /,则正常工作。
$ ORACLE_SID=TEST
$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri Jun 5 19:32:52 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
SQL>
当我尝试连接时,提示用户名/密码错误无法连接
$ ORACLE_SID=TEST
$ sqlplus sys/oracle@TEST as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri Jun 5 19:35:30 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
然而听者显然知道新实例
$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 05-JUN-2020 19:37:06
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 05-JUN-2020 18:56:57
Uptime 0 days 0 hr. 40 min. 8 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/d69dcf11a559/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=d69dcf11a559)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=d69dcf11a559)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "TEST" has 1 instance(s).
Instance "TEST", status READY, has 1 handler(s) for this service...
Service "TESTXDB" has 1 instance(s).
Instance "TEST", status READY, 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...
The command completed successfully