方法一
在命令符下键入如下语句
代码如下 | 复制代码 |
sqlplus /nolog connect /as sysdba alter user sys identified by xxx connect as 为:sysdba database 为:你自已定义的数据库 username 为:sys password 为:xxx |
方法二
代码如下 | 复制代码 |
set serveroutput on; DECLARE BEGIN FOR c IN (SELECT t.username FROM dba_users t where account_status='OPEN') LOOP EXECUTE IMMEDIATE 'alter user ' || c.username || ' identified by ' || c.username ; DBMS_LOCK.SLEEP(1) ; dbms_output.put_line('user ' || c.username || ' changed '); END LOOP; END; / |
时间: 2024-10-13 00:15:41