oracle ORA-01031: 作为 sysdba 的 sys 权限不足(即使在给出 orapwd 命令之后)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27937376/
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-19 02:41:39  来源:igfitidea点击:

ORA-01031: insufficient privileges as sysdba for sys (even after giving orapwd command)

linuxoracleoracle11g

提问by Athrey T R

I have installed an oracle 11g instance on a linux machine. After doing a DB bounce by issuing shutdown immediate and startup. Not able to login as sys/password@sidas sysdba. Even issued a

我已经在 linux 机器上安装了一个 oracle 11g 实例。通过发出立即关闭和启动来执行数据库反弹后。无法以sys/password@sidsysdba身份登录。甚至发出了

orapwd file=orapwsid  password=password entries=30 force=y

command, which created a pwd file also.

命令,它也创建了一个 pwd 文件。

But still not able to login as sys. I can connect to the DB by scott and other users created but not as a sysdba. Request you to help me.

但仍然无法以 sys.log 身份登录。我可以通过 scott 和其他创建但不能作为 sysdba 的用户连接到数据库。请求你帮助我。

回答by Bjarte Brandt

Make sure you are a dba!

确保您是dba!

[bb@limbo] ~/ $ . oraenv
ORACLE_SID = [XE] ? XE
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID bb.
You can set ORACLE_BASE manually if it is required.

[bb@limbo] ~/ $ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 16 19:02:11 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

sys@XE> exit

Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

[bb@limbo] ~/ $ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 16 19:05:56 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

ERROR:
ORA-01031: insufficient privileges

Enter user-name: 
[bb@limbo] ~/ $ su -c "usermod -G dba bb"

Password: 

[bb@limbo] ~/ $ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jan 16 19:06:29 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

sys@XE> 

回答by Senthil Kumar Vaithiyanathan

I got into same issue but did not know that I have to switch to oracle user to get dba access.

我遇到了同样的问题,但不知道我必须切换到 oracle 用户才能获得 dba 访问权限。

$ cd ORACLE_HOME/xe/bin 
$ ls -la oracle
-rwsr-s--x 1 oracle dba 165700472 Aug 28  2011 oracle
$ su oracle
$ sqlplus sys as sysdba

You should be able to login without any issues

您应该可以毫无问题地登录

回答by waleedazam

> $ORACLE_HOME/bin/sqlplus as sysdba

this would work if your $ORACLE_HOME is set correctly

如果您的 $ORACLE_HOME 设置正确,这将起作用

to check your $ORACLE_HOME run

检查您的 $ORACLE_HOME 运行

> echo $ORACLE_HOME

this will display oracle home path

这将显示 oracle 主路径

回答by Norliza

I managed to resolved this issue by making sure the instance name case sensitive in listener file. Also the orapw file. If the SID are small case, I make sure all related files using the smaller case intance name.

我设法通过确保侦听器文件中的实例名称区分大小写来解决此问题。还有 orapw 文件。如果 SID 是小写的,我会确保所有相关文件都使用小写的实例名称。