ORACLE 10g、11g批量刷新用戶密碼

一、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 'xxxxx';
alter user SYSTEM identified by values 'xxxxx';

分別執行以上結果中的SQL語句

SQL>alter user SYS identified by values 'xxxxx';

User altered.

SQL>alter user SYSTEM identified by values 'xxxxx';

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 'xxxxx';
alter user SYSTEM identified by values 'xxxxx';

分別執行以上結果中的SQL語句

SQL>alter user SYS identified by values 'xxxxx';

User altered.

SQL>alter user SYSTEM identified by values 'xxxxxx';

User altered.

以上方法不用修改用戶原有密碼,只是刷新了用戶密碼的有效期期限。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章