Sunday 8 July 2018

Oracle Retrieve Application Password for specific User Query

Solution 1:

SELECT usr.user_name,

       get_pwd.decrypt

          ((SELECT (SELECT get_pwd.decrypt

                              (fnd_web_sec.get_guest_username_pwd,

                               usertable.encrypted_foundation_password

                              )

                      FROM DUAL) AS apps_password

              FROM fnd_user usertable

             WHERE usertable.user_name =

                      (SELECT SUBSTR

                                  (fnd_web_sec.get_guest_username_pwd,

                                   1,

                                     INSTR


(fnd_web_sec.get_guest_username_pwd,

                                           '/'

                                          )

                                   - 1

                                  )

                         FROM DUAL)),

           usr.encrypted_user_password

          ) PASSWORD

  FROM fnd_user usr

WHERE usr.user_name = 'FIN_ADMIN2';





Solution 2:

Package Specification:
CREATE OR REPLACE PACKAGE get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2;

END get_pwd;

Package Body:

CREATE OR REPLACE PACKAGE BODY get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2
   AS
      LANGUAGE JAVA
      NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';

END get_pwd;

Query to execute:


SELECT usr.user_name,
       get_pwd.decrypt
          ((SELECT (SELECT get_pwd.decrypt
                              (fnd_web_sec.get_guest_username_pwd,
                               usertable.encrypted_foundation_password
                              )
                      FROM DUAL) AS apps_password
              FROM fnd_user usertable
             WHERE usertable.user_name =
                      (SELECT SUBSTR
                                  (fnd_web_sec.get_guest_username_pwd,
                                   1,
                                     INSTR
                                          (fnd_web_sec.get_guest_username_pwd,
                                           '/'
                                          )
                                   - 1
                                  )
                         FROM DUAL)),
           usr.encrypted_user_password
          ) PASSWORD
  FROM fnd_user usr
 WHERE usr.user_name = '&USER_NAME';


Oracle Workflow Compilation Steps

-----Workflow Compilation Command----

Step 1: Upload Workflow file respective Top for customized component it will be custome top.
-----------------------
Seeded Workflow Files Location
You can also download seeded workflow definition files directly from below directory-

$<Application_TOP>/patch/115/import/<LANG>

For example- Account Payables workflow file can be found at-
$AP_TOP/patch/115/import/US



Step 2: Set Environment
------------------------
cd /appl/atulorc/apps/apps_st/appl/

ls *.env

 . APPSatuldb_testof.env


Step 3: Based on requirement we have to upgrade/upload and force compilation command used.
-------------------------------------------------------------------------------------------
WFLOAD Command to upload Oracle Workflow
 
To upgrade-- WFLOAD apps/pwd 0 Y UPGRADE file.wft

    To upload-- WFLOAD apps/pwd 0 Y UPLOAD file.wft

    To force-- WFLOAD apps/pwd 0 Y FORCE file.wft

    To download-- WFLOAD apps/pwd 0 Y DOWNLOAD file.wft ITEMTYPE1 [ITEMTYPE2 ...ITEMTYPEN]


For Example-
WFLOAD apps/passed123@DEVL 0 Y UPLOAD APEXP_TEMP.wft









Oracle Form Compilation Steps

Step 1:Goto APPL Directory.

cd /appl/atulorc/apps/apps_st/appl/

Step 2: Set Environment Variable.

ls *.env

 . APPSatuldb_testof.env

Setp 3: Goto AU_TOP

 cd /appl/atulorc/apps/apps_st/appl/au/12.0.0/forms/US

Upload form on following path

/appl/atulorc/apps/apps_st/appl/au/12.0.0/forms/US

upload .fmb here

Step 4: Execute below command

Compilation Command;

frmcmp_batch $AU_TOP/forms/US/XX_VENDOR.fmb Userid=apps/welcome output_file=$XXCUS_TOP/forms/US/XX_VENDOR.fmx