博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle EBS 初始化用户密码
阅读量:4680 次
发布时间:2019-06-09

本文共 1702 字,大约阅读时间需要 5 分钟。

---修改密码,并且将限制用户下次登录的时候(第一次登录),强制要换一个新的口令:

---此过程可以完全模拟我们在标准用户的Form里面初始化用户的密码的动作!

 

---最后要说明的是,这个处理过程是通过研究标准创建用户的画面得出来的结果,所以,如果有需要,请放心使用!

SELECT last_logon_date,password_date,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN

FROM FND_USER

WHERE USER_NAME = 'QWR01';

 

DECLARE

   P_USER_NAME FND_USER.USER_NAME%TYPE;

   P_INIT_PASSWORD VARCHAR2(30);---初始化密码,非加密的。

   ---

   l_change_flag VARCHAR2(10);

   l_reason varchar2(2000);

BEGIN

    ---输入参数(用户名和初始化的密码)

    P_USER_NAME := 'QWR01';

    P_INIT_PASSWORD := 'PWD123';

   

    ---------

    ---处理--

    L_change_FLAG := fnd_web_sec.change_password(P_USER_NAME,P_INIT_PASSWORD);

 

 

    IF L_change_FLAG = 'Y' THEN

        -- Bug 7016473 - During an administrative reset, set the last_logon_date to NULL

        -- instead of SYSDATE.  last_logon_date should reflect the date the user last

        -- logged in successfully, not the date the user's password was reset.

        -- This does not regress the fix for bug 4690441 because in fnd_web_sec.disable_user

        -- if last_logon_date is NULL, the last_update_date will be used which is the same

        -- date of the sysadmin reset, so the effect is the same.

        --

        -- Reset password_date field to null to force password

        -- expiration the next time user logs on.

        --

        UPDATE FND_USER

        SET last_logon_date= NULL

           ,password_date = NULL

           --,LAST_UPDATE_DATE = SYSDATE

           --,LAST_UPDATE_LOGIN = FND_GLOBAL.LOGIN_ID

         WHERE USER_NAME = P_USER_NAME;

       

        COMMIT;

        ----

        DBMS_OUTPUT.PUT_LINE('成功初始化用户('||P_USER_NAME||')的密码为:'||P_INIT_PASSWORD);

    ELSE

        ---显示为什么不可以修改

        l_reason := fnd_message.get;

        fnd_message.set_name('FND', 'FND_CHANGE_PASSWORD_FAILED');

        fnd_message.set_token('USER_NAME', P_USER_NAME);

        fnd_message.set_token('REASON', l_reason);

        app_exception.raise_exception;

    END IF;

END;

转载于:https://www.cnblogs.com/quanweiru/p/3775645.html

你可能感兴趣的文章
题解 P1034 【矩形覆盖】
查看>>
12.1 线程控制简介
查看>>
day 2 ,while ,编码,运算符 初识
查看>>
获得完整路径的代码
查看>>
四则运算之主要代码
查看>>
盒模型--边框(二)
查看>>
K60的DMA多路脉冲计数
查看>>
【模板】离散化
查看>>
LeetCode "Super Ugly Number" !
查看>>
LeetCode "Coin Change"
查看>>
LeetCode "488. Zuma Game" !
查看>>
虚函数、纯虚函数详解
查看>>
django mongodb配置
查看>>
Android Preference 实现长按监听 long-clickable
查看>>
03 django1.0.2 默认管理配置
查看>>
mysql 中 unix_timestamp和from_unixtime函数
查看>>
Java Web项目BlogAutoGenerator编写日志1
查看>>
简单数论(一)
查看>>
Populating Next Right Pointers in Each Node
查看>>
CXF和Axis的比较【转】
查看>>