定期修改密码 定期刷新密码 - 副本
以下是指对oracle 10g
--先查密码是否过期
select b.username 用户名 ,b.profile ,b.account_status 状态, b.created 创建日期,a.ptime 设置日期,b.lock_date 锁定日期,b.expiry_date 密码过期时限 from (select * from sys.user$) a, (select * from dba_users) b where a.name = b.username and account_status='OPEN'
--执行前先检查系统参数
select PROFILE, RESOURCE_NAME, LIMIT
from dba_profiles
where RESOURCE_NAME in ('PASSWORD_LIFE_TIME',
'PASSWORD_GRACE_TIME',
'PASSWORD_REUSE_MAX',
'PASSWORD_LOCK_TIME',
'FAILED_LOGIN_ATTEMPTS',
'PASSWORD_VERIFY_FUNCTION')
order by 1
先修改为无限制
alter profile DEFAULT limit PASSWORD_REUSE_MAX UNLIMITED;
alter profile DEFAULT limit PASSWORD_REUSE_TIME UNLIMITED;
--alter user sys identified by jmpsbxxb
alter user system identified by jmpsbxxb
alter profile DEFAULT limit PASSWORD_REUSE_MAX UNLIMITED;
alter profile DEFAULT limit PASSWORD_REUSE_TIME UNLIMITED;
--执行以下脚本生成修改脚本,
select 'alter user '|| username ||' identified by values '''||password ||''';' from dba_users
where ACCOUNT_STATUS<>'LOCKED' and ACCOUNT_STATUS not like 'EXPIRED%LOCKED';
--再执行上面生成的脚本,
--alter user SUP_FLEX identified by values '96679A1E6C027EAF';
--再修改为有限制
alter profile DEFAULT limit PASSWORD_REUSE_TIME 5;
alter profile DEFAULT limit PASSWORD_REUSE_MAX 5;
oracle 11g
select name,password from sys.user$ where name in (select username from dba_users);
事实上dba_users就是结合user$等相关基表创建的视图
从dba_uses视图的相关语句可以看出当用户被创建为全局或外部认证时password才有加密值,而10g中dba_users的password列完全取值与user$的password列值
从dba_uses视图的相关语句可以看出当用户被创建为全局或外部认证时password才有加密值,而10g中dba_users的password列完全取值与user$的password列值