DBA Data[Home] [Help]

APPS.FND_OAM_CPCHARTS_COL SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 100

          select fnd_global.user_id into v_userid from dual;
Line: 131

  PROCEDURE insert_metric_internal (
      p_metric_name in varchar2,
      p_context in varchar2,
      p_value in number)
  IS
        v_userid number;
Line: 141

      insert into fnd_oam_chart_metrics (metric_short_name, metric_context,
          value, last_updated_by, last_update_date,
          last_update_login, created_by, creation_date)
      values (p_metric_name, p_context, p_value,
              v_userid, sysdate, v_userid, 0, sysdate);
Line: 147

  END insert_metric_internal;
Line: 169

  PROCEDURE update_metric_internal (
      p_metric_name in varchar2,
      p_context in varchar2,
      p_value in number)
  IS
        v_userid number;
Line: 179

      select metric_short_name into name
        from fnd_oam_chart_metrics
        where metric_short_name = p_metric_name
          and metric_context = p_context;
Line: 185

        update fnd_oam_chart_metrics
        set value = p_value,
          last_updated_by = v_userid,
          last_update_date = sysdate,
          last_update_login = v_userid
        where
          metric_short_name = p_metric_name
          and metric_context = p_context;
Line: 198

        insert into fnd_oam_chart_metrics (metric_short_name, metric_context,
          value, last_updated_by, last_update_date,
          last_update_login, created_by, creation_date)
        values (p_metric_name, p_context, p_value,
              v_userid, sysdate, v_userid, 0, sysdate);
Line: 204

  END update_metric_internal;
Line: 223

  PROCEDURE delete_metric_internal (
      p_metric_name in varchar2)
  IS
  BEGIN

--  delete the entry
       delete from fnd_oam_chart_metrics
        where metric_short_name = p_metric_name;
Line: 232

  END delete_metric_internal;
Line: 247

    update_req_status_metric('REQ_RUNNING');
Line: 248

    update_req_status_metric('REQ_PENDING');
Line: 249

    update_req_status_metric('REQ_COMPLETED');
Line: 250

    update_req_status_metric('REQ_WAITING_ON_LOCK');
Line: 251

    update_req_status_metric('REQ_INACTIVE');
Line: 261

  PROCEDURE update_req_status_metric(p_metric_name in varchar2)
  IS
    ct_running number;
Line: 271

        select count(*) into ct_running
          from  fnd_concurrent_requests
          where status_code = 'R';
Line: 276

        update_metric_internal(p_metric_name, '0', ct_running);
Line: 280

        select count(rv.Request_ID) into ct_pending
         from Fnd_amp_requests_v rv,
            Fnd_lookups l
         Where  rv.phase_code = 'P'
         and l.meaning = rv.phase
         and l.lookup_code = 'P'
         and l.lookup_type = 'CP_PHASE_CODE';
Line: 289

        select count(distinct(R.Request_ID)) into ct_pending
         from Fnd_Concurrent_Programs_vl CP,
            Fnd_User U,
            Fnd_Concurrent_Requests R,
            Fnd_Responsibility_Tl RES,
            Fnd_Application A,
            Fnd_amp_requests_v rv,
            Fnd_lookups l
         Where  rv.phase_code = 'P'
         and l.meaning = rv.phase
         and l.lookup_code = 'P'
         and l.lookup_type = 'CP_PHASE_CODE'
         And CP.Application_ID = rv.Program_Application_ID
         And CP.Concurrent_Program_ID = rv.Concurrent_Program_ID
         and R.request_id = rv.request_id
         and rv.Program_Application_ID = R.Program_Application_ID
         And rv.Concurrent_Program_ID = R.Concurrent_Program_ID
         And A.Application_ID = rv.Program_Application_ID
         And U.User_ID = R.Requested_By
         And RES.application_id = R.responsibility_application_id
         AND RES.language(+)=USERENV('LANG')
         And RES.responsibility_id = R.responsibility_id;
Line: 313

        update_metric_internal(p_metric_name, '0', ct_pending);
Line: 317

        select count(*) into ct_completed
          from  fnd_concurrent_requests
        where phase_code = 'C' and (sysdate - actual_completion_date)*1440 <= 60;
Line: 322

        update_metric_internal(p_metric_name, '0', ct_completed);
Line: 326

        select count(*) into ct_waiting_on_lock
          from  fnd_concurrent_requests r, GV$SESSION WS
        where r.phase_code = 'R'
          and r.oracle_session_id = WS.AUDSID
          and WS.LOCKWAIT IS NOT NULL;
Line: 333

        update_metric_internal(p_metric_name, '0', ct_waiting_on_lock);
Line: 337

        select count(rv.Request_ID) into ct_inactive
         From Fnd_amp_requests_v rv,
          Fnd_lookups l
        Where  rv.phase_code = 'P'
        and l.meaning = rv.phase
        and l.lookup_code = 'I'
        and l.lookup_type = 'CP_PHASE_CODE';
Line: 346

         select count(distinct(R.Request_ID)) into ct_inactive
         From Fnd_Concurrent_Programs_vl CP,
          Fnd_User U,
          Fnd_Concurrent_Requests R,
          Fnd_Responsibility_Tl RES,
          Fnd_Application A,
          Fnd_amp_requests_v rv,
          Fnd_lookups l
        Where  rv.phase_code = 'P'
        and l.meaning = rv.phase
        and l.lookup_code = 'I'
        and l.lookup_type = 'CP_PHASE_CODE'
        And CP.Application_ID = rv.Program_Application_ID
        And CP.Concurrent_Program_ID = rv.Concurrent_Program_ID
        and R.request_id = rv.request_id
        and rv.Program_Application_ID = R.Program_Application_ID
        And rv.Concurrent_Program_ID = R.Concurrent_Program_ID
        And A.Application_ID = rv.Program_Application_ID
        And U.User_ID = R.Requested_By
        And RES.application_id = R.responsibility_application_id
        AND RES.language(+)=USERENV('LANG')
        And RES.responsibility_id = R.responsibility_id;
Line: 370

        update_metric_internal(p_metric_name, '0', ct_inactive);
Line: 378

  END update_req_status_metric;
Line: 397

    SELECT count(*) count, status_code
      FROM fnd_concurrent_requests
      WHERE status_code IN ('C', 'G', 'E', 'X' )
        AND ((sysdate - actual_completion_date) * (1440)) <= 60
      GROUP BY status_code;
Line: 430

          update_metric_internal('COMPLETED_REQ_ERROR', '0', ct_error);
Line: 433

          update_metric_internal('COMPLETED_REQ_SUCCESSFUL', '0', ct_succ);
Line: 436

          update_metric_internal('COMPLETED_REQ_TERMINATED', '0', ct_term);
Line: 439

          update_metric_internal('COMPLETED_REQ_WARNING', '0', ct_warn);
Line: 464

        SELECT count(*) count, status_code
          FROM fnd_concurrent_requests
                     WHERE (status_code IN ('I', 'Q')
                     AND requested_start_date <= sysdate
                     AND phase_code = 'P'
                     AND hold_flag = 'N')
                     GROUP BY status_code;
Line: 489

      SELECT count(*) into ct_scheduled
        FROM fnd_concurrent_requests
            WHERE (phase_code = 'P' AND hold_flag = 'N')
              AND ( (status_code = 'P' )
                    OR (status_code IN( 'I', 'Q')
                        AND requested_start_date > sysdate ));
Line: 497

          update_metric_internal('PENDING_REQ_NORMAL', '0', ct_normal);
Line: 500

          update_metric_internal('PENDING_REQ_STANDBY', '0', ct_standby);
Line: 503

          update_metric_internal('PENDING_REQ_SCHEDULED', '0', ct_scheduled);
Line: 532

      select count(*) into ct_10min
        from fnd_concurrent_requests
              where ((sysdate - actual_start_date) * (1440)) <= 10
                  and status_code in ('R');
Line: 537

      select count(*) into ct_60min
          from fnd_concurrent_requests
              where ((sysdate - actual_start_date) * (1440)) between 10 and 60
                and status_code in ('R');
Line: 542

      select count(*) into ct_long
          from fnd_concurrent_requests
              where ((sysdate - actual_start_date) * (1440)) >= 60
                 and status_code in ('R');
Line: 548

          update_metric_internal('RUNNING_REQ_10MIN', '0', ct_10min);
Line: 551

          update_metric_internal('RUNNING_REQ_60MIN', '0', ct_60min);
Line: 554

          update_metric_internal('RUNNING_REQ_LONG', '0', ct_long);
Line: 576

    select count(*) count, user_name
              from fnd_concurrent_requests, fnd_user
              where requested_by = user_id and status_code = 'R'
              group by user_name;
Line: 584

      delete_metric_internal('RUNNING_REQ_USER');
Line: 587

          insert_metric_internal('RUNNING_REQ_USER', req.user_name, req.count);
Line: 610

    select count(rv.Request_ID) count, user_name
         from Fnd_amp_requests_v rv,
            Fnd_lookups l
         Where  rv.phase_code = 'P'
         and l.meaning = rv.phase
         and l.lookup_code = 'P'
         and l.lookup_type = 'CP_PHASE_CODE'
         group by user_name;
Line: 621

      delete_metric_internal('PENDING_REQ_USER');
Line: 624

          insert_metric_internal('PENDING_REQ_USER', req.user_name, req.count);
Line: 646

    select count(*) count, application_name
         from fnd_concurrent_requests r, fnd_application_vl v
         where  r.program_application_id = v.application_id and status_code = 'R'
              group by application_name;
Line: 654

      delete_metric_internal('RUNNING_REQ_APPLICATION');
Line: 657

          insert_metric_internal('RUNNING_REQ_APPLICATION', req.application_name, req.count);
Line: 678

    select count(rv.Request_ID) count, application_name
         from Fnd_amp_requests_v rv,
            Fnd_lookups l
         Where  rv.phase_code = 'P'
         and l.meaning = rv.phase
         and l.lookup_code = 'P'
         and l.lookup_type = 'CP_PHASE_CODE'
         group by application_name;
Line: 690

      delete_metric_internal('PENDING_REQ_APPLICATION');
Line: 693

          insert_metric_internal('PENDING_REQ_APPLICATION', req.application_name, req.count);
Line: 715

    select count(*) count, responsibility_name
             from fnd_concurrent_requests r, fnd_responsibility_vl v
                where r.responsibility_application_id = v.application_id
                 and r.responsibility_id = v.responsibility_id and  status_code = 'R'
                 group by responsibility_name;
Line: 724

      delete_metric_internal('RUNNING_REQ_RESP');
Line: 727

          insert_metric_internal('RUNNING_REQ_RESP', req.responsibility_name, req.count);
Line: 748

    select count(rv.Request_ID) count, responsibility_name
         from Fnd_amp_requests_v rv,
            Fnd_lookups l
         Where  rv.phase_code = 'P'
         and l.meaning = rv.phase
         and l.lookup_code = 'P'
         and l.lookup_type = 'CP_PHASE_CODE'
         group by responsibility_name;
Line: 760

      delete_metric_internal('PENDING_REQ_RESP');
Line: 763

          insert_metric_internal('PENDING_REQ_RESP', req.responsibility_name, req.count);
Line: 779

  PROCEDURE update_run_req_mgr_metric(p_queue_application_id in number,
                                          p_concurrent_queue_name in varchar2,
                                          p_user_concurrent_queue_name in varchar2)
  IS
    ct_running number := 0;
Line: 785

          select count(*) into ct_running
              from fnd_concurrent_worker_requests r
              where queue_application_id =  p_queue_application_id
                   and concurrent_queue_name = p_concurrent_queue_name
                   and status_code = 'R';
Line: 791

        update_metric_internal('RUNNING_REQ_MANAGER', p_user_concurrent_queue_name, ct_running);
Line: 798

  END update_run_req_mgr_metric;
Line: 805

  PROCEDURE update_pend_req_mgr_metric(p_queue_application_id in number,
                                          p_concurrent_queue_name in varchar2,
                                          p_user_concurrent_queue_name in varchar2)
  IS
    ct_pending number := 0;
Line: 812

        select count(*) into ct_pending
                  from fnd_concurrent_worker_requests r
                   where queue_application_id = p_queue_application_id
                   and concurrent_queue_name = p_concurrent_queue_name
                   and status_code = 'I' and hold_flag <> 'Y'
                   and requested_start_date <= sysdate;
Line: 819

        update_metric_internal('PENDING_REQ_MANAGER', p_user_concurrent_queue_name, ct_pending);
Line: 826

  END update_pend_req_mgr_metric;
Line: 834

  PROCEDURE update_process_mgr_metric(p_queue_application_id in number,
                                          p_concurrent_queue_name in varchar2,
                                          p_user_concurrent_queue_name in varchar2)
  IS
    ct_process number :=0;
Line: 840

          select running_processes into ct_process
              from fnd_concurrent_queues_vl
              where application_id =  p_queue_application_id
                   and concurrent_queue_name = p_concurrent_queue_name;
Line: 845

          update_metric_internal('RUNNING_PROCESS_MANAGER', p_user_concurrent_queue_name, ct_process);
Line: 851

    update_metric_internal('RUNNING_PROCESS_MANAGER', p_user_concurrent_queue_name, 0);
Line: 858

  END update_process_mgr_metric;
Line: 870

        select application_id, concurrent_queue_name, user_concurrent_queue_name
              from fnd_concurrent_queues_vl
              where manager_type = 1;
Line: 876

      delete_metric_internal('RUNNING_REQ_MANAGER');
Line: 877

      delete_metric_internal('RUNNING_PROCESS_MANAGER');
Line: 880

          update_run_req_mgr_metric(mgr.application_id, mgr.concurrent_queue_name, mgr.user_concurrent_queue_name);
Line: 882

          update_process_mgr_metric(mgr.application_id, mgr.concurrent_queue_name, mgr.user_concurrent_queue_name);
Line: 902

        select application_id, concurrent_queue_name, user_concurrent_queue_name
              from fnd_concurrent_queues_vl
              where manager_type = 1;
Line: 908

      delete_metric_internal('PENDING_REQ_MANAGER');
Line: 911

          update_pend_req_mgr_metric(mgr.application_id, mgr.concurrent_queue_name, mgr.user_concurrent_queue_name);
Line: 931

        SELECT r.requested_by user_id,
                count(r.actual_completion_date) count,
                sum(r.actual_completion_date-nvl(r.actual_start_date,r.requested_start_date))*24*3600 runtime  --in seconds
           FROM fnd_concurrent_requests r
          WHERE r.phase_code = 'C'
           and (sysdate - r.actual_completion_date) <= 1
          group by r.requested_by;
Line: 940

        SELECT r.requested_by user_id,
                count(r.actual_completion_date) count,
                sum(r.actual_completion_date-nvl(r.actual_start_date,r.requested_start_date))*24*3600 runtime --in seconds
           FROM fnd_concurrent_requests r
          WHERE r.phase_code = 'C'
           and (sysdate - r.actual_completion_date) <= 7
          group by r.requested_by;
Line: 949

        SELECT r.requested_by user_id,
                count(r.actual_completion_date) count,
                sum(r.actual_completion_date-nvl(r.actual_start_date,r.requested_start_date))*24*3600 runtime --in seconds
           FROM fnd_concurrent_requests r
          WHERE r.phase_code = 'C'
           and (sysdate - r.actual_completion_date) <= 31
          group by r.requested_by;
Line: 960

      delete from fnd_oam_cpstats_user where stats_interval = 24; --24 hours
Line: 963

         insert_stats_user(stat.user_id, 24, stat.count, stat.runtime);
Line: 966

      delete from fnd_oam_cpstats_user where stats_interval = 168; -- 7days = 168 hours
Line: 969

         insert_stats_user(stat.user_id, 168, stat.count, stat.runtime);
Line: 972

      delete from fnd_oam_cpstats_user where stats_interval = 744;  --31 days = 744 hours
Line: 975

         insert_stats_user(stat.user_id, 744, stat.count, stat.runtime);
Line: 993

      SELECT r.program_application_id app_id, r.concurrent_program_id prog_id,
       round(sum(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) total, -- in seconds
       round(avg(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) ave,  -- in seconds
       round(min(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) minimum, -- in seconds
       round(max(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) maximum,  -- in seconds
       count(*) count
      FROM fnd_concurrent_requests r
      WHERE r.phase_code = 'C'
        and r.actual_completion_date is not null
        and r.actual_start_date is not null
        and (sysdate - r.actual_completion_date) <= 1
      GROUP BY r.program_application_id, r.concurrent_program_id;
Line: 1007

      SELECT r.program_application_id app_id, r.concurrent_program_id prog_id,
       round(sum(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) total,
       round(avg(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) ave,
       round(min(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) minimum,
       round(max(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) maximum,
       count(*) count
      FROM fnd_concurrent_requests r
      WHERE r.phase_code = 'C'
        and r.actual_completion_date is not null
        and r.actual_start_date is not null
        and (sysdate - r.actual_completion_date) <= 7
      GROUP BY r.program_application_id, r.concurrent_program_id;
Line: 1021

      SELECT r.program_application_id app_id, r.concurrent_program_id prog_id,
       round(sum(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) total,
       round(avg(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) ave,
       round(min(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) minimum,
       round(max(greatest(actual_completion_date-actual_start_date,0))*3600*24, 0) maximum,
       count(*) count
      FROM fnd_concurrent_requests r
      WHERE r.phase_code = 'C'
        and r.actual_completion_date is not null
        and r.actual_start_date is not null
        and (sysdate - r.actual_completion_date) <= 31
      GROUP BY r.program_application_id, r.concurrent_program_id;
Line: 1037

      delete from fnd_oam_cpstats_program where stats_interval = 24;
Line: 1040

         insert_stats_program(stat.app_id, stat.prog_id, 24,
                stat.total, stat.ave, stat.minimum, stat.maximum, stat.count);
Line: 1044

      delete from fnd_oam_cpstats_program where stats_interval = 168; -- 7 days = 168 hours
Line: 1047

         insert_stats_program(stat.app_id, stat.prog_id, 168,
                stat.total, stat.ave, stat.minimum, stat.maximum, stat.count);
Line: 1051

      delete from fnd_oam_cpstats_program where stats_interval = 744; -- 31 days = 744 hours
Line: 1054

         insert_stats_program(stat.app_id, stat.prog_id, 744,
                stat.total, stat.ave, stat.minimum, stat.maximum, stat.count);
Line: 1074

  PROCEDURE insert_stats_user (
      p_user_id in number,
      p_stats_interval in varchar2,
      p_comp_req_count in number,
      p_total_runtime in number)
  IS
        v_userid number;
Line: 1085

         insert into fnd_oam_cpstats_user (user_id, stats_interval,
          comp_req_count, total_runtime,
          last_updated_by, last_update_date,
          last_update_login, created_by, creation_date)
         values (p_user_id, p_stats_interval, p_comp_req_count,
              p_total_runtime,
              v_userid, sysdate, v_userid, 0, sysdate);
Line: 1093

  END insert_stats_user;
Line: 1103

  PROCEDURE insert_stats_program (
      p_app_id in number,
      p_program_id in number,
      p_stats_interval in varchar2,
      p_total_runtime in number,
      p_ave_tuntime in number,
      p_min_tuntime in number,
      p_max_tuntime in number,
      p_times_run in number)
  IS
        v_userid number;
Line: 1118

         insert into fnd_oam_cpstats_program (application_id, program_id, stats_interval,
          total_runtime, ave_runtime, min_runtime, max_runtime, times_run,
          last_updated_by, last_update_date,
          last_update_login, created_by, creation_date)
         values (p_app_id, p_program_id, p_stats_interval, p_total_runtime,
         p_ave_tuntime, p_min_tuntime, p_max_tuntime,
              p_times_run,
              v_userid, sysdate, v_userid, 0, sysdate);
Line: 1127

  END insert_stats_program;
Line: 1190

      select application_id, responsibility_id, responsibility_key
        into appl_id, resp_id, resp_key
          from fnd_responsibility
        where responsibility_key = 'SYSTEM_ADMINISTRATOR';
Line: 1195

      select user_id, user_name
        into user_id, user_name
          from fnd_user
      where user_name = 'SYSADMIN';