应该输入什么用户名和密码才能使用 SQL plus
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35174434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What username & password should be entered to use SQL plus
提问by Abderrahim
回答by Lalit Kumar B
Since you are on 12c, if you do not mention the Pluggable database, by default you will connect to the Container databasei.e. CDB$ROOT
. You need to explicitly mention whether you want to connect to the CDBor the PDB.
由于你在 12c 上,如果你没有提到Pluggable database,默认情况下你会连接到Container 数据库ie CDB$ROOT
。您需要明确提及是要连接到CDB还是PDB。
Read Oracle 12c Post Installation Mandatory Steps
See,
看,
C:>sqlplus
SQL*Plus: Release 12.1.0.1.0 Production on Wed Feb 3 16:41:44 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: system
Enter password:
Last Successful login time: Wed Feb 03 2016 16:39:42 +05:30
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions
SQL> show con_name
CON_NAME
------------------
CDB$ROOT
CDB$ROOT
which means I am connected to CDB.
CDB$ROOT
这意味着我已连接到CDB。
Let's connect to the PDB:
让我们连接到PDB:
SQL> alter session set container=pdborcl;
Session altered.
SQL> show con_name
CON_NAME
------------------
PDBORCL
You should tell Oracle whether you need to connect to CDB or PDB:
您应该告诉 Oracle 是否需要连接到 CDB 或 PDB:
sqlplus username/password@service_name
回答by Aleksej
As an example, a sequence of operations about connecting to Oracle with SQLPlus; starting from a CMD prompt, I have the following:
以SQLPlus连接Oracle的一系列操作为例;从 CMD 提示开始,我有以下内容:
Microsoft Windows [Versione 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tutti i diritti riservati.
D:\>tnsping xe
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 03-FEB-2016 20:02:46
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product.2.0\server\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER
= DEDICATED) (SERVICE_NAME = XE)))
OK (20 msec)
D:\>sqlplus /nolog
SQL*Plus: Release 11.2.0.2.0 Production on Mer Feb 3 20:02:52 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> conn sys/Passw0rd@xe as sysdba
Connected.
SQL> conn sys/Passw0rd@xe as sysoper
Connected.
SQL> conn system/Passw0rd@xe
Connected.
SQL>
I hope this may help to understand what works / not works for you, thus helping everyone to find a solution.
我希望这可以帮助您了解什么对您有效/无效,从而帮助每个人找到解决方案。
回答by Pavlo Chechehov
Use this command in terminal or cmd sqlplus /nolog. This is mentioned in Oracle Database Administrator's Guide
在终端或 cmd sqlplus /nolog 中使用此命令。这在 Oracle 数据库管理员指南中提到
Start SQL*Plus and connect to your Oracle Database instance with the SYSDBA system privilege. To authenticate with a password file, enter the following commands, and then enter the SYS password when prompted:
- $ sqlplus /nolog
- SQL> CONNECT SYS AS SYSDBA
启动 SQL*Plus 并使用 SYSDBA 系统权限连接到您的 Oracle 数据库实例。要使用密码文件进行身份验证,请输入以下命令,然后在出现提示时输入 SYS 密码:
- $ sqlplus /nolog
- SQL> 以 SYSDBA 身份连接 SYS
This should help!
这应该有帮助!
回答by Mauricio Osorio
I Install SQL Developer 19c on my Mac recently and when I try to log in SQL Plus I use:
我最近在 Mac 上安装了 SQL Developer 19c,当我尝试登录 SQL Plus 时,我使用:
username: system
用户名:系统
password: oracle
密码:oracle
and it works just fine. Hope it helps
它工作得很好。希望能帮助到你