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.

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

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值