Showing posts with label AOL. Show all posts
Showing posts with label AOL. Show all posts

Friday, 28 August 2020

Oracle EBS - Script to reset password and assign required responsibilities

 This is very helpful when instances are cloned and we need to reset the password of any existing user for testing in a test instance. 


Of course, this can't be done by anybody unless specific rights are not allocated. 


SET serveroutput ON;
DECLARE
  v_user_name    VARCHAR2(30):= UPPER('SYSADMIN');v_new_password VARCHAR2(30):= 'welcome1';v_add_resp  VARCHAR2(5):='Y';
   v_status       BOOLEAN;
procedure Add_responsibility(p_user_name varchar2,p_responsibility_name varchar2) is
   v_user_name             VARCHAR2 (30)  := p_user_name;
   v_responsibility_name   VARCHAR2 (100) := p_responsibility_name;
   v_application_name      VARCHAR2 (100) := NULL;
   v_responsibility_key    VARCHAR2 (100) := NULL;
   v_security_group        VARCHAR2 (100) := NULL;
   v_description           VARCHAR2 (100) := NULL;
BEGIN
   SELECT fa.application_short_name, fr.responsibility_key,
          fsg.security_group_key, frt.description
     INTO v_application_name, v_responsibility_key,
          v_security_group, v_description
     FROM apps.fnd_responsibility fr,
          fnd_application fa,
          fnd_security_groups fsg,
          fnd_responsibility_tl frt
    WHERE frt.responsibility_name = v_responsibility_name
      AND frt.LANGUAGE = USERENV ('LANG')
      AND frt.responsibility_id = fr.responsibility_id
      AND fr.application_id = fa.application_id
      AND fr.data_group_id = fsg.security_group_id
  AND rownum<=1;
   fnd_user_pkg.addresp (username            => v_user_name,
                         resp_app            => v_application_name,
                         resp_key            => v_responsibility_key,
                         security_group      => v_security_group,
                         description         => v_description,
                         start_date          => SYSDATE,
                         end_date            => NULL
                        );
   COMMIT;
   DBMS_OUTPUT.put_line ('Responsiblity '                         || v_responsibility_name|| ' is attached to the user '|| v_user_name || ' Successfully');
EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.put_line('Unable to attach responsibility to user due to'|| SQLCODE|| ' ' || SUBSTR (SQLERRM, 1, 250));
END; 
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;
  --- 
  IF v_add_resp = 'Y' THEN
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Functional Administrator');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'XML Publisher Administrator');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Application Developer');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Workflow Administrator');   
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'System Administrator');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Alert Manager');
     Add_responsibility(p_user_name => v_user_name,p_responsibility_name => 'Desktop Integration Manager');
  END If;
END;

Tuesday, 25 August 2020

FNDLOAD for AME Setup migration

 select * from AME_CALLING_APPS where transaction_type_id like 'APINV' and sysdate between start_date and end_date;


--Download


FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesconk.lct APINVamecondition.ldt AME_CONDITIONS TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesappg.lct APINVameapprovalgroup.ldt AME_APPROVAL_GROUPS TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesaagc.lct APINVameapprovalgroupusage.ldt AME_APPROVAL_GROUP_CONFIG TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesrulk.lct APINVamerule.ldt AME_RULES TRANSACTION_TYPE_ID='APINV'  APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesactu.lct APINVameactionusage.ldt AME_ACTION_USAGES TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amescvar.lct APINVhubtrantype.ldt AME_CALLING_APPS TRANSACTION_TYPE_ID='APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatt.lct APINVhubattributes.ldt AME_ATTRIBUTES TRANSACTION_TYPE_ID= 'APINV' APPLICATION_SHORT_NAME='SQLAP'

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatr.lct APINVhubattributeusage.ldt AME_ATTRIBUTE_USAGES APPLICATION_SHORT_NAME='SQLAP'TRANSACTION_TYPE_ID= 'APINV'



--UPLOAD

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesconk.lct APINVamecondition.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesappg.lct APINVameapprovalgroup.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesaagc.lct APINVameapprovalgroupusage.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesrulk.lct APINVamerule.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesactu.lct APINVameactionusage.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amescvar.lct APINVhubtrantype.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatt.lct APINVhubattributes.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/password 0 Y DOWNLOAD $AME_TOP/patch/115/import/amesmatr.lct APINVhubattributeusage.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


FNDLOAD for Quality Plan Setup Migration

 --Get PLAN_ID using the following query  

SELECT * FROM QA_PLANS WHERE NAME='MRP APPROVAL QT PLAN';


--PLAN_ID=10078

--User following command to download the quality plan setup

--Download

FNDLOAD apps/password 0 Y DOWNLOAD $QA_TOP/patch/115/import/qltplans.lct MRP_APPROVAL_QT_PLAN.ldt QA_PLANS PLAN_ID="10078"

--Upload

FNDLOAD apps/password 0 Y UPLOAD $QA_TOP/patch/115/import/qltplans.lct MRP_APPROVAL_QT_PLAN.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


Wednesday, 8 April 2020

Query to get concurrent Program Assignment with Concurrent Manager

Query to get concurrent Program Assignment with Concurrent Manager

As we all know, by default all programs assigned to the "Standard Manager" concurrent manager. We create specific queues for heavy or critical programs to avoid the normal queues and work in dedicated queues. 

It's like VIP queue created for special programs :)

Following is the query, which we can use to get the program exclusion from the specific queue and assign it to the VIP queue.


select fcqc.queue_application_id,fcqc.concurrent_queue_id
      ,fcqv.user_concurrent_queue_name,fcqv.enabled_flag
      ,fcqc.include_flag,fcqc.type_application_id
      ,fcqc.type_id,fcpt.user_concurrent_program_name 
  from FND_CONCURRENT_QUEUE_CONTENT fcqc
     , fnd_concurrent_programs_tl fcpt
     , FND_CONCURRENT_QUEUES_VL fcqv
 where fcqc.type_code = 'P'
   and fcqc.type_application_id = fcpt.application_id
   and fcqc.type_id = fcpt.concurrent_program_id
   and fcpt.user_concurrent_program_name = 'Check Periodic Alert'
   and fcqc.queue_application_id = fcqv.application_id
   and fcqc.concurrent_queue_id = fcqv.concurrent_queue_id
   and fcpt.language = 'US';

Thursday, 20 June 2019

1) How to extract 1-10 counting using Oracle SQL - 2) How to select data for more than 1000 using in clause

with dummy(id) as ( select 50 from dual union all select id + 1 from dummy where id < 60)  
select id from dummy
/

SELECT
   * 
FROM
   fnd_user 
WHERE
   (user_id,0) IN ((83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0)


DB2

with dummy(id) as ( select 55 from SYSIBM.SYSDUMMY1 union all select id + 1 from dummy where id < 60)  
select id from dummy

Tuesday, 18 September 2018

Query - Concurrent Program Summary - Completed-Error-Warning-running-Terminated

SELECT fcpt.USER_CONCURRENT_PROGRAM_NAME PROGRAM_NAME ,trunc(fcr.ACTUAL_START_DATE) ACTUAL_START_DATE,fcr.phase_code
     ,sum(decode(fcr.status_code,'C',1,0))completed_program_cnt
     ,sum(decode(fcr.status_code,'E',1,0))error_program_cnt
     ,sum(decode(fcr.status_code,'W',1,0))warning_program_cnt
     ,sum(decode(fcr.status_code,'R',1,0))running_program_cnt
     ,sum(decode(fcr.status_code,'D',1,0))Terminated_program_cnt
     ,count(1) Total_program_count
FROM FND_CONCURRENT_REQUESTS fcr, FND_CONCURRENT_PROGRAMS_TL fcpt
WHERE fcr.CONCURRENT_PROGRAM_ID = fcpt.CONCURRENT_PROGRAM_ID
AND fcpt.USER_CONCURRENT_PROGRAM_NAME LIKE 'Accounting Program'
Group by trunc(fcr.ACTUAL_START_DATE),fcpt.USER_CONCURRENT_PROGRAM_NAME,fcr.phase_code
order by 1,2,3 ;

Tuesday, 11 September 2018

Query to get Oracle Scheduled Concurrent Program Information

select * from
(
SELECT DISTINCT
fcr.concurrent_program_id
,fcpl.user_concurrent_program_name Concurrent_Program
,frl.responsibility_name
,DECODE(fcrc.class_type,'P','Periodic : '
       ||SUBSTR(fcrc.class_info,1,INSTR(fcrc.class_info,':',1,1)-1)
||' : '||DECODE(SUBSTR(fcrc.class_info,-3,1)
        ,'M','Month(s)','W','Week(s)','D','Day(s)'
        ,'H','Hour(s)','N','Minute(s)','')
||' : '||DECODE(SUBSTR(fcrc.class_info,-1),'C'
        ,'From Completion of Prior Run','S'
        ,'From Start of Prior Run',''),'')
||DECODE(fcrc.class_type,'S','Specific : '
||DECODE(SUBSTR(fcrc.class_info,1,1),'0','',':1:')
||DECODE(SUBSTR(fcrc.class_info,2,1),'0','',':2:')
||DECODE(SUBSTR(fcrc.class_info,3,1),'0','',':3:')
||DECODE(SUBSTR(fcrc.class_info,4,1),'0','',':4:')
||DECODE(SUBSTR(fcrc.class_info,5,1),'0','',':5:')
||DECODE(SUBSTR(fcrc.class_info,6,1),'0','',':6:')
||DECODE(SUBSTR(fcrc.class_info,7,1),'0','',':7:')
||DECODE(SUBSTR(fcrc.class_info,8,1),'0','',':8:')
||DECODE(SUBSTR(fcrc.class_info,9,1),'0','',':9:')
||DECODE(SUBSTR(fcrc.class_info,10,1),'0','',':10:')
||DECODE(SUBSTR(fcrc.class_info,11,1),'0','',':11:')
||DECODE(SUBSTR(fcrc.class_info,12,1),'0','',':12:')
||DECODE(SUBSTR(fcrc.class_info,13,1),'0','',':13:')
||DECODE(SUBSTR(fcrc.class_info,14,1),'0','',':14:')
||DECODE(SUBSTR(fcrc.class_info,15,1),'0','',':15:')
||DECODE(SUBSTR(fcrc.class_info,16,1),'0','',':16:')
||DECODE(SUBSTR(fcrc.class_info,17,1),'0','',':17:')
||DECODE(SUBSTR(fcrc.class_info,18,1),'0','',':18:')
||DECODE(SUBSTR(fcrc.class_info,19,1),'0','',':19:')
||DECODE(SUBSTR(fcrc.class_info,20,1),'0','',':20:')
||DECODE(SUBSTR(fcrc.class_info,21,1),'0','',':21:')
||DECODE(SUBSTR(fcrc.class_info,22,1),'0','',':22:')
||DECODE(SUBSTR(fcrc.class_info,23,1),'0','',':23:')
||DECODE(SUBSTR(fcrc.class_info,24,1),'0','',':24:')
||DECODE(SUBSTR(fcrc.class_info,25,1),'0','',':25:')
||DECODE(SUBSTR(fcrc.class_info,26,1),'0','',':26:')
||DECODE(SUBSTR(fcrc.class_info,27,1),'0','',':27:')
||DECODE(SUBSTR(fcrc.class_info,28,1),'0','',':28:')
||DECODE(SUBSTR(fcrc.class_info,29,1),'0','',':29:')
||DECODE(SUBSTR(fcrc.class_info,30,1),'0','',':30:')
||DECODE(SUBSTR(fcrc.class_info,31,1),'0','',':31:')
||DECODE(SUBSTR(fcrc.class_info,32,1),'0','',':Last Day:')
||DECODE(SUBSTR(fcrc.class_info,33,1),'0','',':Sunday:')
||DECODE(SUBSTR(fcrc.class_info,34,1),'0','',':Monday:')
||DECODE(SUBSTR(fcrc.class_info,35,1),'0','',':Tuesday:')
||DECODE(SUBSTR(fcrc.class_info,36,1),'0','',':Wednesday:')
||DECODE(SUBSTR(fcrc.class_info,37,1),'0','',':Thursday:')
||DECODE(SUBSTR(fcrc.class_info,38,1),'0','',':Friday:')
||DECODE(SUBSTR(fcrc.class_info,39,1),'0','',':Saturday:')
, '') scheduling_information
FROM apps.fnd_executables fe
, apps.fnd_concurrent_programs fcp
, apps.fnd_concurrent_programs_tl fcpl
, apps.fnd_concurrent_requests fcr
, apps.fnd_lookups fl
, apps.fnd_responsibility_tl frl
, apps.fnd_user fu
, apps.fnd_conc_req_summary_v fcrs
, apps.fnd_conc_release_classes fcrc
WHERE     fe.executable_id = fcp.executable_id
AND fcr.responsibility_application_id = frl.application_id
AND fcp.concurrent_program_id = fcr.concurrent_program_id
AND fcpl.concurrent_program_id = fcp.concurrent_program_id
AND frl.responsibility_id = fcr.responsibility_id
AND fu.user_id = fcr.requested_by
AND fcrc.release_class_id(+) = fcr.release_class_id
AND fl.lookup_code = fe.execution_method_code
AND fcrs.concurrent_program_id = fcr.concurrent_program_id
AND fcrs.request_id = fcr.request_id
AND fl.lookup_type = 'CP_EXECUTION_METHOD_CODE'
AND frl.language = 'US'
AND fcpl.language = 'US'
AND fcr.phase_code IN ('P','R')
AND nvl(fcr.hold_flag,'N') <> 'Y')
Where scheduling_information is not null;

Query/Script to check Oracle Concurrent Program Status

set serveroutput on
declare
l_ret_status boolean;
l_request_id number:=12345678;
l_phase varchar2(200);
l_status varchar2(200);
l_dev_phase varchar2(200);
l_dev_status varchar2(200);
l_message varchar2(200);
l_app  varchar2(30) :='FND';
l_conc_prog varchar2(30):='FNDOAMCOL';
begin
l_ret_status := FND_CONCURRENT.GET_REQUEST_STATUS
(request_id     =>l_request_id,
                    appl_shortname => l_app,
                    program        => l_conc_prog,
                    phase          => l_phase,
                    status         => l_status,
                    dev_phase      => l_dev_phase,
                    dev_status     => l_dev_status,
                    message        => l_message);
dbms_output.put_line('Program : '||l_app||':'||l_conc_prog);
dbms_output.put_line('l_request_id : '||l_request_id);
dbms_output.put_line('l_phase : '||l_phase);
dbms_output.put_line('l_dev_phase : '||l_dev_phase);
dbms_output.put_line('l_dev_status : '||l_dev_status);
dbms_output.put_line('l_message : '||l_message);
end;

Tuesday, 27 March 2018

unable to locate jvm.dll while opening jdeveloper

When you run the Jdevloper for first time you may see the below error

ERROR:
Unable to launch the Java Virtual Machine "Located at path:..\..\jdk\jre\bin\client\jvm.dll"

Try the following:
1. go to Control Panel->System->Advanced System Settings->Environmental Variables
2. Update the 'Path' setting to include the following directory: '<jdev home>\jdevbin\jdk\bin'
3. Reopen the jDeveloper.

Thursday, 2 May 2013

Procedure : Waiting for child concurrent program to complete



PROCEDURE wait_for_program_completion (p_req_id IN OUT NUMBER) IS
  l_success             BOOLEAN;
  l_phase               VARCHAR2 (80); -- phase displyed on screen
  l_status              VARCHAR2 (80); -- status displayed on screen
  l_dev_phase           VARCHAR2 (80); -- phase available for developer
  l_dev_status          VARCHAR2 (80); -- status available for developer
  l_err_msg             VARCHAR2 (255);
  l_req_submitted       BOOLEAN;
BEGIN
  IF p_req_id <> 0 THEN
    l_req_submitted    :=
      fnd_concurrent.get_request_status 
             (p_req_id -- Request ID
            , NULL
            , NULL
            , l_phase--Phase displyed on screen
            , l_status--Status displayed on screen
            , l_dev_phase--Phase for developer
            , l_dev_status--Status for developer
            , l_err_msg
             ); -- Execution Message

    -- note check Request Status --
    WHILE (l_dev_phase != 'COMPLETE') LOOP
      l_success          :=
        fnd_concurrent.wait_for_request 
          (p_req_id -- Request ID
         , 20 --0.5 Mins   -- Time Interval
         , 1800 --30 Mins   -- Total Time to wait
         , l_phase -- Phase displyed on screen
         , l_status -- Status displayed on screen
         , l_dev_phase -- Phase for developer
         , l_dev_status -- Status for developer
         , l_err_msg
          ); -- Execution Message
      EXIT WHEN (l_dev_status = 'COMPLETE' OR l_success = FALSE);
    END LOOP;
  END IF;
EXCEPTION
  WHEN OTHERS THEN
    NULL;
END wait_for_program_completion;

Thursday, 14 March 2013

Query : Concurrent Program Request Status - For Specific Time Duration


  SELECT main_prog.description Module
       , fcr.hold_flag hold
       , fcr.phase_code phase
       , fcr.status_code status
       , fcr.request_id
       , fcr.parent_request_id parent_req_id
       , TRUNC( ( NVL( fcr.actual_completion_date, SYSDATE ) - fcr.actual_start_date ) * 24 * 60, 2 ) time_in_mins
       , fu.user_name
       , fcpl.user_concurrent_program_name conc_program_name
       , frl.responsibility_name
       , fcr.requested_start_date req_start_date
       , TO_CHAR( fcr.actual_start_date, 'DD-MON-YYYY HH:MI AM' ) start_date
       , TO_CHAR( fcr.actual_completion_date, 'DD-MON-YYYY HH:MI AM' ) completion_date
       , TRUNC( fcr.actual_start_date - fcr.requested_start_date, 2 ) kick_off_time
       , fcrs.completion_text
       , fcr.argument_text
       , fcr.printer
       , fcp.concurrent_program_id||'-'||fcp.concurrent_program_name conc_prog_id_code
       , fcp.executable_id ||'-' ||fe.execution_method_code||'-'||fe.executable_name ID_CODE_NAME
       , fe.execution_file_name
       , fl.meaning execution_type
       , fe.execution_file_path
       , fcr.has_sub_request
       , fcr.resubmitted
       , fcr.resubmit_interval
       , fu.description user_full_name      
       , fcr.outfile_name
       , fcr.logfile_name
    FROM apps.fnd_executables fe
       , apps.fnd_concurrent_programs fcp
       , apps.fnd_concurrent_programs_tl fcpl
       , apps.fnd_concurrent_requests fcr
       , apps.fnd_lookups fl
       , apps.fnd_responsibility_tl frl
       , apps.fnd_user fu
       , apps.fnd_conc_req_summary_v fcrs
       , apps.fnd_lookups main_prog
   WHERE     fe.executable_id = fcp.executable_id
         AND fcp.execution_method_code = fe.execution_method_code
         AND fcr.responsibility_application_id = frl.application_id
         AND fcp.concurrent_program_id = fcr.concurrent_program_id
         AND fcpl.concurrent_program_id = fcp.concurrent_program_id                                                          
         AND frl.responsibility_id = fcr.responsibility_id
         AND fu.user_id = fcr.requested_by
         AND fl.lookup_code = fe.execution_method_code
         AND fcrs.concurrent_program_id = fcr.concurrent_program_id
         AND fcrs.request_id = fcr.request_id
         AND fl.lookup_type = 'CP_EXECUTION_METHOD_CODE'
         AND frl.language = 'US'
         AND fcpl.language = 'US'
         AND fcp.concurrent_program_name = main_prog.meaning(+)        
         AND main_prog.lookup_type(+) like 'REPORTERR'                
         --and fu.user_name = 'USER-IF-REQUIRED'        
         --and fcr.argument_text like '%Argument Content%'
         --AND fcpl.user_concurrent_program_name like '%Any Program Name if Any%'
and fcr.actual_start_date <= to_date('08-Mar-2013 09:40:00','DD-MON-YYYY HH24:MI:SS')--To Time
and nvl(fcr.actual_completion_date,sysdate) >= to_date('08-Mar-2013 09:30:00','DD-MON-YYYY HH24:MI:SS') --From Time
ORDER BY fcr.actual_start_date desc,request_id desc

Thursday, 8 November 2012

Query : Profile Options Value at all Levels

SELECT pot.user_profile_option_name "Profile",pot.profile_option_name,
       DECODE (a.profile_option_value, '1', '1 (may be "Yes")',
                                       '2', '2 (may be "No")', a.profile_option_value) "Value",
       DECODE (a.level_id, 10001, 'Site',
                           10002, 'Appl',
                           10003, 'Resp',
                           10004, 'User',
                           10006, 'Org', '????') "Level",
       DECODE (a.level_id, 10002, e.application_name,
                           10003, c.responsibility_name,
                           10004, d.user_name,
                           10006, a.level_value, '-') "Location",a.*
FROM applsys.fnd_application_tl e,
     applsys.fnd_user d,
     applsys.fnd_responsibility_tl c,
     applsys.fnd_profile_option_values a,
     applsys.fnd_profile_options b,
     applsys.fnd_profile_options_tl pot
WHERE    b.profile_option_name like 'XX%D%B%LINK%'
      AND pot.profile_option_name = b.profile_option_name
      AND b.application_id = a.application_id(+)
      AND b.profile_option_id = a.profile_option_id(+)
      AND a.level_value = c.responsibility_id(+)
      AND a.level_value = d.user_id(+)
      AND a.level_value = e.application_id(+)
      AND c.language (+)= 'US'
      AND e.language (+)= 'US'
      AND pot.language (+)= 'US'           
ORDER BY "Profile", "Level", "Location", "Value",5

Query : Value Set Values with Qualifier Details (GL Account)

SELECT fv.flex_value_set_id
     , fv.flex_value_id
     , fv.flex_value
     , fv.compiled_value_attributes
     , SUBSTR( fv.compiled_value_attributes, 1, 1 ) allow_budgeting
     , SUBSTR( fv.compiled_value_attributes, 3, 1 ) allow_posting
     , SUBSTR( fv.compiled_value_attributes, 5, 1 ) account_type
     , SUBSTR( fv.compiled_value_attributes, 7, 1 ) third_party_ac_type
     , SUBSTR( fv.compiled_value_attributes, 9, 1 ) reconcile
  FROM fnd_flex_value_sets fvs, fnd_flex_values fv, fnd_flex_validation_qualifiers ffvq
 WHERE     fv.flex_value_set_id = fvs.flex_value_set_id
       AND ffvq.flex_value_set_id = fv.flex_value_set_id
       AND flex_value_set_name = 'XXGL_GBL_ACCOUNT'
       AND flex_value = '030099'
       AND fv.enabled_flag = 'Y';

Query : To extract Concurrent Program Execution Information

  SELECT fcr.request_id
       , fcr.parent_request_id parent_req_id
       , fcr.hold_flag
       , fcr.phase_code phase
       , fcr.status_code status
       , TRUNC( ( NVL( fcr.actual_completion_date, SYSDATE ) - fcr.actual_start_date ) * 24 * 60, 2 ) time_in_mins
       , TRUNC( fcr.actual_start_date - fcr.requested_start_date, 2 ) kick_off_time
       , fcr.requested_start_date req_start_date
       , TO_CHAR( fcr.actual_start_date, 'DD-MON-YYYY HH:MI AM' ) start_date
       , TO_CHAR( fcr.actual_completion_date, 'DD-MON-YYYY HH:MI AM' ) completion_date
       , fcrs.completion_text
       , fu.user_name
       , fcpl.user_concurrent_program_name conc_program_name
       , frl.responsibility_name
       , fcp.concurrent_program_name conc_short_name
       , fcp.executable_id
       , fe.execution_method_code
       , fe.execution_file_path
       , fe.executable_name
       , fe.execution_file_name
       , fl.meaning execution_type
       , fcr.argument_text
       , fcr.printer
       , fcp.concurrent_program_id
       , fcr.outfile_name
       , fcr.logfile_name
       , fcr.has_sub_request
       , fcr.resubmitted
       , fcr.resubmit_interval
       , fu.description
    FROM apps.fnd_executables fe
       , apps.fnd_concurrent_programs fcp
       , apps.fnd_concurrent_programs_tl fcpl
       , apps.fnd_concurrent_requests fcr
       , apps.fnd_lookups fl
       , apps.fnd_responsibility_tl frl
       , apps.fnd_user fu
       , apps.fnd_conc_req_summary_v fcrs
   WHERE     fe.executable_id = fcp.executable_id
         AND fcp.execution_method_code = fe.execution_method_code
         AND fcr.responsibility_application_id = frl.application_id
         AND fcp.concurrent_program_id = fcr.concurrent_program_id
         AND fcpl.concurrent_program_id = fcp.concurrent_program_id                                                             ----
         AND frl.responsibility_id = fcr.responsibility_id
         AND fu.user_id = fcr.requested_by
         AND fl.lookup_code = fe.execution_method_code
         AND fcrs.concurrent_program_id = fcr.concurrent_program_id
         AND fcrs.request_id = fcr.request_id
         AND fl.lookup_type = 'CP_EXECUTION_METHOD_CODE'
         AND fcpl.user_concurrent_program_name IN ('AR Reconciliation Report')
         AND frl.language = 'US'
         AND fcpl.language = 'US'
ORDER BY fcr.requested_start_date DESC, fcr.request_id DESC