ORACLE 10g、11g批量刷新用户密码

2024年 6月 30日 68.5k 0

一、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.

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

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论