Saturday, May 28, 2016

SQL Query to find Concurrent Request Details

--------------------------Query Starts--------------------------
alter session set current_schema=apps;

SELECT
  FCR.REQUEST_ID,
  FR.RESPONSIBILITY_NAME,
  FCP.CONCURRENT_PROGRAM_NAME,
  FCPT.USER_CONCURRENT_PROGRAM_NAME,
  FCR.ARGUMENT_TEXT,
  FCR.REQUEST_DATE,
  FCR.PHASE_CODE,
  FCR.STATUS_CODE,
  FCR.ACTUAL_START_DATE,
  FCR.ACTUAL_COMPLETION_DATE,
 ceil((FCR.ACTUAL_COMPLETION_DATE- FCR.ACTUAL_START_DATE)*24*60) "Time(Min)",
  FCR.COMPLETION_TEXT,
  FU.USER_NAME,
  FCR.LOGFILE_NAME,
  FCR.OUTFILE_NAME,
  FCR.ORACLE_SESSION_ID
FROM
  FND_CONCURRENT_REQUESTS FCR,
  FND_CONCURRENT_PROGRAMS FCP,
  FND_CONCURRENT_PROGRAMS_TL FCPT,
  FND_RESPONSIBILITY_TL FR,
  FND_USER FU
WHERE
  1=1
  --and REQUEST_ID=25045446
AND FCR.CONCURRENT_PROGRAM_ID=FCP.CONCURRENT_PROGRAM_ID
AND FR.RESPONSIBILITY_ID     = FCR.RESPONSIBILITY_ID
AND FCP.CONCURRENT_PROGRAM_ID=FCPT.CONCURRENT_PROGRAM_ID
AND FCR.REQUESTED_BY         = FU.USER_ID
--AND CONCURRENT_PROGRAM_NAME = 'XLGLCURVAL'
--  AND USER_CONCURRENT_PROGRAM_NAME like  '%Invoice%Validation%'
--  and fr.RESPONSIBILITY_KEY='RESP_KEY'
--  and  FU.USER_NAME= 'USERNAME'
--  AND FCR.REQUEST_ID=30235254
  --AND FCR.REQUEST_DATE > SYSDATE-1
--AND FCR.phase_CODE='P'
and fcr.status_code ='R'
--and fcr.argument_text like '%2041,%'
ORDER BY
  request_id DESC;
--------------------------Query Ends--------------------------

SQL Query to Reset Password

SQL Query to Reset Password from Backend

---------------------Query Starts---------------------
declare
v_user_name varchar2(30):=upper(&USERNAME);
v_new_password varchar2(30):='welcome123';
v_status boolean;
begin
v_status:= fnd_user_pkg.ChangePassword (
username => v_user_name,
newpassword => v_new_password
);
if v_status =true then
dbms_output.put_line ('The password reset successfully for the User:'||v_user_name);
commit;
else
DBMS_OUTPUT.put_line ('Unable to reset password due to'||SQLCODE||' '||SUBSTR(SQLERRM, 1, 100));
rollback;
END if;

end;
---------------------Query Ends---------------------

Friday, May 27, 2016

SQL Query to Assign System Administrator Responsibility

SQL Query to Assign System Administrator Responsibility 

--------------------Query Start---------------------------------
BEGIN

   FND_USER_PKG.ADDRESP(
      USERNAME        =>  &USER_NAME,              -- User Name -- <change it>
      RESP_APP        =>  'SYSADMIN',             -- Apps Short Name
      RESP_KEY        =>  'SYSTEM_ADMINISTRATOR', -- Responsibility Key
      SECURITY_GROUP  =>  'STANDARD',
      DESCRIPTION     =>  NULL,
      START_DATE      =>  SYSDATE,
      END_DATE        =>  NULL);

   COMMIT;

   DBMS_OUTPUT.PUT_LINE('SYSADMIN Responsibility successfully added');
 
EXCEPTION
   WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('SYSADMIN responsibility not added due to ' || SQLERRM);
      ROLLBACK;

END;
--------------------Query End---------------------------------

Setup FND Debug Profile Options

Setup FND Debug Profile Options

When you are encountering an issue as a Technical Consultant you may need to find out more details on the cause of the issue. 
Also if you are working with Oracle Support , to get to the root cause of an issue , Oracle would suggest you to provide them with the FND Debug details.

Responsibility: System Administrator

System Profile Option Name
User Value
FND: Debug Log Enabled
Yes
FND: Debug Log Level
Statement
FND: Debug Log Module
%

Enable Form Personalization


Unable to use Form Personalization

You might run into an issue wherein you click on Diagnostics -> Custom Code -> Personalize


And you get an error:
Function not available to this responsibility. Change responsibilities or contact your System Administrator.



Solution
1. Go to System Profile Options
2. Enter the username who wants to Personalize.
3. Put the profile Option: "Utilities: Diagnostics"
4. Value: Yes