DECLARE
l_dbname varchar2(20);
P_INIT_PASSWORD VARCHAR2(30);
l_change_flag VARCHAR2(10);
l_reason varchar2(2000);
BEGIN
select name into l_dbname from v$database;
if l_dbname not like '%PROD' then
update fnd_user f set f.user_guid='' where f.user_guid is not null;
commit;
for rec in (select user_name from fnd_user f where f.user_id > 1110 and f.user_name not in ('SYSADMIN','SETUP','ASADMIN'))
loop
select dbms_random.string('x',8) into P_INIT_PASSWORD from dual;
l_change_flag := fnd_web_sec.change_password(rec.user_name,P_INIT_PASSWORD);
IF L_change_FLAG = 'Y' THEN
COMMIT;
DBMS_OUTPUT.PUT_LINE('成功初始化用户('||rec.user_name||')的密码为:'||P_INIT_PASSWORD);
ELSE
rollback;
l_reason := fnd_message.get;
fnd_message.set_name('FND', 'FND_CHANGE_PASSWORD_FAILED');
fnd_message.set_token('USER_NAME', rec.user_name);
fnd_message.set_token('REASON', l_reason);
app_exception.raise_exception;
END IF;
end loop;
end if;
END;
/
最新评论
这个牛
放下欲望,男人从来不醉,充分且必要
勇气、责任、自信、创新,为天下先!
软件即数据,软件即服务,软件即管理,软件就是对人类各种社会活动的仿真和记录。软件很重要,但软件不可能凌驾于业务之上,尤其不可能高人一等。