我正在按照本教程在 Docker 映像中运行 Oracle https://oralytics.com/2021/10/01/oracle-21c-xe-database-and-docker-setup/
我已经有了图像,现在我应该运行
sqlplus system/SysPassword1@//localhost/XEPDB1
但是这个命令会触发用户名和密码询问(如下图所示),当我尝试将这些信息输入为:
出现以下错误时不起作用
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
Enter user-name: system
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
这不是 Docker(我从未使用过它),但显示了要做什么(至少,我希望如此)。
分别输入用户名和密码时,必须指定数据库和用户名:
c:\temp>sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Mon Apr 1 11:02:12 2024
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Enter user-name: scott@pdb1 --> this
Enter password:
Last Successful login time: Mon Apr 01 2024 09:38:48 +02:00
Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
SQL>