【密码】oracle修改密码,11g的加密密码不见了

oracle命令行修改密码有两种方法,以oracle10g为例,如下:

一:解锁用户同时密码指定为tiger
[oracle@ocmu admin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 17 13:04:29 2012

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SYS@ORA10G>
SYS@ORA10G>alter user scott account unlock identified by tiger;

User altered.

SYS@ORA10G>conn scott/tiger
Connected.
SCOTT@ORA10G>
SCOTT@ORA10G>conn / as sysdba
Connected.
SYS@ORA10G>

二:查看一下scott加密后的密码
SYS@ORA10G>SELECT username,password FROM dba_users where username='SCOTT';

USERNAME                       PASSWORD
------------------------------ ------------------------------
SCOTT                          F894844C34402B67

SYS@ORA10G>
SYS@ORA10G>

:修改密码方法1:直接指定明文密码
SYS@ORA10G>alter user scott identified by scott123;

User altered.

SYS@ORA10G>conn scott/scott123
Connected.
SCOTT@ORA10G>conn / as sysdba
Connected.
SYS@ORA10G>

四:修改密码方法2:指定加密密码
SYS@ORA10G>alter user scott identified by values 'F894844C34402B67';

User altered.

SYS@ORA10G>
SYS@ORA10G>conn scott/tiger
Connected.
SCOTT@ORA10G>
SCOTT@ORA10G>conn / as sysdba
Connected.
SYS@ORA10G>

在oracle11g中,这两种的修改方式还是都适用的,不过,有一点有了变化,那就是在dba_users中的password,加密的密码字段已经被遗弃了(This column is deprecated,源自官方文档),如下:

五:解锁scott用户并指定密码为oracle
[oracle@ocmu ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 17 13:21:18 2012

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@ORA11GR2>alter user scott account unlock identified by oracle;

User altered.

SYS@ORA11GR2>
SYS@ORA11GR2>conn scott/oracle
Connected.
SCOTT@ORA11GR2>conn / as sysdba
Connected.
SYS@ORA11GR2>

六:查看scott用户的密码,发现password里面是空的。
SYS@ORA11GR2>SELECT username,password FROM dba_users where username='SCOTT';

USERNAME                       PASSWORD
------------------------------ ------------------------------
SCOTT

SYS@ORA11GR2>
SCOTT@ORA11GR2>set null unknown
SYS@ORA11GR2>SELECT username,password FROM dba_users where username='SCOTT';

USERNAME                       PASSWORD
------------------------------ ------------------------------
SCOTT                          unknown

SYS@ORA11GR2>

七:在命令行将scott的密码以明文方式改为oracle123
SYS@ORA11GR2>alter user scott identified by oracle123;

User altered.

SYS@ORA11GR2>

八:在命令行将scott的密码以加密的方式修改(使用刚才oracle10g中显示的加密密码,即tiger)
SYS@ORA11GR2>alter user scott identified by values 'F894844C34402B67';

User altered.

SYS@ORA11GR2>
SYS@ORA11GR2>conn scott/tiger
Connected.
SCOTT@ORA11GR2>
SCOTT@ORA11GR2>

小结:
1:oracle11g的加密密码已经不见了,提高了安全性。否则,我们可以利用这个加密密码,来修改其密码;
2:oracle10g中的加密后的密码,在oracle11g中是通用的。如果,我们生产库中的密码要经常性的修改,那么,我们可以考虑以加密的方式进行修改密码。




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/685769/viewspace-743763/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/685769/viewspace-743763/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值