﻿{"id":182,"date":"2015-01-13T20:14:30","date_gmt":"2015-01-13T12:14:30","guid":{"rendered":"http:\/\/www.llku.com\/?p=182"},"modified":"2020-06-05T15:07:14","modified_gmt":"2020-06-05T07:07:14","slug":"%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87%e7%a8%8b%e5%ba%8f%e6%96%b9%e5%bc%8f%e8%a7%a3%e5%af%86ebs%e7%b3%bb%e7%bb%9f%e7%94%a8%e6%88%b7%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.llku.com\/?p=182","title":{"rendered":"\u5982\u4f55\u901a\u8fc7\u7a0b\u5e8f\u65b9\u5f0f\u89e3\u5bc6EBS\u7cfb\u7edf\u7528\u6237\u5bc6\u7801"},"content":{"rendered":"<p>\u6b64\u65b9\u6cd5\u5df2\u7ecf\u901a\u8fc7\u6d4b\u8bd5\uff0c\u4e14\u662f\u501f\u9274\u884c\u5185\u524d\u8f88\u7684\u65b9\u5f0f\uff0c\u8868\u793a\u611f\u8c22\uff0c\u540c\u65f6\u9700\u8981\u6ce8\u610f\uff0c\u6b64\u7a0b\u5e8f\u5728\u516c\u53f8\u6b63\u5f0f\u73af\u5883\u4e2d\u4e25\u7981\u4f7f\u7528\uff0c\u4f1a\u5e26\u6765\u5b89\u5168\u95ee\u9898\uff1a<br \/>\n&#8212;\u5c06\u4ee5\u4e0b\u4ee3\u7801\u7f16\u8bd1\u81f3\u76ee\u6807\u7cfb\u7edf&#8212;-<br \/>\nCREATE OR REPLACE PACKAGE cux_fnd_web_sec AUTHID CURRENT_USER AS<br \/>\nFUNCTION encrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2;<br \/>\nFUNCTION decrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2;<br \/>\nEND;<br \/>\n\/<br \/>\nCREATE OR REPLACE PACKAGE BODY cux_fnd_web_sec AS<br \/>\nFUNCTION encrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2 AS<br \/>\nLANGUAGE JAVA NAME &#8216;oracle.apps.fnd.security.WEBSessionManagerProc.encrypt(java.lang.String,java.lang.String) return java.lang.String&#8217;;<br \/>\nFUNCTION decrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2 AS<br \/>\nLANGUAGE JAVA NAME &#8216;oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String&#8217;;<br \/>\nEND;<br \/>\n\/<\/p>\n<p>&#8212;\u67e5\u8be2\u51fa\u5bc6\u5319&#8212;<\/p>\n<p>SELECT user_name,<br \/>\ncux_fnd_web_sec.decrypt(upper(&#8216;apps_uat_xx&#8217;), ENCRYPTED_USER_PASSWORD) pwd,<br \/>\nEND_DATE<br \/>\nFROM APPS.fnd_user<br \/>\nwhere user_name = upper(&#8216;xxxx&#8217;)\uff1b<\/p>\n<p>SELECT usr.encrypted_user_password<br \/>\nFROM fnd_user usr<br \/>\nWHERE usr.user_name = &#8216;TEST&#8217;<br \/>\n&#8212;\u8fd4\u56de\u660e\u6587\uff0c\u5c06\u67e5\u8be2\u51fa\u7684\u7ed3\u679c\u4f5c\u4e3a\u6761\u4ef6\u5e26\u5165\u4e0b\u9762SQL\u547d\u4ee4&#8212;<br \/>\nSELECT cux_fnd_web_sec.decrypt(&#8216;APPS&#8217;, &#8216;ZH226036FE93A20FAED89C4B92838B7C2A7F7133E613B028C482354D32F3C471AAB024794EAC70570FD2443717865F7BA824&#8217;)<br \/>\nFROM dual;<br \/>\n\u7ed3\u679c\u4e3a: TEST<\/p>\n<p>&#8212;\u6279\u91cf\u83b7\u53d6\uff0cORACLE\u4e3aapps\u7528\u6237\u5bc6\u7801<br \/>\ndeclare<br \/>\nl_info varchar2(10000);<br \/>\ncursor user_info is<br \/>\nSELECT usr.user_name, usr.encrypted_user_password<br \/>\nFROM fnd_user usr<br \/>\nwhere 1 = 1<br \/>\nand to_char(usr.start_date, &#8216;yyyy&#8217;) &gt;= &#8216;2012&#8217;<br \/>\norder by usr.creation_date asc;<br \/>\nbegin<br \/>\nfor c1 in user_info loop<br \/>\nl_info := cux_fnd_web_sec.decrypt(&#8216;ORACLE&#8217;, c1.encrypted_user_password);<br \/>\ndbms_output.put_line(&#8216;\u7528\u6237\u540d\uff1a&#8217; || c1.user_name || &#8216; \u5bc6\u7801\uff1a&#8217; || l_info);<br \/>\nend loop;<br \/>\nend;<\/p>\n<p>&nbsp;<\/p>\n<p>&#8211;\u540e\u53f0\u91cd\u7f6e\u5bc6\u7801<br \/>\nDECLARE<br \/>\nv_user_name \u00a0 \u00a0VARCHAR2(30) := UPPER(&#8216;test01&#8217;);<br \/>\nv_new_password VARCHAR2(30) := &#8216;test01&#8217;;<br \/>\nv_status \u00a0 \u00a0 \u00a0 BOOLEAN;<br \/>\nBEGIN<br \/>\nv_status := fnd_user_pkg.ChangePassword(username \u00a0 \u00a0=&gt; v_user_name,<br \/>\nnewpassword =&gt; v_new_password);<br \/>\nIF v_status = TRUE THEN<br \/>\ndbms_output.put_line(&#8216;The password reset successfully for the User:&#8217; ||<br \/>\nv_user_name);<br \/>\nCOMMIT;<br \/>\nELSE<br \/>\nDBMS_OUTPUT.put_line(&#8216;Unable to reset password due to&#8217; || SQLCODE || &#8216; &#8216; ||<br \/>\nSUBSTR(SQLERRM, 1, 100));<br \/>\nROLLBACK;<br \/>\nEND IF;<br \/>\nEND;<\/p>\n<p>&#8211;\u76f4\u63a5\u521d\u59cb\u5316<\/p>\n<p>DECLARE<br \/>\nP_USER_NAME FND_USER.USER_NAME%TYPE;<br \/>\nP_INIT_PASSWORD VARCHAR2(30);&#8212;\u521d\u59cb\u5316\u5bc6\u7801\uff0c\u975e\u52a0\u5bc6\u7684\u3002<br \/>\n&#8212;<br \/>\nl_change_flag VARCHAR2(10);<br \/>\nl_reason varchar2(2000);<br \/>\nBEGIN<br \/>\n&#8212;\u8f93\u5165\u53c2\u6570(\u7528\u6237\u540d\u548c\u521d\u59cb\u5316\u7684\u5bc6\u7801)<br \/>\nP_USER_NAME := &#8216;SYSADMIN&#8217;;<br \/>\nP_INIT_PASSWORD := &#8216;sinosoft123&#8217;;<\/p>\n<p>&#8212;&#8212;&#8212;<br \/>\n&#8212;\u5904\u7406&#8211;<br \/>\nL_change_FLAG := fnd_web_sec.change_password(P_USER_NAME,P_INIT_PASSWORD);<\/p>\n<p>IF L_change_FLAG = &#8216;Y&#8217; THEN<br \/>\n&#8212; Bug 7016473 &#8211; During an administrative reset, set the last_logon_date to NULL<br \/>\n&#8212; instead of SYSDATE. last_logon_date should reflect the date the user last<br \/>\n&#8212; logged in successfully, not the date the user&#8217;s password was reset.<br \/>\n&#8212; This does not regress the fix for bug 4690441 because in fnd_web_sec.disable_user<br \/>\n&#8212; if last_logon_date is NULL, the last_update_date will be used which is the same<br \/>\n&#8212; date of the sysadmin reset, so the effect is the same.<br \/>\n&#8212;<br \/>\n&#8212; Reset password_date field to null to force password<br \/>\n&#8212; expiration the next time user logs on.<br \/>\n&#8212;<br \/>\nUPDATE FND_USER<br \/>\nSET last_logon_date= NULL<br \/>\n,password_date = NULL<br \/>\n&#8211;,LAST_UPDATE_DATE = SYSDATE<br \/>\n&#8211;,LAST_UPDATE_LOGIN = FND_GLOBAL.LOGIN_ID<br \/>\nWHERE USER_NAME = P_USER_NAME;<\/p>\n<p>COMMIT;<br \/>\n&#8212;-<br \/>\nDBMS_OUTPUT.PUT_LINE(&#8216;\u6210\u529f\u521d\u59cb\u5316\u7528\u6237(&#8216;||P_USER_NAME||&#8217;)\u7684\u5bc6\u7801\u4e3a:&#8217;||P_INIT_PASSWORD);<br \/>\nELSE<br \/>\n&#8212;\u663e\u793a\u4e3a\u4ec0\u4e48\u4e0d\u53ef\u4ee5\u4fee\u6539<br \/>\nl_reason := fnd_message.get;<br \/>\nfnd_message.set_name(&#8216;FND&#8217;, &#8216;FND_CHANGE_PASSWORD_FAILED&#8217;);<br \/>\nfnd_message.set_token(&#8216;USER_NAME&#8217;, P_USER_NAME);<br \/>\nfnd_message.set_token(&#8216;REASON&#8217;, l_reason);<br \/>\napp_exception.raise_exception;<br \/>\nEND IF;<br \/>\nEND;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b64\u65b9\u6cd5\u5df2\u7ecf\u901a\u8fc7\u6d4b\u8bd5\uff0c\u4e14\u662f\u501f\u9274\u884c\u5185\u524d\u8f88\u7684\u65b9\u5f0f\uff0c\u8868\u793a\u611f\u8c22\uff0c\u540c\u65f6\u9700\u8981\u6ce8\u610f\uff0c\u6b64\u7a0b\u5e8f\u5728\u516c\u53f8\u6b63\u5f0f\u73af\u5883\u4e2d\u4e25\u7981\u4f7f\u7528\uff0c\u4f1a\u5e26\u6765\u5b89\u5168 &hellip; <a href=\"https:\/\/www.llku.com\/?p=182\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u5982\u4f55\u901a\u8fc7\u7a0b\u5e8f\u65b9\u5f0f\u89e3\u5bc6EBS\u7cfb\u7edf\u7528\u6237\u5bc6\u7801<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[125,45],"_links":{"self":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/182"}],"collection":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":7,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":1774,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/1774"}],"wp:attachment":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}