設置密碼永不過期,首先查看用户的proifle是哪个,一般是default:
sql>SELECT username,PROFILE FROM dba_users;
查看指定概要文件(如default)的密码有效期设置:
sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
为某个用户设置密码永不过期
比如修改FSJT_USER用户的密码过期规则为无限期UNLIMITED
1. 新建profile "FSJT_USER_UNLIMIT,规则与DEFAULT一致(因为一个profile中包含很多的项目,我们此时只想修改过期规则,其他的不变)
CREATE PROFILE "FSJT_USER_UNLIMIT" LIMIT
SESSIONS_PER_USER UNLIMITED
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
CONNECT_TIME UNLIMITED
IDLE_TIME UNLIMITED
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
COMPOSITE_LIMIT UNLIMITED
PRIVATE_SGA UNLIMITED
FAILED_LOGIN_ATTEMPTS 10
PASSWORD_LIFE_TIME 180
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 7
PASSWORD_VERIFY_FUNCTION NULL;
然后查看下
SELECT profile FROM dba_profiles;
------------------------------
DEFAULT
FSJT_USER_UNLIMIT
2. 修改新建的profile(FSJT_USER_UNLIMIT),密码过期为不过期
ALTER profile FSJT_USER_UNLIMIT limit PASSWORD_LIFE_TIME UNLIMITED;
3. 修改用户的Profile为新的profile
alter user FSJT_USER profile FSJT_USER_UNLIMIT;