Friday, November 2, 2018

Concurrent Program Details: Name, Short name, Executable, Execution method, Trace

Concurrent Program Details: Name, Short name, Executable, Execution method, Trace

Script to fetch the following details
1. Concurrent Program Name
2. Concurrent Program Short Name
3. Concurrent Program Application Name
4. Executable Name
5. Executable Short Name
6. Executable Application Name
7. Execution Method
8. Execution file Name
9. Enable Trace flag
SELECT fcpt.user_concurrent_program_name ,
  fcp.concurrent_program_name short_name ,
  fat.application_name program_application_name ,
  fet.executable_name ,
  fat1.application_name executable_application_name ,
  flv.meaning execution_method ,
  fet.execution_file_name ,
  fcp.enable_trace
FROM fnd_concurrent_programs_tl fcpt ,
  fnd_concurrent_programs fcp ,
  fnd_application_tl fat ,
  fnd_executables fet ,
  fnd_application_tl fat1 ,
  FND_LOOKUP_VALUES FLV
WHERE 1                              =1
AND fcpt.user_concurrent_program_name='Supplier Audit Report'
AND fcpt.concurrent_program_id       = fcp.concurrent_program_id
AND fcpt.application_id              = fcp.application_id
AND fcp.application_id               = fat.application_id
AND fcpt.application_id              = fat.application_id
AND fcp.executable_id                = fet.executable_id
AND fcp.executable_application_id    = fet.application_id
AND fet.application_id               = fat1.application_id
AND flv.lookup_code                  = fet.execution_method_code
AND FLV.LOOKUP_TYPE                  ='CP_EXECUTION_METHOD_CODE'
;

Currently running concurrent program details along with user and responsibility

Currently running concurrent program details along with user and responsibility

Get details of concurrent requests which are running currently and also the script will provide details of who is running the request and from which responsibility
SELECT fcp.user_concurrent_program_name,
  fcr.request_id,
  fcr.request_date,
  fu.user_name Requested_By ,
  fr.responsibility_name,
  TO_CHAR(fcr.actual_start_date,'DD-MON-YYYY HH24:MI:SS') actual_start_date
FROM fnd_concurrent_requests fcr ,
  fnd_concurrent_programs_tl fcp ,
  fnd_user fu ,
  fnd_responsibility_tl fr
WHERE 1                       =1
AND fcr.phase_code            ='R'
AND fcr.concurrent_program_id = fcp.concurrent_program_id
AND fcr.requested_by          = fu.user_id
AND FCR.RESPONSIBILITY_ID     = FR.RESPONSIBILITY_ID
;

Concurrent requests / programs executed by a specific user

Concurrent requests / programs executed by a specific user

Get details of concurrent requests / programs that are executed by a specific user from a specific responsibility between certain dates.
SELECT fcp.user_concurrent_program_name,
  fcr.request_id,
  fcr.request_date,
  fu.user_name Requested_By ,
  fr.responsibility_name
FROM fnd_concurrent_requests fcr ,
  fnd_concurrent_programs_tl fcp ,
  fnd_user fu ,
  fnd_responsibility_tl fr
WHERE 1                       =1
AND fcr.concurrent_program_id = fcp.concurrent_program_id
AND fcr.requested_by          = fu.user_id
AND fcr.responsibility_id     = fr.responsibility_id
AND fu.user_name              = :p_UserName
AND fr.responsibility_name    = :p_ResponsibilityName
  --and fcr.request_id=pRequestID
AND fcr.request_date between :p_from_date and :p_to_date ;

Get List of responsibilities assigned to a user

Get List of responsibilities assigned to a user

Get List of responsibilities assigned to a user
select fu.user_name,
  frt.responsibility_name,
  furg.start_date,
  furg.end_date
from fnd_user fu ,
  fnd_user_resp_groups_direct furg ,
  fnd_responsibility_vl frt
where fu.user_id                 = furg.user_id
and frt.responsibility_id        = furg.responsibility_id
and frt.application_id           = furg.responsibility_application_id
and nvl(furg.end_date,sysdate+1) > sysdate
and nvl(frt.end_date,sysdate +1) > sysdate
and fu.user_name                   = :p_user_name
--and fu.user_name                   = :p_userid;
;

List of users having access to specific responsibility

List of users having access to specific responsibility

Get the list of users who have access to a specific given responsibility
SELECT fu.user_name,
  frt.responsibility_name,
  TO_CHAR(furg.start_date,'DD-MON-YYYY') start_date,
  furg.end_date
FROM fnd_user fu ,
  fnd_user_resp_groups_direct furg ,
  fnd_responsibility_vl frt
WHERE fu.user_id                 = furg.user_id
AND frt.responsibility_id        = furg.responsibility_id
AND frt.application_id           = furg.responsibility_application_id
AND NVL(furg.end_date,sysdate+1) > sysdate
AND NVL(frt.end_date,sysdate +1) > sysdate
AND NVL(fu.end_date,sysdate  +1) > sysdate
AND frt.responsibility_name      ='Application Developer'
;

Concurrent Program session details along with SQL Query

Concurrent Program session details along with SQL Query

Concurrent Program session details along with SQL Query
SELECT sqlt.sql_text,
  sess.sid,
  sess.serial#,
  fcr.requested_start_date
FROM fnd_concurrent_requests fcr ,
  V$SQLTEXT sqlt ,
  v$session sess
WHERE fcr.request_id      = :pRequestID
AND fcr.phase_code        = 'R'
AND fcr.status_code       = 'R'
AND fcr.oracle_session_id = sess.audsid (+)
AND sqlt.address          = sess.sql_address
ORDER BY sqlt.piece;

SQL Important Queries

  How to delete rows with no where clause The following example deletes  all rows  from the  Person.Person  the table in the AdventureWork...