• Oracle EBS 初始化用户密码(转)


    ---修改密码,并且将限制用户下次登录的时候(第一次登录),强制要换一个新的口令:
    ---此过程可以完全模拟我们在标准用户的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;
  • 相关阅读:
    localhost和本机IP和127.0.0.1之间的区别
    git客户端msysGit和TortoiseGit使用
    JS正则
    css中外边距
    css定位浮动总结
    Teleport Ultra 抓包工具
    编程实践心得与设计思想
    Java 读写Properties配置文件
    如何成为一个优秀的DBA
    对DB2常见错误的列举以及破解方案
  • 原文地址:https://www.cnblogs.com/toowang/p/6019886.html
Copyright © 2020-2023  润新知