应该输入什么用户名和密码才能使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 04:23:55  来源:igfitidea点击:

What username & password should be entered to use SQL plus

sqloraclesqlplus

提问by Abderrahim

I am using oracle 12c sometimes I need to use SQL plus. When I start sqlplus, it ask me for a username and password enter image description here

我使用oracle 12c 有时我需要使用SQL plus。当我启动 sqlplus 时,它要求我输入用户名和密码 在此处输入图片说明

I used SYSTEM and SYS as users but don't work with me .Anybody has a solution please

我使用 SYSTEM 和 SYS 作为用户,但不和我一起工作。任何人都有解决方案

回答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

阅读Oracle 12c 安装后强制步骤

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$ROOTwhich 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

它工作得很好。希望能帮助到你