700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > linux中oracle切sys Linux环境oracle数据库重置sys用户密码

linux中oracle切sys Linux环境oracle数据库重置sys用户密码

时间:2021-08-30 18:00:50

相关推荐

linux中oracle切sys Linux环境oracle数据库重置sys用户密码

今天在使用研发环境oracle数据库时发现普通用户被锁定了,需要sys用户去解锁。结果悲催的是sys用户密码不知道。然后请教同事,总结以下便捷方式重置sys用户密码并解锁普通数据库用户。

1、首先要登录到oracle安装的linux服务器

root@localhost temp>#su - oracle

password:

oracle@localhost temp>

2、查看oracle环境变量ORACLE_SID的设置情况linux:

oracle@localhost temp>#echo $ORACLE_SID [显示若为空需要先设置oracle环境变量ORACLE_SID]

oracle@localhost temp>#export ORACLE_SID=ORCL [设置环境变量ORACLE_SID]

oracle@localhost temp>#echo $ORACLE_SID

ORCL

oracle@localhost temp>

3、然后输入以下命令以sysdba身份登录到oracle 【此处因不知道sys用密码,所以以nolog 方式进入sqlplus环境】

----运行sqlplus命令,进入sqlplus环境。其中/nolog是不登陆到数据库服务器的意思,如果没有/nolog参数,sqlplus会提示你输入用户名和密码.

oracle@localhost temp>#sqlplus /nolog

connected to :

oracle database 11g ****************************************************

SQL>

4、以sys身份登录到oracle,重置sys用户密码

SQL>conn /as sysdba

SQL*Plus: Release **********************************

连接到:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>alter user sys identified by sys;

注意:windows 环境处理方式只是在第一步存在差异

在安装oracle的服务器打开命令窗口 cmd --》命令窗口

查看oracle环境变量ORACLE_SID的设置情况:echo %ORACLE_SID%

设置ORACLE_SID : set ORACLE_SID=ORCL

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。