一、ORACLE 10g批量刷新用户密码
select 'alter user ' || username ||' identified by values '''||password ||''';' from dba_users where ACCOUNT_STATUS'LOCK' and ACCOUNT_STATUS not like 'EXPIRED%LOCKED';
或者
select 'alter user ' || username || ' identified by values ''' || password || ''';' from dba_users where account_status='OPEN';
得到以下结果
AA
--------------------------------------------------------------------------------
alter user SYS identified by values '8A8F025737A9097A';
alter user SYSTEM identified by values '2D594E86F93B17A1';
分别执行以上结果中的SQL语句
SQL>alter user SYS identified by values '8A8F025737A9097A';
User altered.
SQL>alter user SYSTEM identified by values '2D594E86F93B17A1';
User altered.
二、ORACLE 11g刷新用户密码
select 'alter user ' || name ||' identified by values '''||password ||''';' aa from sys.user$ where name in (select username from dba_users where ACCOUNT_STATUS'LOCK' and ACCOUNT_STATUS not like 'EXPIRED%LOCKED');
或者
select 'alter user ' || name ||' identified by values '''||password ||''';' aa from sys.user$ where name in (select username from dba_users where ACCOUNT_STATUS='OPEN');
得到以下结果
AA
--------------------------------------------------------------------------------
alter user SYS identified by values '8A8F025737A9097A';
alter user SYSTEM identified by values '2D594E86F93B17A1';
分别执行以上结果中的SQL语句
SQL>alter user SYS identified by values '8A8F025737A9097A';
User altered.
SQL>alter user SYSTEM identified by values '2D594E86F93B17A1';
User altered.
以上方法不用修改用户原有密码,只是刷新了用户密码的有效期期限。