Chinaunix首页 | 论坛 | 博客
  • 博客访问: 535253
  • 博文数量: 28
  • 博客积分: 150
  • 博客等级: 入伍新兵
  • 技术积分: 429
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-25 12:07
个人简介

Cisco Certified Internetwork Expert(Routing and Switching) CCIE R&S 2101X, IBM Certified Advanced Technical Expert - Power Systems with AIX v2, Red Hat Certified Engineer RHCE 130-165-39X, Oracle Certified Master 10g

文章分类

全部博文(28)

文章存档

2018年(1)

2017年(2)

2016年(4)

2015年(8)

2014年(4)

2013年(2)

2011年(7)

我的朋友

分类: Oracle

2013-08-02 21:16:02

========phanx.com========
Author:   phanx
Updated: 2013-8-2
转载请保留作者信息
=========================

Oracle 数据库从11g开始,用户默认有180天口令过期的策略。因此,没有修改口令策略的用户很容易就遇到因为口令过期就被锁定的情况。今天在检查一个11gR1库的用户就发现一个用户已经进入Grace状态了。
由于用户口令是上收了的,不能随便修改,否则会引起应用连接失败,因此必须使用同现有口令一致的口令来修改。

11g和以前版本保存口令密文的表发生了变化,无法直接由

  1. select username,password from dba_users;

获得口令密文从而使用alter user重置。11g中,如果安装时选择了使用11g新的安全策略,则dba_users中password列是空值,用户密码区分大小写,并使用SHA加密,密文可从 user$ 表中获得。

My Support上在文档 The Impact of PASSWORD_LIFE_TIME Database Profile Parameter Default to 180 Days on Network Charging and Control (文档 ID 1543668.1) 提供了11g口令重置的方法:



  1. SQL> select username, profile, account_status from dba_users where username='TEST01';
  2.  
  3. USERNAME PROFILE ACCOUNT_STATUS
  4. ------------------------------ ------------------------------ --------------------------------
  5. TEST01 DEFAULT EXPIRED

  6. SQL> select sqltext from
  7. (
  8.     select name, 'alter user '||name||' identified by values '''||password||''';' sqltext from user$ where spare4 is null and password is not null
  9.     union
  10.     select name, 'alter user '||name||' identified by values '''||spare4||';'||password||''';' sqltext from user$ where spare4 is not null and password is not null
  11. ) where name = 'TEST01';

  12. SQLTEXT
  13. -----------------------------------------------------------------------------------------------------------------------------------------------------------
  14. alter user TEST01 identified by values 'S:E4B813A6492A9810B4BEAC8FB16714EFB5E6692E80E0F6EF6522F82BA818;6894B93C1D1CA343';

  15. SQL> --Copy & Paste the previous SQLTEXT in the next SQL transaction.
  16. SQL> alter user TEST01 identified by values 'S:E4B813A6492A9810B4BEAC8FB16714EFB5E6692E80E0F6EF6522F82BA818;6894B93C1D1CA343';

  17. SQL> --Now you can verify that the account_status has now been reset to OPEN

  18. SQL> select username, profile, account_status from dba_users where username='TEST01';
  19.  
  20. USERNAME PROFILE ACCOUNT_STATUS
  21. ------------------------------ ------------------------------ --------------------------------
  22. TEST01 DEFAULT OPEN

 


阅读(2215) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~