如何恢复或更改 Oracle sysdba 密码

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

How to recover or change Oracle sysdba password

linuxoracleloginpasswordssysdba

提问by Adam Lerman

We are working with an oracle database in which the person that set it up is "long gone" and thus do not know the sysdba password, but need it. We have root access to the box (its on linux). Is there any way to recover or change the sys passwords?

我们正在使用一个 oracle 数据库,其中设置它的人“早已不在”,因此不知道 sysdba 密码,但需要它。我们对盒子有 root 访问权限(它在 linux 上)。有没有办法恢复或更改系统密码?

回答by Paul Hargreaves

Have you tried logging into Linux as your installed Oracle user then

您是否尝试以已安装的 Oracle 用户身份登录 Linux

sqlplus "/ as sysdba"

When you log in you'll be able to change your password.

登录后,您将能够更改密码。

alter user sys identified by <new password>;

Good luck :)

祝你好运 :)

回答by Lalit Kumar B

You can connect to the database locally using the combination of environment variables:

您可以使用环境变量的组合在本地连接到数据库:

  • ORACLE_HOME
  • ORACLE_SID.
  • ORACLE_HOME
  • ORACLE_SID

Depending on your OS:

取决于您的操作系统

Unix/Linux:

Unix/Linux:

export ORACLE_HOME=<oracle_home_directory_till_db_home>
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=<your_oracle_sid>
SQLPLUS / AS SYSDBA

Windows

视窗

set ORACLE_HOME=<oracle_home_path_till_db_home>
set PATH=%PATH%||%ORACLE_HOME%\bin
set ORACLE_SID=<your_oracle_sid>
SQLPLUS / AS SYSDBA

Once connected, you could then alter the userto modify the password:

连接后,您可以更改用户修改密码

ALTER USER username IDENTIFIED BY password;