SQL Id | SQL Text |
01d5n1nm17r2h | select nvl2(stale_stats, decode(stale_stats, 'NO', 3, 1), 2) from dba_ind_statistics where owner=:1 and index_name=:2 |
0ctmguuvf24vp |
SELECT SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(5) + 1)) AS "Calculation_149463257772064768"
FROM (
select
asl.service_info_v,
c.trans_num_v,
b.PERIOD_V,
d.account_type_v,
c.invoice_generated_on_d,
a.BANK_CODE_V, a.BRANCH_CODE_V,
a.CARD#ACCOUNT_NUMBER_V BANK_ACC_NO,
a.CARD#ACC_HOLDER_NAME_V BANK_NAME,
sum(INVOICE_AMT_N)/100 INVOICE_AMT,
sum(INVOICE_TAX_N)/100 INVOICE_TAX_AMT,
sum(INV_AMT_CLEARED_N)/100 INVOICE_AMT_CLEARED,
sum(ADJUSTMENT_AMT_N)/100 INVOICE_ADJUST_AMT,
sum(b.AMOUNT_N)/100 DDEBIT_AMOUNT,
d.account_name_v,
d.account_code_n,
e.ext_subscriber_code_v Customer_id,
e.first_name_v||' ' ||e.last_name_v Subscriber_name
from cbsogg.cb_auto_debit a,
tmp_auto_debit_log@cbsstandby b,
cbsogg.cb_invoice c,
cbsogg.cb_account_master d,
cbsogg.cb_subscriber_master e,
cb_account_servi
ce_list asl
where c.account_link_code_n = d.account_link_code_n
and e.ext_subscriber_code_v = asl.ext_subscriber_code_v
and asl.account_code_n = d.account_code_n
and d.subscriber_code_n = e.subscriber_code_n
and a.account_link_code_n = b.account_link_code_n
and asl.sub_service_code_v not in ('FXL-COPER', 'FXL-FIBER')
and b.INVOICE_NUM_V = c.trans_num_v
--and substr(UPPER(a.CARD#ACCOUNT_NUMBER_V), 1, 2) in ('FR', 'FC', 'MT')
and a.ACCOUNT_LINK_CODE_N = c.account_link_code_n
group by
asl.service_info_v,
c.trans_num_v,
b.PERIOD_V,
d.account_type_v,
c.invoice_generated_on_d,
a.BANK_CODE_V, a.BRANCH_CODE_V,
a.CARD#ACCOUNT_NUMBER_V ,
a.CARD#ACC_HOLDER_NAME_V ,
d.account_name_v,
d.account_code_n,
e.ext_subscriber_code_v,
e.first_name_v||' ' ||e.last_name_v
) "Custom SQL Query"
WHERE (("Custom SQL Query"."ACCOUNT_TYPE_V" = 'FXL') AND ((CASE WHEN ((SUBSTR("Custom SQL Query".
"TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'A') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'B') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'C') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'D') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'M')) THEN SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) ELSE NULL END) >= 'A') AND ((CASE WHEN ((SUBSTR("Cust
om SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'A') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'B') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'C') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'D') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'M')) THEN SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) ELSE NULL END) <= 'D') AND ((CASE WHEN
("Custom SQL Query"."BANK_CODE_V" = 'FC') THEN 1 WHEN ("Custom SQL Query"."BANK_CODE_V" = 'HID') THEN 1 WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CME') THEN 1 WHEN ("Custom SQL Query"."BANK_CODE_V" = 'TLS') THEN 1 WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CPD') THEN 1 ELSE NULL END) <> 0))
GROUP BY SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(5) + 1)) |
0fwgf46fun8jx | DELETE SYSTEM.LOGMNR_DICTSTATE$ WHERE LOGMNR_UID = :B2 AND REDO_THREAD = :B1 AND ((END_SCNWRP * 4294967296 + END_SCNBAS) < (SELECT MAX (END_SCNWRP * 4294967296 + END_SCNBAS) FROM SYSTEM.LOGMNR_DICTSTATE$ WHERE LOGMNR_UID = :B2 AND REDO_THREAD = :B1 )) |
0g319xmz2cm35 |
SELECT ((TO_NUMBER(TO_CHAR(TRUNC(CAST("TB_BUS_STAT_FIX"."TRANS_DATE_D" AS DATE)), 'YYYY')) * 100) + TO_NUMBER(TO_CHAR(TRUNC(CAST("TB_BUS_STAT_FIX"."TRANS_DATE_D" AS DATE)), 'MM'))) AS "my:TRANS_DATE_D:ok"
FROM (
SELECT CUSTOMER_ID,
ACCOUNT_NAME,
ACCOUNT_CODE_N,
MSISDN,
INVOICE_NUMBER,
INVOICE_AMOUNT,
VAT_AMOUNT,
TOTAL_AMOUNT,
AMOUNT_PAID,
TRANS_DATE_D,
REFUND_AMT,
OUT_SURCHARGE_AMT,
DUE_DATE,
CREDIT_NOTE,
SURCHARGE_AMT,
trunc(ACCOUNT_LINK_CODE_N),
STATUS, CANCELLATION_DATE,
SUSPENDED_DATE, DEBIT_NOTE,
SURCHARGE_BILL_NO,
ADJUSTMENT_AMOUNT,
BILL_TYPE,
PAYMENT_AGREEMENT
FROM BIREPORT.TB_BUS_STAT_FIX
) "TB_BUS_STAT_FIX"
GROUP BY ((TO_NUMBER(TO_CHAR(TRUNC(CAST("TB_BUS_STAT_FIX"."TRANS_DATE_D" AS DATE)), 'YYYY')) * 100) + TO_NUMBER(TO_CHAR(TRUNC(CAST("TB_BUS_STAT_FIX"."TRANS_DATE_D"
AS DATE)), 'MM'))) |
0hmpf40s6xpvh | SELECT STATUS_V, EXECUTION_DATE_DT, ACK_DATE_DT, ACTION_DATE_DT FROM CBSOGG.CB_SUBS_PROVISIONING WHERE ORDER_REF_NO_V = :B1 AND ROWNUM = 1 |
0m6gg6gzr2swy | create table TB_TT_C |
0mr16zpd2ggra | CREATE TABLE CBS_ORD |
0na0jhwrs24wr |
DECLARE KRVX_STATUS_DICT_INTERNERR EXCEPTION; PRAGMA EXCEPTION_INIT(KRVX_STATUS_DICT_INTERNERR, -1332); loc_logmnruid NUMBER; loc_endscnbas NUMBER; loc_endscnwrp NUMBER; loc_redothrd NUMBER; loc_rbasqn NUMBER; loc_rbablk NUMBER; loc_rbabyte NUMBER; BEGIN loc_logmnruid := :1; loc_endscnbas := :2; loc_endscnwrp := :3; loc_redothrd := :4; loc_rbasqn := :5; loc_rbablk := :6; loc_rbabyte := :7; INSERT INTO system.logmnr_dictstate$ (logmnr_uid, start_scnbas, start_scnwrp, end_scnbas, end_scnwrp, redo_thread, rbasqn, rbablk, rbabyte) SELECT loc_logmnruid, start_scnbas, start_scnwrp, loc_endscnbas, loc_endscnwrp, loc_redothrd, loc_rbasqn, loc_rbablk, loc_rbabyte FROM system.logmnr_dictstate$ WHERE logmnr_uid = loc_logmnruid AND rownum = 1; IF SQL%ROWCOUNT <> 1 THEN DBMS_SYSTEM.KSDWRT(dbms_sy
stem.trace_file, 'ORA-01332 from krvrdpdes0SQL, position 1'); RAISE KRVX_STATUS_DICT_INTERNERR; END IF; DELETE system.logmnr_dictstate$ WHERE logmnr_UID = loc_logmnruid AND redo_thread = loc_redothrd AND ((end_scnwrp * 4294967296 + end_scnbas) < (SELECT MAX (end_scnwrp * 4294967296 + end_scnbas) FROM system.logmnr_dictstate$ WHERE logmnr_UID = loc_logmnruid AND redo_thread = loc_redothrd)); END; |
0s45x374j8cc5 | update /*+ streams restrict_all_ref_cons */ "CBSOGG"."CB_SUBS_PROVISIONING" p set "CAI_CMD_RESP_STRING"=dbms_reputil2.get_final_lob(:1, "CAI_CMD_RESP_STRING", :2), "REMARK_V"=decode(:3, 'N', "REMARK_V", :4), "STATUS_V"=decode(:5, 'N', "STATUS_V", :6) where (:7="CHRONO_NUM_N") and (:8="PROCESS_NO_N") |
0v3dvmc22qnam | insert into sys.col_usage$ (obj#, intcol#, equality_preds, equijoin_preds, nonequijoin_preds, range_preds, like_preds, null_preds, timestamp) values ( :objn, :coln, decode(bitand(:flag, 1), 0, 0, 1), decode(bitand(:flag, 2), 0, 0, 1), decode(bitand(:flag, 4), 0, 0, 1), decode(bitand(:flag, 8), 0, 0, 1), decode(bitand(:flag, 16), 0, 0, 1), decode(bitand(:flag, 32), 0, 0, 1), :time) |
0vcs754gpmxrc |
WITH binds as
(select :dbid as dbid
, :inst_id_low as instIdLow
, :inst_id_high as instIdHigh
, :begin_snap as beginSnap
, :end_snap as endSnap
, :begin_time as beginTime
, :end_time as endTime
, :disk_begin_time as diskBeginTime
, :disk_end_time as diskEndTime
, :mem_begin_time as memBeginTime
, :mem_end_time as memEndTime
, :bucket_count as bucketCount
, :bucket_interval as bucketInterval
, :mem_enable as memEnable
, :disk_enable as diskEnable
, :disk_filter_ratio as filterRatio, :filter_action as filter_action, :filter_blocking_session as filter_blocking_session, :filter_capture_id
as filter_capture_id, :filter_client_id as filter_client_id, :filter_consumer_group_id as filter_consumer_group_id, :filter_dbop as filter_dbop, :filter_ecid as filter_ecid, :filter_event as filter_event, :filter_instance_number as filter_instance_number, :filter_is_captured as filter_is_captured, :filter_is_filtered_out as filter_is_filtered_out, :filter_is_nc_background as filter_is_nc_background, :filter_is_replayed as filter_is_replayed, :filter_machine as filter_machine, :filter_machine_port as filter_machine_port, :filter_module as filter_module, :filter_object as filter_object, :filter_pdb as filter_pdb, :filter_physical_session as filter_physical_session, :filter_pl_sql as filter_pl_sql, :filter_pl_sql_top as filter_pl_sql_top, :filter_program as filter_program, :filter_px_process as filter_px_process, :filter_service_hash as filter_service_hash, :filter_session_type as filter_session_type, :filter_sql_fms as filter_sql_fms, :filter_sql_id_top as filter
_sql_id_top, :filter_sql_opcode as filter_sql_opcode, :filter_sql_opcode_top as filter_sql_opcode_top, :filter_sql_rws as filter_sql_rws, :filter_sql_rws_line as filter_sql_rws_line, :filter_sqlid as filter_sqlid, :filter_sqlid_fullphv as filter_sqlid_fullphv, :filter_sqlid_phv as filter_sqlid_phv, :filter_user_id as filter_user_id, :filter_wait_class as filter_wait_class, :filter_xid as filter_xid from dual) , unified_ash as
(SELECT a.sample_id
, a.sample_time
, a.session_id
, a.session_serial#
, a.session_type
, a.session_state
, a.flags
, a.user_id
, a.sql_id
, a.sql_opcode
, a.sql_opname
, a.top_level_sql_id
, a.top_level_sql_opcode
, a.sql_child_number
, a.sql_plan_hash_value
, a.sql_full_plan_hash_value
, a.sql_plan_line_id
, a.sql_plan_operation
, a.sql_plan_options
, a.sql_exec_id
, a.force_
matching_signature
, a.plsql_entry_object_id
, a.plsql_entry_subprogram_id
, a.plsql_object_id
, a.plsql_subprogram_id
, a.service_hash
, a.qc_session_id
, a.qc_instance_id
, a.qc_session_serial#
, nvl(a.event,
CASE WHEN bitand(a.time_model, power(2, 19)) > 0
THEN 'CPU: IM Populate'
WHEN bitand(a.time_model, power(2, 20)) > 0
THEN 'CPU: IM Prepopulate'
WHEN bitand(a.time_model, power(2, 21)) > 0
THEN 'CPU: IM Repopulate'
WHEN bitand(a.time_model, power(2, 22)) > 0
THEN 'CPU: IM Trickle Repop'
WHEN bitand(a.time_model, power(2, 18)) > 0
THEN 'CPU: IM Query'
ELSE 'CPU + Wait for CPU' END) as event
, nvl(a.event_id, 1)
as event_id
, nvl(a.wait_class, 'CPU')
as wait_class
, nvl(a.wait_class_id, 9999)
as wait_class_id
, a.seq#
, a.p1
, a.p1text
, a.p2
, a.p2text
, a.p3
, a.p3text
, a.wait_time
, a.time_waited
, rawtohex(a.xid) as xid
, a.blocking_session
, a.blocking_session_serial#
, a.blocking_session_status
, a.blocking_inst_id
, a.current_obj#
, a.current_file#
, a.current_block#
, a.top_level_call#
, a.top_level_call_name
, a.program
, a.module
, a.action
, a.client_id
, a.remote_instance#
, a.ecid
, a.consumer_group_id
, a.machine
, a.port
, a.in_connection_mgmt
, a.in_parse
, a.in_hard_parse
, a.in_sql_execution
, a.in_plsql_execution
, a.in_plsql_rpc
, a.in_plsql_compilation
, a.in_java_execution
, a.in_bind
, a.in_cursor_close
, a.in_sequence_load
, a.is_captured
, a.is_replayed
, a.dbreplay_file_id
, a.dbop_name
, a.con_dbid, decode(binds.diskEnable, 0, 1, binds.filterRatio)
as sample_count
, inst_id as instance_number
FROM gv$active_session_history a, binds
WHERE binds.memEnable = 1
AND ( binds.diskEnable = 0
OR ( binds.diskEnable = 1
AND a.is_awr_sample = 'Y'
AND bitand(a.flags, 128) = 0 ) )
AND a.inst_id between
binds.instIdLow
and binds.instIdHigh
AND a.sample_time between
binds.beginTime
and binds.endTime
UNION ALL
SELECT a.sample_id
, a.sample_time
, a.session_id
, a.
session_serial#
, a.session_type
, a.session_state
, a.flags
, a.user_id
, a.sql_id
, a.sql_opcode
, a.sql_opname
, a.top_level_sql_id
, a.top_level_sql_opcode
, a.sql_child_number
, a.sql_plan_hash_value
, a.sql_full_plan_hash_value
, a.sql_plan_line_id
, a.sql_plan_operation
, a.sql_plan_options
, a.sql_exec_id
, a.force_matching_signature
, a.plsql_entry_object_id
, a.plsql_entry_subprogram_id
, a.plsql_object_id
, a.plsql_subprogram_id
, a.service_hash
, a.qc_session_id
, a.qc_instance_id
, a.qc_session_serial#
, nvl(a.event,
CASE WHEN bitand(a.time_model, power(2, 19)) > 0
THEN 'CPU: IM Populate'
WHEN bitand(a.time_model, power(2, 20)) > 0
THEN 'CPU: IM Prepopulate'
WHEN bitand(a
.time_model, power(2, 21)) > 0
THEN 'CPU: IM Repopulate'
WHEN bitand(a.time_model, power(2, 22)) > 0
THEN 'CPU: IM Trickle Repop'
WHEN bitand(a.time_model, power(2, 18)) > 0
THEN 'CPU: IM Query'
ELSE 'CPU + Wait for CPU' END) as event
, nvl(a.event_id, 1)
as event_id
, nvl(a.wait_class, 'CPU')
as wait_class
, nvl(a.wait_class_id, 9999)
as wait_class_id
, a.seq#
, a.p1
, a.p1text
, a.p2
, a.p2text
, a.p3
, a.p3text
, a.wait_time
, a.time_waited
, rawtohex(a.xid) as xid
, a.blocking_session
, a.blocking_session_serial#
, a.blocking_session_status
, a.blocking_inst_id
, a.current_obj#
, a.current_file#
, a.current_block#
, a.top_level_call#
, a.top_level_call_name
, a.program
, a.module
, a.action
, a.client_id
, a.remote_instance#
, a.ecid
, a.consumer_group_id
, a.machine
, a.port
, a.in_connection_mgmt
, a.in_parse
, a.in_hard_parse
, a.in_sql_execution
, a.in_plsql_execution
, a.in_plsql_rpc
, a.in_plsql_compilation
, a.in_java_execution
, a.in_bind
, a.in_cursor_close
, a.in_sequence_load
, a.is_captured
, a.is_replayed
, a.dbreplay_file_id
, a.dbop_name
, a.con_dbid, binds.filterRatio as sample_count
, instance_number as instance_number
FROM dba_hist_active_sess_history a, binds
WHERE binds.diskEnable = 1
AND a.dbid = binds.dbid
AND a.instance_number between
binds.instIdLow
and binds.instIdHigh
AND a.snap_id between
binds.beginSnap
and binds.endSnap
AND a.sample_time between
binds.beginTime
and binds.endTime
), logical_ash as
(select sample_id
, sample_time
, sample_count
, instance_number as inst_id, action as action, event as event, instance_number as instance_number, module as module, instance_number || ':' || session_id || ', ' || session_serial# as physical_session, service_hash as service_hash, sql_id as sqlid, wait_class as wait_class, xid as xid, user_id as user_id, program as program from unified_ash) , bucketized_ash as
(SELECT ash0.*,
(case when binds.bucketCount > 1
then trunc( ( (24 * 60 * 60 *
extract(day from sample_t
ime
- binds.beginTime))
+ (60 * 60 *
extract(hour from sample_time
- binds.beginTime))
+ (60 *
extract(minute from sample_time
- binds.beginTime))
+ (1 *
extract(second from sample_time
- binds.beginTime))
) / binds.bucketInterval
) + 1
else 1
end) as bucket_number
FROM logical_ash ash0, binds), filter_xml as
(SELECT xmlconcat(xmlelement("filters" )
, xmlelement("
report_time", xmlattributes(
to_char(o.begintime, 'HH24:MI:SS MM/DD/YYYY') as "begin_time",
to_char(o.endtime, 'HH24:MI:SS MM/DD/YYYY') as "end_time"))) as xml_frag FROM
(select binds.*, nvl(to_number(filter_pdb), 0) as con_dbid from binds) o) , filtered_ash as
(SELECT ash.*,
1 filtered
FROM bucketized_ash ash, binds WHERE 1=1 ), grouped_ash as
(SELECT ash.*, 0 AS bucket_type FROM (SELECT sqlid, physical_session, action, module, service_hash, instance_number, event, wait_class , grouping_id(sqlid, physical_session, action, module, service_hash, instance_number, event, wait_class) as gid , max(inst_id) as inst_id
, sum(sample_count) as sample_count
, count(distinct sqlid) as uniq_sqlids
, count(distinct xid) as uniq_xids
, count(distinct physical_session)
as uniq_sessions
, count(distinct instance_number)
as uniq_instances, max(user_id) as user_id, max(program) as program from filtered_ash
group by grouping sets( (wait_class), (sqlid), (module), (event), (action), (instance_number), (physical_session), (service_hash)) ) ash ), component_1_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
from (select max(case when mem_rank <= 13
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 13
then mem_rank
else (13 + 1)
end) as mem_rank
, max(case when mem_rank <= 13
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 13
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 13
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 13
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
from (select wait_class as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, wait_class) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 254
and wait_class is not null)
group by (case when mem_rank <= 13
then dim_val
else null
end)
) left ) , component_1_xml as
(select xmlelement("item"
, xmlattributes('wait_class' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.nu
m_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 13
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 13
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 13
then 0
else num_mem
end) as num_others
f
rom (component_1_treemap) t
) topmems), component_2_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank
<= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 5
then uniq_instances
else
0
end) as uniq_instances
, max(inst_id) as inst_id
from (select event as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, event) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 253
and event is not null)
group by (case when mem_rank <= 5
then dim_val
else null
end)
) left ) , component_2_xml as
(select xmlelement("item"
, xmlattributes('event' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg
(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else num_mem
end) as num_others
from (component_2_treemap) t
) topmems), component_3_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 5
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
from (select instance_number as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
,
instance_number) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 251
and instance_number is not null)
group by (case when mem_rank <= 5
then dim_val
else null
end)
) left ) , component_3_xml as
(select xmlelement("item"
, xmlattributes('instance_number' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else
num_mem
end) as num_others
from (component_3_treemap) t
) topmems), component_4_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
, NVL((SELECT name
FROM gv$active_services v
WHERE v.name_hash = left.dim_val
AND v.inst_id = left.inst_id
AND rownum < 2 ), ( SELECT service_name
FROM dba_hist_service_name v, binds b
WHERE v.dbid = b.dbid
AND v.service_name_hash = left.dim_val
AND rownum < 2)) as service_name
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 5
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
from (select service_hash as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, service_hash) as mem_rank
, uniq_s
qlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 247
and service_hash is not null)
group by (case when mem_rank <= 5
then dim_val
else null
end)
) left ) , component_4_xml as
(select xmlelement("item"
, xmlattributes('service_hash' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
, service_name)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else num_mem
end) as num
_others
from (component_4_treemap) t
) topmems), component_5_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 5
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
from (select module as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, module) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 239
and module is not null)
group by (case wh
en mem_rank <= 5
then dim_val
else null
end)
) left ) , component_5_xml as
(select xmlelement("item"
, xmlattributes('module' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else num_mem
end) as num_others
from (component_5_treemap) t
) topmems), component_6_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, un
iq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case w
hen mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 5
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
from (select action as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, action) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 223
and action is not null)
group by (case when mem_rank <= 5
then dim_val
else null
end)
) left ) , component_6_xml as
(select xmlelement("item"
, xmlattributes('action' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else
num_mem
end) as num_others
from (component_6_treemap) t
) topmems), component_7_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
, user_id, program
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case whe
n mem_rank <= 5
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
, max(case when mem_rank <= 5
then user_id else null
end) as user_id, max(case when mem_rank <= 5
then program else null
end) as program
from (select physical_session as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, physical_session) as mem_rank
, uniq_sqlids
, uni
q_xids
, uniq_sessions
, uniq_instances
, inst_id
, user_id, program
from grouped_ash
where gid = 191
and physical_session is not null)
group by (case when mem_rank <= 5
then dim_val
else null
end)
) left ) , component_7_xml as
(select xmlelement("item"
, xmlattributes('physical_session' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.
num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
, xmlconcat(xmlelement("info", xmlattributes('user_id' as "name"), user_id), xmlelement("info", xmlattributes('program' as "name"), program))
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else num_mem
end) as num_others
from (component_7_treemap) t
) topmems), component_8_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
, NVL((SELECT substr(v.sql_text, 1, 100) as sql_text
FROM gv$sql v
WHERE v.sql_id = left.dim_val
AND v.inst_id = left.inst_id
AND rownum < 2 ), ( SELECT dbms_lob.substr
(v.sql_text, 100, 1) as sql_text
FROM dba_hist_sqltext v, binds b
WHERE v.dbid = b.dbid
AND v.sql_id = left.dim_val
AND rownum < 2)) as sql_text
from (select max(case when mem_rank <= 5
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 5
then mem_rank
else (5 + 1)
end) as mem_rank
, max(case when mem_rank <= 5
then uniq_sqlids
else 0
end)
as uniq_sqlids
, max(case when mem_rank <= 5
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 5
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 5
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id) as inst_id
from (select sqlid as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, sqlid) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 127
and sqlid is not null)
group by (case when mem_rank <= 5
then dim_val
else null
end)
) left ) , component_8_xml as
(select xmlelement("item"
, xmlattributes('sqlid' as "id"
, topmems.cnt_a
ll as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , topmems.topmems_frag) as dim_frag from (select xmlelement(
"top_mems"
, xmlattributes(sum(case when mem_rank <= 5
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_co
unt as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
, sql_text)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 5
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 5
then 0
else num_mem
end) as num_others
from (component_8_treemap) t
) topmems)select
xmlconcat((select xml_frag from filter_xml),
xmlelement("dim_list",
xmlelement("item",
xmlattributes('top_dimensions' as "id"),
xmlelement("subdim", xmlconcat((select dim_frag from component_1_xml), (select dim_frag from component_2_xml), (select dim_frag from component_3_xml), (select dim_frag from component_4_xml), (select dim_frag from component_5_xml), (select dim_frag from component_6_xml), (select dim_frag from component_7_xml), (select dim_frag from component_8_xml)))),
xmltype('
<item type="separator" />'),
xmltype('
<item id="
sql_cat">
<subdim>
<item id="sqlid" />
<item id="sql_id_top" />
<item id="sql_fms" />
<item id="sqlid_phv" />
<item id="sqlid_fullphv"/>
<item id="sql_rws" />
<item id="sql_rws_line" />
<item id="sql_opcode" />
<item id="sql_opcode_top" />
</subdim>
</item>'),
xmltype('
<item id="pl_sql_cat">
<subdim>
<item id="pl_sql" />
<item id="pl_sql_top" />
</subdim>
</item>'),
xmltype('
<item id="resource_consumption_cat">
<subdim>
<item id="wait_class" />
<item id="event" />
<item id="object" />
<item id="blocking_session" />
</subdim>
</item>'),
xmltype('
<item id="session_identifiers_cat">
<subdim>
<item id="instance_number" /> <item id="service_hash" />
<item id="physical_session" />
<item id="px_process" />
<item id="user_id" />
<item id="program" />
<item id="session_type" />
</subdim>
</item>'),
xmltype('
<item id="session_attributes_cat">
<subdim>
<item id="consumer_group_id" /
>
<item id="module" />
<item id="action" />
<item id="client_id" />
<item id="machine" />
<item id="machine_port" />
<item id="xid" />
<item id="ecid" />
<item id="dbop" />
</subdim>
</item>'))
) from dual |
0w26sk6t6gq98 | SELECT XMLTYPE(DBMS_REPORT.GET_REPORT_WITH_SUMMARY(:B1 )) FROM DUAL |
0wpkk7t4wuzyy | SELECT SUB_SERVICE_DESC_V FROM CBSOGG.CB_SUB_SERVICES WHERE SERVICE_CODE_V = :B1 AND SUB_SERVICE_CODE_V = :B2 |
0yj2970wjbsfv | UPDATE sys.streams$_capture_process SET spare5=:1, spare2=:2, spare1=:3 WHERE capture_name = :4 |
0zk1h5p82umh3 | create table TB_TT_G |
12qx9k6v2zxx3 | create table MT_TS_O |
13f6nhzb16cbx |
INSERT INTO CBS_ORDER_REPORT (ORDER_ID_V, CUSTOMER_NAME_V, ORDER_AMOUNT_N, PROV_STATUS_V, SCHEME_REF_CODE_N, EXECUTION_DATE_DT, FROM_DATE_DT, ACK_DATE_DT, PACKAGE_CODE_V, SUBSCRIBER_CODE_N, EXT_SUBSCRIBER_CODE_V, SERVICE_KEY_CODE_V, TRANS_DATE_DT, ACCOUNT_LINK_CODE_N, SUBS_CATEGORY_CODE_V, SUBS_SUB_CATEGORY_CODE_V, ACCOUNT_CODE_N, ACCOUNT_NAME_V, ACTION_DATE_DT, SERVICE_INFO_V, ORDER_TYPE_V, ORDER_REF_NO, ACTION_V, USER_NAME_V, LOCATION_V, SERVICE_CODE_V, SUB_SERVICE_CODE_V, FDP_V, LOC_ZONE_V, SUB_SERVICE_DESC_V, PACKAGE_V, PHONE_NO_V, SEGMENT_V, SUB_SEGMENT_V, OLD_PACKAGE_V, OLD_OFFER_V, OLD_SERVICE_V, NEW_PACKAGE_V, NEW_OFFER_V, NEW_SERVICE_V, FIXED_LINE_NO_V, COMMENTS_V, ACTION_DESCRIPTION_V, PROCESSED_DATE_DT, PS_FLAG_V, ONLINE_OR_MANUAL_ORDER_V, REP_EXECUTION_DATE_D, ORDER_STATUS_V, OFFER_V, REASON_V, CONTACT_TYPE_V ) VALUES (:B48 , :B47 , :B46 , :B45 , :B44 , :B43 , :B42 , :B41 , :B40 , :B39 , :B38 , :B37 , :B36 , :B1 , :B35
, :B34 , :B33 , :B32 , :B31 , :B30 , :B29 , :B28 , :B9 , :B27 , :B26 , :B25 , :B24 , :B23 , :B22 , :B21 , :B20 , :B11 , :B19 , :B18 , :B17 , :B16 , :B15 , :B14 , :B13 , :B12 , :B11 , :B10 , :B9 , :B2 , :B8 , :B7 , SYSTIMESTAMP, :B3 , :B6 , :B5 , :B4 ) |
14d7z6mh1sxuz | select name, intcol#, segcol#, type#, length, nvl(precision#, 0), decode(type#, 2, nvl(scale, -127/*MAXSB1MINAL*/), 178, scale, 179, scale, 180, scale, 181, scale, 182, scale, 183, scale, 231, scale, 0), null$, fixedstorage, nvl(deflength, 0), default$, rowid, col#, property, nvl(charsetid, 0), nvl(charsetform, 0), spare1, spare2, nvl(spare3, 0), nvl(evaledition#, 1), nvl(unusablebefore#, 0), nvl(unusablebeginning#, 0) from col$ where obj#=:1 order by intcol# |
1b43yj69y93wy | UPDATE /*+ restrict_all_ref_cons */ "CBSOGG"."GSM_CYCLE_SUMMARY_DETAILS" SET "CHARGE_AMOUNT_N"=:1 , "TAX_AMOUNT_N"=:2 , "NUM_UNITS_N"=:3 , "DURATION_N"=:4 , "NUM_CALLS_N"=:5 , "LOC_CHARGE_AMOUNT_N"=:6 , "CHARGE_NUM_OF_CALLS_N"=:7 , "DISC_AMT_N"=:8 , "DISC_DURN_N"=:9 , "LOC_DISC_AMT_N"=:10 , "VOLUME_N"=:11 , "FREE_DISC_AMT_N"=:12 WHERE "ACCOUNT_LINK_CODE_N"=:13 AND "SUMMARY_SEQ_NO_N"=:14 AND "ARTICLE_CODE_V"=:15 |
1f5zh4bk6acp0 |
SELECT "Custom SQL Query"."TICKET_TYPE" AS "TICKET_TYPE"
FROM (
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zo
ne 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voi
ce_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where
tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.categor
y_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union all
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec
,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v )
MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n fro
m cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0
') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM_HISTORY a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT_HISTORY c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cbsogg.cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union all
select distinct 'FLR' Category,
tt.
docket_number_n ticket_no, null Workflow_desc,
null sla_time, tt.ticket_regn_dt_d registration_date, null wf_reg_date_sec, null start_date,
null wf_start_date_sec, null wf_end_date, null wf_end_date_sec, tt.ticket_resp_dt_d workflw_resp_date,
null wf_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '
0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.
subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
null bin_expiry_date, null bin_expiry_date_sec, null bin_assign_date, null bin_assign_date_sec, null bin_comp_date,
null bin_compl_date_sec,
null wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
null Assign_to,
C.GROUP_NAME_V activity_name,
tt.question_v, tt.answer_v,
TTI.NOTES_V Notes,
(SELE
CT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT--, TT_TICKETINFO c
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
B.USER_NAME_V user_name
from cbsogg.TT_TICKETINFO tt, cbsogg.CB_USERS B, cbsogg.CB_USER_GROUP C, cbsogg.TT_TICKETINCIDENT TTI
where tt.docket_number_n not in(select event_refno_v from WF_WORKFLOW@cbsstandby)
AND TTI.INCIDENT_NUMBER_N = tt.docket_number_n
AND tt.LOGGED_BY_N = B.USER_CODE_N
AND C.GROUP_CODE_N = B.GROUP_CODE_N
) "Custom SQL Query"
GROUP BY "Custom SQL Query"."TICKET_TYPE"
ORDER BY 1 ASC NULLS FIRST |
1p5grz1gs7fjq | select obj#, type#, ctime, mtime, stime, status, dataobj#, flags, oid$, spare1, spare2, spare3, signature, spare7, spare8, spare9 from obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null and linkname is null and subname is null |
1qvcm9wr4sqgr | SELECT DISTINCT "A1"."ACCOUNT_CODE_N" FROM "CB_ACCOUNT_SERVICE_LIST" "A1" WHERE "A1"."SERVICE_INFO_V"=:B1 AND NVL("A1"."TO_DATE_D", SYSDATE@!)>=SYSDATE@! |
34qs1bh59x7x4 | SELECT COUNT(*) FROM SYSTEM.LOGMNRT_MDDL$ Y WHERE Y.SOURCE_OBJ# = :B2 AND Y.SOURCE_ROWID = :B1 |
3c1kubcdjnppq | update sys.col_usage$ set equality_preds = equality_preds + decode(bitand(:flag, 1), 0, 0, 1), equijoin_preds = equijoin_preds + decode(bitand(:flag, 2), 0, 0, 1), nonequijoin_preds = nonequijoin_preds + decode(bitand(:flag, 4), 0, 0, 1), range_preds = range_preds + decode(bitand(:flag, 8), 0, 0, 1), like_preds = like_preds + decode(bitand(:flag, 16), 0, 0, 1), null_preds = null_preds + decode(bitand(:flag, 32), 0, 0, 1), timestamp = :time where obj# = :objn and intcol# = :coln |
3dc55aym0ddb4 | create table TB_MT_ |
3vj9g451n6xwr |
insert into TB_MT_TT_PEND_HIST_NEW
SELECT DISTINCT "TT_TICKETINFO"."DOCKET_NUMBER_N" AS "TICKET_NO",
"TT_TICKETINFO"."TICKET_REGN_DT_D" AS "TICKET_REGN_DT_D",
"TT_TICKETINFO"."ENTITY_TYPE_V" AS "ENTITY_TYPE_V",
TO_CHAR("TT_TICKETINFO"."ENTITY_ID_N") AS "ENTITY_ID_N",
"TT_TICKETINFO"."STATUS_V" AS "TICKET_STATUS",
"TT_TICKETINFO"."RESPONSE_MEDIUM_V" AS "RESPONSE_MEDIUM_V",
"TT_TICKETINFO"."RESP_MEDIUM_ADDR_V" AS "RESP_MEDIUM_ADDR_V",
"TT_TICKETINFO"."TICKET_TYPE_V" AS "TICKET_TYPE_V",
"TT_TICKETINFO"."REF_DOCKET_NUMBER_V" AS "REF_DOCKET_NUMBER_V",
"TT_TICKETINFO"."LOGGED_BY_N" AS "LOGGED_BY_N",
"TT_TICKETINFO"."TT_SOURCE_V" AS "TT_SOURCE_
V",
"TT_TICKETINFO"."RESPONDED_BY_N" AS "RESPONDED_BY_N",
"TT_TICKETINFO"."TICKET_RESP_DT_D" AS "TICKET_RESP_DT_D",
"TT_TICKETINFO"."LOCATION_V" AS "LOCATION_V",
"TT_TICKETINFO"."AREA_V" AS "AREA_V",
"TT_TICKETINFO"."REOPEN_COUNT_N" AS "REOPEN_COUNT_N",
"TT_TICKETINFO"."QUESTION_V" AS "QUESTION_V",
"TT_TICKETINFO"."ANSWER_V" AS "ANSWER_V",
"TT_TICKETINFO"."REMEDY_REF_NO_V" AS "REMEDY_REF_NO_V",
"TT_TICKETINFO"."FILE_NAME_V" AS "FILE_NAME_V",
"TT_TICKETINFO"."SEGMENT_V" AS "SEGMENT_V",
"TT_TICKETINFO"."CHANNEL_V" AS "CHANNEL_V",
"TT_TICKETINFO"."RELEVE" AS "RELEVE",
"TT_TICKETINFO
"."CAUSE" AS "CAUSE",
"TT_TICKETINFO"."COMMENTS" AS "COMMENTS",
"TT_TICKETINFO"."REASON" AS "REASON",
"COMPLAINT TYPE"."COMPLAINT_TYPE" AS "COMPLAINT_TYPE",
"COMPLAINT TYPE"."SUBCOMPLAINT_TYPE" AS "SUBCOMPLAINT_TYPE",
"COMPLAINT TYPE"."CATEGORY_DESC" AS "CATEGORY_DESC",
"COMPLAINT TYPE"."SERVICE_NAME" AS "SERVICE_NAME",
"WORKFLOW"."EVENT_TYPE_N" AS "WF_EVENT_TYPE_N",
"WORKFLOW"."EVENT_REFNO_V" AS "WF_EVENT_REFNO_V",
"WORKFLOW"."WRKFLW_ID_N" AS "WRKFLW_ID_N",
"WORKFLOW"."START_DT_D" AS "WF_START",
"WORKFLOW"."END_DT_D" AS "WF_END",
"WORKFLOW"."STATUS_V" AS "WF_STATUS",
"WORKFLOW"."CREATED_BY_N" AS "WF_CREATED_BY_N",
"WORKFLOW"."TERMINATED_BY_N" AS "WF_TERMINATED_BY_N",
"TODOITEM/HISTORY"."WORK_ID_N" AS "TD_WORK_ID_N",
"TODOITEM/HISTORY"."STATUS_V" AS "TD_STATUS_V",
"TODOITEM/HISTORY"."USER_ID_N" AS "TD_USER_ID_N",
"TODOITEM/HISTORY"."USER_ID_N" AS "TD_USER_ID_N_1",
"TODOITEM/HISTORY"."ACTIVITY_NAME_V" AS "TD_ACTIVITY_NAME_V",
"TODOITEM/HISTORY"."WORK_COMPLETION_DT_D" AS "TD_WORK_COMPLETION_DT_D",
"TODOITEM/HISTORY"."ASSIGNMENT_DT_D" AS "TD_ASSIGNMENT_DT_D",
"TODOITEM/HISTORY"."EXPIRY_TIME_D" AS "TD_EXPIRY_TIME_D",
"Customer Service Details"."ACCOUNT_LINK_CODE_N" AS "ACCOUNT_LINK_CODE_N",
"
Customer Service Details"."SUB_SERVICE_CODE_V" AS "SUB_SERVICE_CODE_V",
"Customer Service Details"."SERVICE_INFO_V" AS "SERVICE_INFO_V",
"Customer Service Details"."ACCOUNT_CODE_N" AS "ACCOUNT_CODE_N",
"Customer Service Details"."CUSTOMER_NAME" AS "CUSTOMER_NAME",
"Customer Service Details"."SUBSCRIBER_CATEGORY_V" AS "SUBSCRIBER_CATEGORY_V",
"Customer Service Details"."SUBSCRIBER_SUB_CATEGORY_V" AS "SUBSCRIBER_SUB_CATEGORY_V",
"Customer Service Details"."SERVICE_CODE_V" AS "SERVICE_CODE_V",
"Customer Service Details"."FDP" AS "FDP",
"Customer Service Details"."LOC_ZONE" AS "LOC_ZONE",
"Customer Service Details"."CABINET" AS "CABINET",
"Customer Service Details
"."PACKAGE" AS "PACKAGE",
"TICKET INCIDENT MOBI"."NOTES_V" AS "NOTES_V",
"TICKET INCIDENT MOBI"."INCIDENT_TIMESTAMP_D" AS "INCIDENT_TIMESTAMP_D",
"SUB SERVICE"."SUBSIDIARY_CODE_V" AS "SUBSIDIARY_CODE_V",
"SUB SERVICE"."SUB_SERVICE_DESC_V" AS "SUB_SERVICE_DESC_V",
"SUB SERVICE"."IDENTIFIED_BY_V" AS "IDENTIFIED_BY_V",
"SUB SERVICE"."START_DATE_D" AS "START_DATE_D",
"INSTALLATION ADDRESS"."INS_ADDRESS" AS "INS_ADDRESS",
"INSTALLATION ADDRESS"."ADDRESS_TYPE_N" AS "ADDRESS_TYPE_N",
"AREA DETAILS"."AREA" AS "AREA",
"AREA DETAILS"."EXCHANGE" AS "EXCHANGE",
"AREA DETAILS"."MDF" AS "MDF",
"AREA DETAILS
"."AREA_ENGINEER" AS "AREA_ENGINEER",
"AREA DETAILS"."AREA_ENGINEER_CONN" AS "AREA_ENGINEER_CONN"
FROM "CBSOGG"."TT_TICKETINFO" "TT_TICKETINFO"
--WHERE "TT_TICKETINFO"."DOCKET_NUMBER_N" not in (select ticket_no from BIREPORT.TB_MT_TT_PEND_HIST_UNQ)
INNER JOIN (
select tt.docket_number_n,
(SELECT A3.category_description_v
FROM tt_category_master A3
WHERE A3.category_code_v = (SELECT A2.parent_category_code_v
FROM
tt_category_master A2
WHERE A2.category_code_v =
(SELECT t1.subcategory_id_v
FROM
tt_ticketinfo t1
WHERE
t1.docket_number_n = tt.docket_number_n))
AND A3.parent_category_code_v <> '0')
Complaint_type,
(SELECT DISTINCT A1.category_description_v
FROM tt_category_master A1
WHERE A1.category_code_v = tt.subcategory_id_v)
SubComplaint_type,
(SELECT DISTINCT cm.category_description_v
FROM tt_category_master cm
WHERE cm.category_code_v = tt.category_id_v
AND cm.category_type_v = tt.ticket_type_v
AND cm.parent_category_code_v = '0')
Category_desc,
(SELECT DISTINCT cm.Service_code_v
FROM tt_category_master cm
WHERE cm.category_code_v = tt.category_id_v
)
SERVICE_NAME
from t
t_ticketinfo tt
) "COMPLAINT TYPE" ON ("TT_TICKETINFO"."DOCKET_NUMBER_N" = "COMPLAINT TYPE"."DOCKET_NUMBER_N")
LEFT JOIN (
select * from wf_workflow
WHERE START_DT_D = ( SELECT MAX(START_DT_D) FROM wf_workflow WF
WHERE WF.EVENT_REFNO_V = EVENT_REFNO_V)
) "WORKFLOW" ON ("TT_TICKETINFO"."DOCKET_NUMBER_N" = "WORKFLOW"."EVENT_REFNO_V")
LEFT JOIN (
SELECT WORK_ID_N, STATUS_V, EVENT_REFNO_V, USER_ID_N, ACTIVITY_NAME_V, WORK_COMPLETION_DT_D, ASSIGNMENT_DT_D, EXPIRY_TIME_D FROM WF_TODOITEM
WHERE ACTIVITY_NAME_V IS NULL
AND ASSIGNMENT_DT_D = (SELECT MAX(A.ASSIGNMENT_DT_D) FROM WF_TODOITEM A
WHERE EVENT_REFNO_V = A.EVENT_REFNO_V)
--AND docket_number_n not in (select ticket_no from BIREPORT.TB_MT_TT_PEND_HIST_UNQ)
UNION
SELECT WORK_ID_N, STATUS_V, EVENT_REFNO_V, USER_ID_N, ACTIVITY_NAME_V, WORK_COMPLETION_DT_D, ASSIGNMENT_DT_D, EXPIRY_TIME_D FROM WF_TODOITEM_HISTORY
WH
ERE ACTIVITY_NAME_V IS NULL
AND ASSIGNMENT_DT_D = (SELECT MAX(A.ASSIGNMENT_DT_D) FROM WF_TODOITEM_HISTORY A
WHERE EVENT_REFNO_V = A.EVENT_REFNO_V)
--and docket_number_n not in (select ticket_no from BIREPORT.TB_MT_TT_PEND_HIST_UNQ)
ORDER BY EVENT_REFNO_V
) "TODOITEM/HISTORY" ON ("WORKFLOW"."EVENT_REFNO_V" = "TODOITEM/HISTORY"."EVENT_REFNO_V")
LEFT JOIN (
SELECT *
FROM TB_MT_TT_SERV_DET
) "Customer Service Details" ON (to_char("TT_TICKETINFO"."ENTITY_ID_N") = "Customer Service Details"."SERVICE_INFO_V")
LEFT JOIN (
SELECT *
FROM TB_TT_INC_MOBI a
where
a.INCIDENT_TIMESTAMP_D = (select max(INCIDENT_TIMESTAMP_D)
from TB_TT_INC_MOBI b
where a.DOCKET_NUMBER_N = b.DOCKET_NUMBER_N)
) "TICKET INCIDENT MOBI" ON ("TT_TICKETINFO"."DOCKET_NUMBER_N" = "TICKET INCIDENT MOBI"."DOCKET_NUMBER_N")
LEFT JOIN (
select * from cb
sogg.cb_sub_services
) "SUB SERVICE" ON (("Customer Service Details"."SERVICE_CODE_V" = "SUB SERVICE"."SERVICE_CODE_V") AND ("Customer Service Details"."SUB_SERVICE_CODE_V" = "SUB SERVICE"."SUB_SERVICE_CODE_V"))
LEFT JOIN (
select EXTRACTVALUE(CAX.address_x, '//@STREET_DESC')||' '||EXTRACTVALUE(CAX.address_x, '//@CITY_DESC')||' '||EXTRACTVALUE(CAX.address_x, '//@SUB_LOCALITY_DESC')
INS_ADDRESS,
CAX.account_link_code_n , CAX.ADDRESS_TYPE_N
from cbsogg.CB_ADDRESS_XML CAX
where CAX.ADDRESS_TYPE_N ='4'
) "INSTALLATION ADDRESS" ON ("Customer Service Details"."ACCOUNT_LINK_CODE_N" = "INSTALLATION ADDRESS"."ACCOUNT_LINK_CODE_N")
LEFT JOIN (
select * from area_details
) "AREA DETAILS" ON ("Customer Service Details"."LOC_ZONE" = "AREA DETAILS"."MDF")
WHERE "TT_TICKETINFO"."DOC
KET_NUMBER_N" not in (select distinct ticket_no from BIREPORT.TB_MT_TT_PEND_HIST_NEW)
ORDER BY "TT_TICKETINFO"."DOCKET_NUMBER_N"
|
42npsww0tc3ks | CREATE TABLE CBS_ORD |
47r1y8yn34jmj | select default$ from col$ where rowid=:1 |
4kvhga64b6wah |
WITH binds as
(select :dbid as dbid
, :inst_id_low as instIdLow
, :inst_id_high as instIdHigh
, :begin_snap as beginSnap
, :end_snap as endSnap
, :begin_time as beginTime
, :end_time as endTime
, :disk_begin_time as diskBeginTime
, :disk_end_time as diskEndTime
, :mem_begin_time as memBeginTime
, :mem_end_time as memEndTime
, :bucket_count as bucketCount
, :bucket_interval as bucketInterval
, :mem_enable as memEnable
, :disk_enable as diskEnable
, :disk_filter_ratio as filterRatio, :filter_action as filter_action, :filter_blocking_session as filter_blocking_session, :filter_capture_id
as filter_capture_id, :filter_client_id as filter_client_id, :filter_consumer_group_id as filter_consumer_group_id, :filter_dbop as filter_dbop, :filter_ecid as filter_ecid, :filter_event as filter_event, :filter_instance_number as filter_instance_number, :filter_is_captured as filter_is_captured, :filter_is_filtered_out as filter_is_filtered_out, :filter_is_nc_background as filter_is_nc_background, :filter_is_replayed as filter_is_replayed, :filter_machine as filter_machine, :filter_machine_port as filter_machine_port, :filter_module as filter_module, :filter_object as filter_object, :filter_pdb as filter_pdb, :filter_physical_session as filter_physical_session, :filter_pl_sql as filter_pl_sql, :filter_pl_sql_top as filter_pl_sql_top, :filter_program as filter_program, :filter_px_process as filter_px_process, :filter_service_hash as filter_service_hash, :filter_session_type as filter_session_type, :filter_sql_fms as filter_sql_fms, :filter_sql_id_top as filter
_sql_id_top, :filter_sql_opcode as filter_sql_opcode, :filter_sql_opcode_top as filter_sql_opcode_top, :filter_sql_rws as filter_sql_rws, :filter_sql_rws_line as filter_sql_rws_line, :filter_sqlid as filter_sqlid, :filter_sqlid_fullphv as filter_sqlid_fullphv, :filter_sqlid_phv as filter_sqlid_phv, :filter_user_id as filter_user_id, :filter_wait_class as filter_wait_class, :filter_xid as filter_xid from dual) , unified_ash as
(SELECT a.sample_id
, a.sample_time
, a.session_id
, a.session_serial#
, a.session_type
, a.session_state
, a.flags
, a.user_id
, a.sql_id
, a.sql_opcode
, a.sql_opname
, a.top_level_sql_id
, a.top_level_sql_opcode
, a.sql_child_number
, a.sql_plan_hash_value
, a.sql_full_plan_hash_value
, a.sql_plan_line_id
, a.sql_plan_operation
, a.sql_plan_options
, a.sql_exec_id
, a.force_
matching_signature
, a.plsql_entry_object_id
, a.plsql_entry_subprogram_id
, a.plsql_object_id
, a.plsql_subprogram_id
, a.service_hash
, a.qc_session_id
, a.qc_instance_id
, a.qc_session_serial#
, nvl(a.event,
CASE WHEN bitand(a.time_model, power(2, 19)) > 0
THEN 'CPU: IM Populate'
WHEN bitand(a.time_model, power(2, 20)) > 0
THEN 'CPU: IM Prepopulate'
WHEN bitand(a.time_model, power(2, 21)) > 0
THEN 'CPU: IM Repopulate'
WHEN bitand(a.time_model, power(2, 22)) > 0
THEN 'CPU: IM Trickle Repop'
WHEN bitand(a.time_model, power(2, 18)) > 0
THEN 'CPU: IM Query'
ELSE 'CPU + Wait for CPU' END) as event
, nvl(a.event_id, 1)
as event_id
, nvl(a.wait_class, 'CPU')
as wait_class
, nvl(a.wait_class_id, 9999)
as wait_class_id
, a.seq#
, a.p1
, a.p1text
, a.p2
, a.p2text
, a.p3
, a.p3text
, a.wait_time
, a.time_waited
, rawtohex(a.xid) as xid
, a.blocking_session
, a.blocking_session_serial#
, a.blocking_session_status
, a.blocking_inst_id
, a.current_obj#
, a.current_file#
, a.current_block#
, a.top_level_call#
, a.top_level_call_name
, a.program
, a.module
, a.action
, a.client_id
, a.remote_instance#
, a.ecid
, a.consumer_group_id
, a.machine
, a.port
, a.in_connection_mgmt
, a.in_parse
, a.in_hard_parse
, a.in_sql_execution
, a.in_plsql_execution
, a.in_plsql_rpc
, a.in_plsql_compilation
, a.in_java_execution
, a.in_bind
, a.in_cursor_close
, a.in_sequence_load
, a.is_captured
, a.is_replayed
, a.dbreplay_file_id
, a.dbop_name
, a.con_dbid, decode(binds.diskEnable, 0, 1, binds.filterRatio)
as sample_count
, inst_id as instance_number
FROM gv$active_session_history a, binds
WHERE binds.memEnable = 1
AND ( binds.diskEnable = 0
OR ( binds.diskEnable = 1
AND a.is_awr_sample = 'Y'
AND bitand(a.flags, 128) = 0 ) )
AND a.inst_id between
binds.instIdLow
and binds.instIdHigh
AND a.sample_time between
binds.beginTime
and binds.endTime
UNION ALL
SELECT a.sample_id
, a.sample_time
, a.session_id
, a.
session_serial#
, a.session_type
, a.session_state
, a.flags
, a.user_id
, a.sql_id
, a.sql_opcode
, a.sql_opname
, a.top_level_sql_id
, a.top_level_sql_opcode
, a.sql_child_number
, a.sql_plan_hash_value
, a.sql_full_plan_hash_value
, a.sql_plan_line_id
, a.sql_plan_operation
, a.sql_plan_options
, a.sql_exec_id
, a.force_matching_signature
, a.plsql_entry_object_id
, a.plsql_entry_subprogram_id
, a.plsql_object_id
, a.plsql_subprogram_id
, a.service_hash
, a.qc_session_id
, a.qc_instance_id
, a.qc_session_serial#
, nvl(a.event,
CASE WHEN bitand(a.time_model, power(2, 19)) > 0
THEN 'CPU: IM Populate'
WHEN bitand(a.time_model, power(2, 20)) > 0
THEN 'CPU: IM Prepopulate'
WHEN bitand(a
.time_model, power(2, 21)) > 0
THEN 'CPU: IM Repopulate'
WHEN bitand(a.time_model, power(2, 22)) > 0
THEN 'CPU: IM Trickle Repop'
WHEN bitand(a.time_model, power(2, 18)) > 0
THEN 'CPU: IM Query'
ELSE 'CPU + Wait for CPU' END) as event
, nvl(a.event_id, 1)
as event_id
, nvl(a.wait_class, 'CPU')
as wait_class
, nvl(a.wait_class_id, 9999)
as wait_class_id
, a.seq#
, a.p1
, a.p1text
, a.p2
, a.p2text
, a.p3
, a.p3text
, a.wait_time
, a.time_waited
, rawtohex(a.xid) as xid
, a.blocking_session
, a.blocking_session_serial#
, a.blocking_session_status
, a.blocking_inst_id
, a.current_obj#
, a.current_file#
, a.current_block#
, a.top_level_call#
, a.top_level_call_name
, a.program
, a.module
, a.action
, a.client_id
, a.remote_instance#
, a.ecid
, a.consumer_group_id
, a.machine
, a.port
, a.in_connection_mgmt
, a.in_parse
, a.in_hard_parse
, a.in_sql_execution
, a.in_plsql_execution
, a.in_plsql_rpc
, a.in_plsql_compilation
, a.in_java_execution
, a.in_bind
, a.in_cursor_close
, a.in_sequence_load
, a.is_captured
, a.is_replayed
, a.dbreplay_file_id
, a.dbop_name
, a.con_dbid, binds.filterRatio as sample_count
, instance_number as instance_number
FROM dba_hist_active_sess_history a, binds
WHERE binds.diskEnable = 1
AND a.dbid = binds.dbid
AND a.instance_number between
binds.instIdLow
and binds.instIdHigh
AND a.snap_id between
binds.beginSnap
and binds.endSnap
AND a.sample_time between
binds.beginTime
and binds.endTime
), logical_ash as
(select sample_id
, sample_time
, sample_count
, instance_number as inst_id, wait_class as global_hist_wc, event as event, instance_number || ':' || session_id || ', ' || session_serial# as physical_session, sql_id as sqlid, wait_class as wait_class, xid as xid, instance_number as instance_number, user_id as user_id, program as program from unified_ash) , bucketized_ash as
(SELECT ash0.*,
(case when binds.bucketCount > 1
then trunc( ( (24 * 60 * 60 *
extract(day from sample_time
- binds.beginTime))
+ (60 * 60 *
extract(hour from sample_time
- binds.beginTime))
+ (60 *
extract(minute from sample_time
- binds.beginTime))
+ (1 *
extract(second from sample_time
- binds.beginTime))
) / binds.bucketInterval
) + 1
else 1
end) as bucket_number
FROM logical_ash ash0, binds), filter_xml as
(SELECT xmlconcat(xmlelement("filters" )
, xmlelement("report_time", xmlattributes(
to_char(o.begintime, 'HH24:MI:SS MM/DD/YYYY') as "begin_time",
to_char(o.endtime, 'HH24:MI:SS MM/DD/YYYY') as "end_time"))) as xml_frag FROM
(select binds.*, nvl(to_number(filter_pdb), 0) as con_dbid from binds) o) , filtered_ash as
(SELECT ash.*,
(case when 1=1 then 1 else 0 end) filtered
FROM bucketized_ash ash, binds), grouped_ash as
(SELECT ash.*, (CASE WHEN nvl(filtered, 2) = 1
THEN 0 -- target / no histogram
ELSE 1 -- totals/global
END) AS bucket_type FROM (SELECT filtered, event, physical_session, sqlid, wait_class, bucket_number , grouping_id(filtered, event, physical_session, sqlid, wait_class, bucket_number) as gid , global_hist_wc , max(inst_id) as inst_id
, sum(sample_cou
nt) as sample_count
, count(distinct sqlid) as uniq_sqlids
, count(distinct xid) as uniq_xids
, count(distinct physical_session)
as uniq_sessions
, count(distinct instance_number)
as uniq_instances, max(user_id) as user_id, max(program) as program from filtered_ash
group by grouping sets( (bucket_number, global_hist_wc) , ( bucket_number, wait_class, filtered), (wait_class, filtered), (sqlid, wait_class, filtered), (physical_session, wait_class, filtered), (wait_class, event, filtered)) ) ash -- eliminate rows with filtered = 0
-- keep filtered and from global/total
WHERE (nvl(filtered, 2) != 0)), component_1_treemap as
(select dim_val
, inst_id
, sample_count
, num_mem
, mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, 0 AS bucket_type --target(not global)/filtered bucket
from (select max(case when mem_rank <= 13
then dim_val
else null
end) as dim_val
, sum(sample_count) as sample_count
, count(*) as num_mem
, max(case when mem_rank <= 13
then mem_rank
else (13 + 1)
end) as mem_rank
, max(case when mem_rank <= 13
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when mem_rank <= 13
then uniq_xids
else 0
end) as uniq_xids
, max(case when mem_rank <= 13
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when mem_rank <= 13
then uniq_instances
else 0
end) as uniq_instances
, max(inst_id)
as inst_id
from (select wait_class as dim_val
, sample_count
, dense_rank() over
(order by sample_count desc
, wait_class) as mem_rank
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 29
and wait_class is not null)
group by (case when mem_rank <= 13
then dim_val
else null
end)
) left ) , component_1_histogram as
(select bucket_number
, sum(sample_count) as sample_count
, max(case when mem_rank <= 13
then mem_rank
when mem_rank is not null
then (13 + 1)
end) as mem_rank
, bucket_type
from (select g1.bucket_number
, g1.sample_count as sample_count
, (case when g1.wait_class = g2.dim_val
then to_char(g2.dim_val)
-- global/totals
when g1.bucket_type = 1
then g1.global_hist_wc
else null
end) as dim_val
, (case when g1.wait_class = g2.dim_val
then g2.mem_rank
when g1.bucket_type = 1 then NULL
else (13 + 1)
end) as mem_rank
, g1.bucket_type
from grouped_ash g1,
component_1_treemap g2
where -- both filtered and global
(g1.gid = 28 AND
g1.wait_class is not null OR
g1.bucket_type = 1)
and g1.wait_class =
g2.dim_val(+)
-- join filtered rows only
and g1.bucket_type = g2.bucket_type(+)
)
group by bucket_number
, dim_val
, bucket_type
) , component_1_xml as
(select xmlelement("item"
, xmlattributes('wait_class' as "id"
, topmems.cnt_all as "count"
, topmems.num_mem as "num_mem"
, topmems.num_others as "num_others") , xmlconcat(
topmems.topmems_frag
, histogram.histogram_xml)) as dim_frag from (select xmlelement(
"top_mems"
, xmlatt
ributes(sum(case when mem_rank <= 13
then sample_count
else 0
end) as "count")
, xmlagg(xmlelement(
"mem"
, xmlattributes(mem_rank as "id"
, dim_val as "name"
, sample_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances")
)
order by sample_count desc))
as topmems_frag
, sum(case when mem_rank <= 13
then 1
else 0
end) as num_mem
, sum(sample_count) as cnt_all
, max(case when mem_rank <= 13
then 0
else num_mem
end) as num_others
from (component_1_treemap) t
) topmems , (SELECT xmlagg(
xmlelement(
"histogram"
, xm
lattributes(
(case when bucket_type = 1 then 'all'
else 'target'
end) AS "type"
, max(binds.bucketCount) as "bucket_count"
, max(binds.bucketInterval) as "bucket_interval")
, xmlagg(bucket_xml
order by
bucket_type,
bucket_number asc)
)
) as histogram_xml
FROM (SELECT bucket_type
, bucket_number
, xmlelement(
"bucket"
, xmlattributes(bucket_number as "number"
, sum(sample_count) as "c
ount")
, (case
when bucket_type = 0 then -- filtered rows
xmlelement(
"top_mems"
, xmlattributes(
sum(case when mem_rank <= 13
then sample_count
else 0
end) as "count")
, xmlagg(
xmlelement(
"mem"
, xmlattributes(
mem_rank as "id"
, sample_count as "count"))
order by mem_rank asc))
end))
as bucket_xml
FROM (component_1_histogram)
GROUP BY bucket_number, bucket_type), binds
GROUP by bucket_type) histogram ), component_2_xml as
(select xmlelement(
"item"
, xmlattributes(
'sqlid, wait_class' as "item")
, xmlelement(
"top_mems"
, xmlagg(
xmlelement(
"mem"
, xmlattributes(
dim1_value as "dim1_value"
, dim1_nummem as "dim1_nummem"
, dim1_rank as "dim1_rank"
, dim2_value as
"dim2_value"
, dim12_nummem as "dim2_nummem"
, dim12_rank as "dim2_rank"
, dim12_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances"
)
, NVL2(sql_text1,
xmlelement("info"
, xmlattributes('dim1_name' as "type")
, sql_text1), NULL)
, NVL2(NULL,
xmlelement("info"
, xmlattributes('dim2_name' as "type")
, NULL), NULL)
)
order by dim1_rank, dim12_rank
)
)
) as dim_frag
from
(select dim_data.*
, NVL((SELECT substr(v.sql_text, 1, 100) as sql_text
FROM gv$sql v
WHERE v.sql_id = dim_data.dim1_value
AND v.inst_id = dim_data.inst_id
AND rownum < 2 ), ( SELECT dbms_lob.substr(v.sql_text, 100, 1) as sql_text
FROM dba_hist_sqltext v, binds b
WHERE v.dbid = b.dbid
AND v.sql_id = dim_data.dim1_value
AND rownum < 2)) as sql_text1
from (select
max(case when dim1_rank <= 10
then dim1_val
else null
end) as dim1_value
, max(case when dim1_rank <= 10
then dim2_val
else null
end) as dim2_value
, sum(dim12_count) as dim12_count
, max(case when dim1_rank <= 10
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when dim1_rank <= 10
then uniq_xids
else 0
end) as uniq_xids
, max(case when dim1_rank <= 10
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when dim1_rank <= 10
then uniq_instances
else 0
end) as uniq_instances
, count(distinct dim1_val) as dim1_nummem
, sum(dim12_nummem) as dim12_nummem
, max(case when dim1_rank <= 10
then dim1_rank
else (10 + 1)
end) as dim1_rank
, max(case when dim1_rank <= 10
then dim12_rank
else (10 + 1)
end) as dim12_rank
, max(inst_id) as inst_id
from (select dim1_val
, max(case when dim12_rank <= 13
then dim2_val
else null
end) as dim2_val
, dim1_count
, sum(dim12_count) as dim12_count
, max(case when dim12_rank <= 13
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when dim12_rank <= 13
then uniq_xids
else 0
end) as uniq_xids
, max(case when dim12_rank <= 13
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when dim12_rank <= 13
then uniq_instances
else 0
end) as uniq_instances
, count(*) as dim12_nummem
, dense_rank() over
(order by dim1_count desc
, dim1_val
) as dim1_rank
, max(case when dim12_rank <= 13
then dim12_rank
else (13 + 1)
end) as dim12_rank
, max(inst_id) as inst_id
from (select sqlid as dim1_val
, wait_class as dim2_val
, sample_count as dim12_count
, dense_rank() over
(partition by sqlid
order by sample_count desc
, wait_class
) as dim12_rank
, sum(sample_count) over
(partition by sqlid
) as dim1_count
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 25
and sqlid is not null
and wait_class is not null )
group by dim1_val
, dim1_count
, (case when dim12_rank <= 13
then dim2_val
else null
end)
)
group by (case when dim1_rank <= 10
then dim1_val
else null
end)
, (case when dim1_rank <= 10
then dim2_val
else null
end)
) dim_data
) t
), component_3_xml as
(select xmlelement(
"item"
, xmlattributes(
'physical_session, wait_class' as "item")
, xmlelement(
"top_mems"
, xmlagg(
xmlelement(
"mem"
, xmlattributes(
dim1_value as "dim1_value"
, dim1_nummem as "dim1_nummem"
, dim1_rank as "dim1_rank"
, dim2_value as "dim2_value"
, dim12_nummem as "dim2_nummem"
, dim12_rank as "dim2_rank"
, dim12_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances"
)
, NVL2(NULL,
xmlelement("info"
, xmlattributes('dim1_name' as "type")
, NULL), NULL)
, NVL2(NULL,
xmlelement("info"
, xmlattributes('dim2_name' as "type")
, NULL), NULL)
)
order
by dim1_rank, dim12_rank
)
)
) as dim_frag
from
(select dim_data.*
from (select
max(case when dim1_rank <= 10
then dim1_val
else null
end) as dim1_value
, max(case when dim1_rank <= 10
then dim2_val
else null
end) as dim2_value
, sum(dim12_count) as dim12_count
, max(case when dim1_rank <= 10
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when dim1_rank <= 10
then uniq_xids
else 0
end) as uniq_xids
, max(case when dim1_rank <= 10
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when dim1_rank <= 10
then uniq_instances
else 0
end) as uniq_instances
, count(distinct dim1_val) as dim1_nummem
, sum(dim12_nummem) as dim12_nummem
, max(case when dim1_rank <= 10
then dim1_rank
else (10 + 1)
end) as dim1_rank
, max(case when dim1_rank <= 10
then dim12_rank
else (10 + 1)
end) as dim12_rank
, max(inst_id) as inst_id
from (select dim1_val
, max(case when dim12_rank <= 13
then dim2_val
else null
end) as dim2_val
, dim1_count
, sum(dim12_count) as dim12_count
, max(case when dim12_ran
k <= 13
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when dim12_rank <= 13
then uniq_xids
else 0
end) as uniq_xids
, max(case when dim12_rank <= 13
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when dim12_rank <= 13
then uniq_instances
else 0
end) as uniq_ins
tances
, count(*) as dim12_nummem
, dense_rank() over
(order by dim1_count desc
, dim1_val
) as dim1_rank
, max(case when dim12_rank <= 13
then dim12_rank
else (13 + 1)
end) as dim12_rank
, max(inst_id) as inst_id
from (select physical_session as dim1_val
, wait_class as dim2_val
, sample_count as dim12_count
, dense_rank() over
(partition by physical_session
order by sample_count desc
, wait_class
) as dim12_rank
, sum(sample_count) over
(partition by physical_session
) as dim1_count
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 21
and physical_session is not null
and wait_class is not null )
group by dim1_val
, dim1_count
, (case when dim12_rank <= 13
then dim2_val
else null
end)
)
group by (case when dim1_rank <= 10
then dim1_val
else null
end)
, (case when dim1_rank <= 10
then dim2_val
else null
end)
) dim_data
) t
), component_4_xml as
(select xmlelement(
"item"
, xmlattributes(
'wait_class, event' as "item")
, xmlelement(
"top_mems"
, xmlagg(
xmlelement(
"mem"
, xmlattributes(
dim1_value as "dim1_value"
, dim1_nummem as "dim1_nummem"
, dim1_rank as "dim1_rank"
, dim2_value as "dim2_value
"
, dim12_nummem as "dim2_nummem"
, dim12_rank as "dim2_rank"
, dim12_count as "count"
, uniq_sqlids as "uniq_sqlids"
, uniq_xids as "uniq_xids"
, uniq_sessions as "uniq_sessions"
, uniq_instances as "uniq_instances"
)
, NVL2(NULL,
xmlelement("info"
, xmlattributes('dim1_name' as "type")
, NULL), NULL)
, NVL2(NULL,
xmlelement("info"
, xmlattributes('dim2_name' as "type")
, NULL), NULL)
)
order by dim1_rank, dim12_rank
)
)
) as dim_frag
from
(select dim_data.*
from (select
max(case when dim1_rank <= 13
then dim1_val
else null
end) as dim1_value
, max(case when dim1_rank <= 13
then dim2_val
else null
end)
as dim2_value
, sum(dim12_count) as dim12_count
, max(case when dim1_rank <= 13
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when dim1_rank <= 13
then uniq_xids
else 0
end) as uniq_xids
, max(case when dim1_rank <= 13
then uniq_sessions
else 0
end) as uniq_sessions
, max(case when dim1_rank <= 13
then uniq_instances
else 0
end) as uniq_instances
, count(distinct dim1_val) as dim1_nummem
, sum(dim12_nummem) as dim12_nummem
, max(case when dim1_rank <= 13
then dim1_rank
else (13 + 1)
end) as dim1_rank
, max(case when dim1_rank <= 13
then dim12_rank
else (13 + 1)
end) as dim12_rank
, max(inst_id) as inst_id
from (select dim1_val
, max(case when dim12_rank <= 10
then dim2_val
else null
end) as dim2_val
, dim1_count
, sum(dim12_count) as dim12_count
, max(case when dim12_rank <= 10
then uniq_sqlids
else 0
end) as uniq_sqlids
, max(case when dim12_rank <= 10
then uniq_xids
else 0
end) as uniq_xids
, max(case when dim12_rank <= 10
then uniq_sessions
else 0
end) as uniq
_sessions
, max(case when dim12_rank <= 10
then uniq_instances
else 0
end) as uniq_instances
, count(*) as dim12_nummem
, dense_rank() over
(order by dim1_count desc
, dim1_val
) as dim1_rank
, max(case when dim12_rank <= 10
then dim12_rank
else (10 + 1)
end) as dim12_rank
, max(inst_id) as inst_id
from (sele
ct wait_class as dim1_val
, event as dim2_val
, sample_count as dim12_count
, dense_rank() over
(partition by wait_class
order by sample_count desc
, event
) as dim12_rank
, sum(sample_count) over
(partition by wait_class
) as dim1_count
, uniq_sqlids
, uniq_xids
, uniq_sessions
, uniq_instances
, inst_id
from grouped_ash
where gid = 13
and wait_class is not null
and event is not null )
group by dim1_val
, dim1_count
, (case when dim12_rank <= 10
then dim2_val
else null
end)
)
group by (case when dim1_rank <= 13
th
en dim1_val
else null
end)
, (case when dim1_rank <= 13
then dim2_val
else null
end)
) dim_data
) t
)select xmlconcat((select xml_frag from filter_xml),
xmlelement("dim_list",
xmlconcat((select dim_frag from component_1_xml), (select dim_frag from component_2_xml), (select dim_frag from component_3_xml), (select dim_frag from component_4_xml)))
) from dual |
4sz71uuntd828 | UPDATE SYSTEM.LOGMNR_OBJ$ X SET X.OBJ# = :B7 , X.TYPE# = :B6 , X.STIME = :B5 , X.FLAGS = :B4 , X.OID$ = :B3 , X.OBJV# = :B2, X.SPARE3 = :B1 WHERE X.ROWID = (SELECT Z.DEST_ROWID FROM SYSTEM.LOGMNRT_MDDL$ Z WHERE Z.SOURCE_OBJ# = :B9 AND Z.SOURCE_ROWID = :B8 ) |
4t4krwb55gsms |
INSERT /*+ restrict_all_ref_cons */ INTO "CBSOGG"."FXL_RATED_CDRS" ("TYPE_OF_CALL_V", "SWITCH_CALL_TYPE_V", "RECORD_TYPE_V", "PROMOTION_CODE_V", "IN_OUT_V", "TARF_TYPE_V", "CALL_CHRG_TYPE_V", "FAX_DATA_VOICE_V", "CALC_ON_V", "PERCENTAGE_VAL_N", "INTERIM_CALL_INDICATOR_V", "CALL_SEQ_NUM_N", "ACCOUNT_LINK_CODE_N", "CHRONO_NUM_N", "CALL_DATE_DT", "CALL_DURATION_N", "SUMMARY_SEQ_NUM_N", "ARTICLE_CODE_V", "NETWORK_ELEMENT_V", "TELEPHONE_NUMBER_V", "MSC_NUM_V", "IN_TRUNK_V", "OUT_TRUNK_V", "CALLED_CALLING_NUM_V", "ACTUAL_NUM_IF_FRWD_V", "DIALED_DIGIT_V", "ICSRV_PROVIDER_CODE_V", "IC_RATE_ZONE_V", "IC_CONCT_ZONE_V", "COUNTRY_CODE_V", "STATE_CODE_V", "CITY_CODE_V
", "TARIFF_CODE_V", "RATING_FILE_ID_N", "DAY_CODE_V", "TIME_BAND_V", "IC_RATE_PLAN_CODE_N", "IC_VOICE_FRML_N", "IC_VOICE_UNIT_RATE_N", "IC_UNITS_N", "IC_VOICE_AMT_N", "IC_TAX_CODE_V", "IC_TAX_AMT1_N", "IC_TAX_AMT2_N", "IC_TAX_AMT3_N", "ORIG_LOCATION_ZONE_CODE_V", "TERM_LOCATION_ZONE_CODE_V", "RATING_ZONE_CODE_V", "CALL_TYPE_FLAG_V", "OPERATOR_ASST_CALL_FRML_N", "OPERATOR_ASST_AMT_N", "AIRTM_RATE_PLAN_CODE_N", "AIRTM_FRML_N", "AIRTM_VOICE_UNIT_RATE_N", "AIRTM_VOICE_UNITS_N", "AIRTM_AMT_N", "AIRTM_TAX_CODE_V", "AIRTM_TAX_AMT1_N", "AIRTM_TAX_AMT2_N", "AIRTM_TAX_AMT3_N", "RATE_ON_V", "DISC_TYPE_V", "DISC_UNITS_N", "DESTINATION_TYPE_V", "DEST_SERVICE_TYPE_CODE_V
", "CHARGED_DURATION_N", "DISC_QTM_TYPE_V", "DISCOUNTED_VALUE_N", "DISCOUNTED_AMOUNT_N", "OUTPUT_DISC_ARTICLE_V", "CHARGE_BEFORE_DISC_N", "PROCESSED_DATE_D", "SUB_SERVICE_CODE_V", "BILL_CYCL_FULL_CODE_N", "EXTN_NUMBER_V", "ACCOUNT_CODE_N", "OMR_N", "CMR_N", "INFLATION_FLAG", "INFLATED_AMOUNT_N", "OMR_DATE_D", "DISC_CODE_V", "EXTERNAL_SWITCH_CODE_V", "SWITCH_CODE_V", "INTERCONNECTION_TYPE_V", "OPERATOR_AUTOMATIC_V", "USAGE_RECORD_V", "CALLING_NO_AREA_CODE_V", "CALLED_NO_AREA_CODE_V", "PAYING_THIRD_PARTY_NO_V", "SWITCH_SERVICE_CODE_V", "SEQ_NUM_V", "TAXABLE_FLAG_N", "MSG_TYPE_N") VALUES (:1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 ,
:17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 , :89 , :90 , :91 , :92 , :93 , :94 ) |
4yh0w358z9gvt |
SELECT "Custom SQL Query"."ACCOUNT_CODE_N" AS "ACCOUNT_CODE_N",
"Custom SQL Query"."ACCOUNT_NAME_V" AS "ACCOUNT_NAME_V",
"Custom SQL Query"."BANK_ACC_NO" AS "BANK_ACC_NO",
"Custom SQL Query"."BANK_NAME" AS "BANK_NAME",
"Custom SQL Query"."CUSTOMER_ID" AS "CUSTOMER_ID",
(CASE WHEN ("Custom SQL Query"."BANK_CODE_V" = 'FC') THEN N'Foreign Customers' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'HID') THEN N'HDM Interactive DD' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CME') THEN N'Carte American Exp' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'TLS') THEN N'Teleservices DD' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CPD') THEN N'Cellplus DD' ELSE NULL END) AS "Calculation_607704519170035712",
"Custom SQL Query".
"SERVICE_INFO_V" AS "SERVICE_INFO_V",
"Custom SQL Query"."SUBSCRIBER_NAME" AS "SUBSCRIBER_NAME",
SUM("Custom SQL Query"."DDEBIT_AMOUNT") AS "sum:DDEBIT_AMOUNT:ok"
FROM (
select
asl.service_info_v,
c.trans_num_v,
b.PERIOD_V,
d.account_type_v,
c.invoice_generated_on_d,
a.BANK_CODE_V, a.BRANCH_CODE_V,
a.CARD#ACCOUNT_NUMBER_V BANK_ACC_NO,
a.CARD#ACC_HOLDER_NAME_V BANK_NAME,
sum(INVOICE_AMT_N)/100 INVOICE_AMT,
sum(INVOICE_TAX_N)/100 INVOICE_TAX_AMT,
sum(INV_AMT_CLEARED_N)/100 INVOICE_AMT_CLEARED,
sum(ADJUSTMENT_AMT_N)/100 INVOICE_ADJUST_AMT,
sum(b.AMOUNT_N)/100 DDEBIT_AMOUNT,
d.account_name_v,
d.account_code_n,
e.ext_subscriber_code_v Customer_id,
e.first_name_v||' ' ||e.last_name_v Subscriber_name
from cbsogg.cb_auto_debit a,
tmp_auto_debit_log@cbsstandby b,
cbsogg.cb_invoice c,
cbsogg.cb_account_master d,
cbsogg.c
b_subscriber_master e,
cb_account_service_list asl
where c.account_link_code_n = d.account_link_code_n
and e.ext_subscriber_code_v = asl.ext_subscriber_code_v
and asl.account_code_n = d.account_code_n
and d.subscriber_code_n = e.subscriber_code_n
and a.account_link_code_n = b.account_link_code_n
and asl.sub_service_code_v not in ('FXL-COPER', 'FXL-FIBER')
and b.INVOICE_NUM_V = c.trans_num_v
--and substr(UPPER(a.CARD#ACCOUNT_NUMBER_V), 1, 2) in ('FR', 'FC', 'MT')
and a.ACCOUNT_LINK_CODE_N = c.account_link_code_n
group by
asl.service_info_v,
c.trans_num_v,
b.PERIOD_V,
d.account_type_v,
c.invoice_generated_on_d,
a.BANK_CODE_V, a.BRANCH_CODE_V,
a.CARD#ACCOUNT_NUMBER_V ,
a.CARD#ACC_HOLDER_NAME_V ,
d.account_name_v,
d.account_code_n,
e.ext_subscriber_code_v,
e.first_name_v||' ' ||e.last_name_v
) "Custom SQL Query"
WHERE (((CASE WHEN ("Custom SQL Query"."BANK_CODE_V" = 'FC') THEN N
'Foreign Customers' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'HID') THEN N'HDM Interactive DD' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CME') THEN N'Carte American Exp' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'TLS') THEN N'Teleservices DD' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CPD') THEN N'Cellplus DD' ELSE NULL END) IN (N'Carte American Exp', N'Cellplus DD', N'Foreign Customers', N'HDM Interactive DD', N'Teleservices DD')) AND ("Custom SQL Query"."ACCOUNT_TYPE_V" = 'FXL') AND (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(5) + 1)) IN ('1907A', '1907B', '1907C', '1907D')) AND ((CASE WHEN ((SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'A') OR (SUBSTR("Custom SQL Quer
y"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'B') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'C') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'D') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'M')) THEN SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) ELSE NULL END) >= 'A') AND ((CASE WHEN ((SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'A') OR (SUBSTR(
"Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'B') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'C') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'D') OR (SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) = 'M')) THEN SUBSTR("Custom SQL Query"."TRANS_NUM_V", GREATEST(1, LENGTH("Custom SQL Query"."TRANS_NUM_V") - FLOOR(1) + 1)) ELSE NULL END) <= 'D'))
GROUP BY "Custom SQL Query"."ACCOUNT_CODE_N",
"Custom SQL Query"."ACCOUNT_NAME_V",
"Custom SQL Query"."BANK_
ACC_NO",
"Custom SQL Query"."BANK_NAME",
"Custom SQL Query"."CUSTOMER_ID",
(CASE WHEN ("Custom SQL Query"."BANK_CODE_V" = 'FC') THEN N'Foreign Customers' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'HID') THEN N'HDM Interactive DD' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CME') THEN N'Carte American Exp' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'TLS') THEN N'Teleservices DD' WHEN ("Custom SQL Query"."BANK_CODE_V" = 'CPD') THEN N'Cellplus DD' ELSE NULL END),
"Custom SQL Query"."SERVICE_INFO_V",
"Custom SQL Query"."SUBSCRIBER_NAME" |
528xrg7y3jjrm | create table TB_MT_ |
52k94azm1ak0j | BEGIN generate_order_report; END;
|
5aagfw36gdgdn |
SELECT "A1"."ACCOUNT_CODE_N", "A1"."ACCOUNT_LINK_CODE_N", "A1"."TO_DATE_D", "A2"."ACCOUNT_LINK_CODE_N", "A2"."OFFER_CODE_V", "A2"."START_DATE_D", "A2"."END_DATE_D", "A3"."OFFER_CODE_V", "A3"."DISPLAY_DESCRIPTION_V" FROM "CB_ACCOUNT_SERVICE_LIST" "A1", "CB_SUBS_OFFER_DETAILS" "A2", "CB_OFFERS" "A3" WHERE "A2"."OFFER_CODE_V"="A3"."OFFER_CODE_V" AND "A1"."ACCOUNT_LINK_CODE_N"="A2"."ACCOUNT_LINK_CODE_N" AND SYS_EXTRACT_UTC(NVL("A2"."END_DATE_D", SYSDATE@!))>=SYS_EXTRACT_UTC(CAST(SYSDATE@! AS TIMESTAMP)) AND SYS_EXTRACT_UTC(NVL("A1"."TO_DATE_D", SYSDATE@!))>=SYS_EXTRACT_UTC(CAST(SYSDATE@! AS TIMESTAMP))
|
5mqbcmukamhhb |
SELECT (CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) AS "Calculation_105834620245569536"
FROM (
SELECT DATE_D, LOCATION_CODE_N, ITEM_CODE_N,
sum(nvl(OPENING_QTY_N , 0)) open_qty,
sum(nvl(STOCK_IN_QTY_N , 0)) stock_in,
sum(nvl(STOCK_OUT_QTY_N , 0)) stock_out,
sum(nvl(STOCK_RETURN_QTY_N , 0)) stock_return,
sum(nvl(STOCK_ACCEPTED_QTY
_N , 0)) stock_accept,
sum(nvl(STOCK_WRITE_OFF_QTY_N , 0)) stock_w_off,
sum(nvl(BUNDLED_STOCK_QTY_N , 0)) bund_stk_qty,
sum(nvl(SUBS_SALES_QTY_N , 0)) subs_stk_qty,
sum(nvl(PROS_SALES_QTY_N , 0)) pro_sale,
sum(nvl(DLR_SALES_QTY_N , 0)) dlr_sale,
sum(nvl(STAFF_SALES_QTY_N , 0)) staff_sale,
sum(nvl(GIFT_SALES_QTY_N , 0)) gift_sale,
sum(nvl(SALES_EXCHANGE_QTY_N , 0)) exch_sale,
sum(nvl(CLOSING_STOCK_QTY_N , 0)) close_stk,
sum(nvl(SALES_RETURN_QTY_N , 0)) return_sale,
sum(nvl(ACTIVATION_SALES_QTY_N , 0)) act_sale,
sum(nvl(DECOUPLED_STOCK_QTY_N , 0)) decoup_sale,
sum(nvl(REQUISITION_STK_QTY_N , 0)) req_stk,
sum(nvl(RELEASED_STK_QTY_N , 0)) release_stk,
sum(nvl(CON_ALLOCATED_QTY_N , 0)) con_alloc,
sum(nvl(CON_RETURN_QTY_N , 0)) con_return,
sum(nvl(CON_SALES_QTY_N , 0)) con_sale,
sum(nvl(CON_RELEASE_STK_QTY_N , 0)) con_release,
sum(nvl(BUND_DEC_QTY_N , 0)) bund_dec,
sum(nvl(BUNDLED_ITEM_QTY_N , 0)) bund_item,
sum(nvl(SAL_CANCEL_QTY_N , 0)) sal_cancel,
sum(nvl(DAMAGED_QTY_N , 0)) damage,
sum(nvl(ADJ_QTY_MORE_N , 0)) adj_qty_more,
sum(nvl(ADJ_QTY_LESS_N , 0)) adj_qty_less,
sum(nvl(UPLOAD_QTY_N , 0)) upload_qty,
sum(nvl(PND_SALES_QTY_N , 0)) pnd_sale,
sum(nvl(ACTUAL_SALES_QTY_N , 0)) actual_sale,
sum(nvl(REL_PND_SALES_QTY_N , 0)) rel_pnd_sale,
sum(nvl(BLOCK_QTY_N , 0)) block_qty,
sum(nvl(REL_BLOCK_QTY_N , 0)) rel_block_qty,
sum(nvl(EXT_BLOCK_QTY_N , 0)) ext_block_qty,
sum(nvl(EXT_REL_BLOCK_QTY_N , 0)) ext_rel_blk_qty,
sum(nvl(INCREASED_EQUIP_RET_N , 0)) incr_equip_ret,
sum(nvl(DECREASED_EQUIP_RET_N , 0)) decr_equip_ret
FROM INV_STOCK_SUMMARY
group by DATE_D, LOCATION_CODE_N, ITEM_CODE_N
) "INV STOCK SUMMARY"
INNER JOIN (
SELECT * FROM CBSOGG.INV_ITEM_MASTER
) "ITEM MASTER" ON ("INV STOCK SUMMARY"."ITEM_CODE_N" = "ITEM MASTER"."ITEM_CODE_N")
WHERE ((((CASE WHEN (("INV
STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) >= '10 MEMORY TRIMLINE WITH DUAL MODE') AND ((CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("I
NV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) <= 'FLYBOX_BUSINESS')) OR (((CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0))
, 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) >= 'FP - MEMORY PHONE EX 29168') AND ((CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) <= 'HUAWEI E398U-15')) OR (((CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (
TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) >= 'HUAWEI GOVA 535') AND ((CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D
" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END) <= 'ZTE WI-FI MODEM H108N')))
GROUP BY (CASE WHEN (("INV STOCK SUMMARY"."OPEN_QTY" > 0) OR ("INV STOCK SUMMARY"."STOCK_IN" > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) = TO_DATE('2017-05-14', 'YYYY-MM-DD')) THEN COALESCE(ROUND(TRUNC("INV STOCK SUMMARY"."OPEN_QTY"), 0), 0) ELSE NULL END) > 0) OR ((CASE WHEN (TRUNC(CAST("INV STOCK SUMMARY"."DATE_D" AS DATE)) <= TO_DATE('2018-02-15', 'YYYY-MM-DD')) THEN ROUND(TRUNC(COALESCE("INV STOCK SUMMARY"."STOCK_IN", 0)), 0) ELSE NULL END) > 0)) THEN "ITEM MASTER"."ITEM_DESC_V" ELSE NULL END)
|
5n1fs4m2n2y0r | select pos#, intcol#, col#, spare1, bo#, spare2, spare3 from icol$ where obj#=:1 |
616m6uhpa2usu | ** SQL Text Not Available ** |
61tn3mam0vq0b |
SELECT source, (case when time_secs < 1 then 1 else time_secs end) as time_secs, operation FROM ( SELECT 1 as source, trunc((sysdate - cast(ll.log_date as date)) * 86400) as time_secs, decode(ll.operation, 'OPEN', 0 , 1 ) as operation, ll.log_id as log_id FROM DBA_SCHEDULER_WINDOW_LOG ll , ( SELECT max(l.log_id) as max_log_id FROM DBA_SCHEDULER_WINDOW_LOG l , DBA_SCHEDULER_WINGROUP_MEMBERS m WHERE l.window_name = m.window_name AND m.window_group_name = 'MAINTENANCE_WINDOW_GROUP' AND l.operation in ('OPEN', 'CLOSE') AND CAST(l.log_date AS DATE) < ( SELECT cast(min(end_interval_time) as date) as btime FROM WRM$_SNAPSHOT bsi WHERE bsi.dbid = :dbid AND bsi.snap_id = :bid
) ) max_log WHERE ll.log_id = max_log.max_log_id UNION ALL SELECT 2 as source, trunc((sysdate - cast(l.log_date as date)) * 86400) as time_secs, decode(l.operation, 'OPEN', 0 , 1 ) as operation, l.log_id as log_id FROM DBA_SCHEDULER_WINDOW_LOG l , DBA_SCHEDULER_WINGROUP_MEMBERS m WHERE l.window_name = m.window_name AND m.window_group_name = 'MAINTENANCE_WINDOW_GROUP' AND l.operation in ('OPEN', 'CLOSE') AND CAST(l.log_date AS DATE) <= ( SELECT cast(max(end_interval_time) as date) as etime FROM WRM$_SNAPSHOT esi WHERE esi.dbid = :dbid AND esi.snap_id = :eid ) AND CAST(l.log_date AS DATE) >= ( SELECT cast(min(end_interval_time) as date) as btime FROM WRM$_
SNAPSHOT bsi WHERE bsi.dbid = :dbid AND bsi.snap_id = :bid ) UNION ALL SELECT 0 as source, trunc((sysdate - et.etime) * 86400) as time_secs, 3 as operation, 0 as log_id FROM ( SELECT cast(max(end_interval_time) as date) as etime FROM WRM$_SNAPSHOT esi WHERE esi.dbid = :dbid AND esi.snap_id = :eid ) et UNION ALL SELECT 0 as source, trunc((sysdate - bt.btime) * 86400) as time_secs, 2 as operation, 0 as log_id FROM ( SELECT cast(min(end_interval_time) as date) as btime FROM WRM$_SNAPSHOT bsi WHERE bsi.dbid = :dbid AND bsi.snap_id = :bid ) bt ) WHERE time_secs >= 0 ORDER BY source ASC, time_secs DESC, log_id ASC |
622ufbrgvxdc7 | select decode(u.type#, 2, u.ext_username, u.name), o.name, t.update$, t.insert$, t.delete$, t.enabled, decode(bitand(t.property, 8192), 8192, 1, 0), decode(bitand(t.property, 65536), 65536, 1, 0), decode(bitand(t.property, 131072), 131072, 1, 0), (select o.name from obj$ o where o.obj# = u.spare2 and o.type# =57), decode(bitand(t.property, 524288), 524288, 1, 0) from sys.obj$ o, sys.user$ u, sys.trigger$ t, sys.obj$ bo where t.baseobject=bo.obj# and bo.name = :1 and bo.spare3 = :2 and bo.namespace = 1 and t.obj#=o.obj# and o.owner#=u.user# and o.type# = 12 and bitand(property, 16)=0 and bitand(property, 8)=0 order by o.obj# |
6287bu7gaqpn6 | INSERT INTO SYSTEM.LOGMNRT_MDDL$ Z (Z.SOURCE_OBJ#, Z.SOURCE_ROWID, Z.DEST_ROWID) SELECT :B4 , :B3 , X.ROWID FROM SYSTEM.LOGMNR_OBJ$ X WHERE X.OBJ# = :B2 AND X.LOGMNR_UID = :B1 AND X.ROWID NOT IN (SELECT Y.DEST_ROWID FROM SYSTEM.LOGMNRT_MDDL$ Y WHERE Y.SOURCE_OBJ# = :B4 ) |
63t3ufgq37m0c | SELECT instance_number, instance_name, host_name FROM ( SELECT dbin.instance_number as instance_number, max(dbin.instance_name) as instance_name, max(dbin.host_name) as host_name, sum(case when s.snap_id in (:bid, :eid) then 1 else 0 end) as cnt_edge FROM WRM$_SNAPSHOT s , WRM$_DATABASE_INSTANCE dbin WHERE s.dbid = :dbid AND dbin.instance_number = s.instance_number AND s.snap_id >= :bid AND s.snap_id <= :eid AND dbin.dbid = s.dbid AND dbin.startup_time = s.startup_time GROUP BY dbin.instance_number ) WHERE cnt_edge < 2 |
6795mu6bwn2z6 | SELECT DETAIL_DESCRIPTION_V FROM CBSOGG.CB_PACKAGE WHERE PACKAGE_CODE_V=:B1 |
69k5bhm12sz98 |
SELECT dbin.instance_number, dbin.db_name, dbin.instance_name, dbin.host_name, dbin.version, CASE WHEN s1.startup_time = s2.startup_time THEN 0 ELSE 1 END as bounce, CAST(s1.end_interval_time AS DATE) as begin_time, CAST(s2.end_interval_time AS DATE) as end_time, ROUND((cast( (case when s2.end_interval_time > s1.end_interval_time then s2.end_interval_time else s1.end_interval_time end) as date) - cast(s1.end_interval_time as date)) * 86400) as int_secs, CASE WHEN (s1.status <> 0 OR s2.status <> 0) THEN 1 ELSE 0 END as err_detect, round( greatest( (extract(day from s2.flush_elapsed) * 86400) + (extract(hour from s2.flush_elapsed) * 3600) + (extract(minute from s2.flush_elapsed) * 60) + extract(second from s2.flush_elapsed), (extract(day from s1.flush_elapsed) *
86400) + (extract(hour from s1.flush_elapsed) * 3600) + (extract(minute from s1.flush_elapsed) * 60) + extract(second from s1.flush_elapsed), 0 )) as max_flush_secs FROM WRM$_SNAPSHOT s1 , WRM$_DATABASE_INSTANCE dbin , WRM$_SNAPSHOT s2 WHERE s1.dbid = :dbid AND s2.dbid = :dbid AND s1.instance_number = s2.instance_number AND dbin.instance_number = s1.instance_number AND s1.snap_id = :bid AND s2.snap_id = :eid AND dbin.dbid = s1.dbid AND dbin.startup_time = s1.startup_time and dbin.instance_number = :inst |
6fchhyp65szsc |
SELECT "Custom SQL Query"."SOURCE_V" AS "SOURCE_V"
FROM (
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zone 'GM
T') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v f
rom cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.en
tity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v
and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union
all
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISD
N,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbso
gg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Cat
egory_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM_HISTORY a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT_HISTORY c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cbsogg.cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union all
select distinct 'FLR' Category,
tt.docket
_number_n ticket_no, null Workflow_desc,
null sla_time, tt.ticket_regn_dt_d registration_date, null wf_reg_date_sec, null start_date,
null wf_start_date_sec, null wf_end_date, null wf_end_date_sec, tt.ticket_resp_dt_d workflw_resp_date,
null wf_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Co
mplaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscr
iber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
null bin_expiry_date, null bin_expiry_date_sec, null bin_assign_date, null bin_assign_date_sec, null bin_comp_date,
null bin_compl_date_sec,
null wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
null Assign_to,
C.GROUP_NAME_V activity_name,
tt.question_v, tt.answer_v,
TTI.NOTES_V Notes,
(SELECT CFT
.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT--, TT_TICKETINFO c
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
B.USER_NAME_V user_name
from cbsogg.TT_TICKETINFO tt, cbsogg.CB_USERS B, cbsogg.CB_USER_GROUP C, cbsogg.TT_TICKETINCIDENT TTI
where tt.docket_number_n not in(select event_refno_v from WF_WORKFLOW@cbsstandby)
AND TTI.INCIDENT_NUMBER_N = tt.docket_number_n
AND tt.LOGGED_BY_N = B.USER_CODE_N
AND C.GROUP_CODE_N = B.GROUP_CODE_N
) "Custom SQL Query"
GROUP BY "Custom SQL Query"."SOURCE_V"
ORDER BY 1 ASC NULLS FIRST |
6qg99cfg26kwb | SELECT COUNT(UNQ) UNQ, COUNT(PFX) PFX FROM (SELECT /*+ first_rows(1) leading(cc) */ CD.TYPE# UNQ, NULL PFX FROM SYS.CCOL$ CC, SYS.CDEF$ CD WHERE CC.OBJ# = :B2 AND CC.INTCOL# = :B1 AND CD.CON# = CC.CON# AND CD.OBJ# = CC.OBJ# AND CD.ENABLED IS NOT NULL AND CD.INTCOLS = 1 AND CD.TYPE# IN (2, 3) AND BITAND(CD.DEFER, 2+4) = 4 AND ROWNUM < 2 UNION ALL SELECT /*+ first_rows(1) leading(i) */ CASE WHEN I.INTCOLS = 1 AND BITAND(I.PROPERTY, 1) = 1 THEN 3 ELSE NULL END UNQ, CASE WHEN IC.POS# = 1 THEN 1 ELSE NULL END PFX FROM SYS.IND$ I, SYS.ICOL$ IC WHERE I.BO# = :B2 AND I.BO# = IC.BO# AND IC.INTCOL# = :B1 AND I.OBJ# = IC.OBJ# AND BITAND(I.FLAGS, 1025) = 0 AND ROWNUM < 2 ) |
6t38f117sqpjj | SELECT CASE WHEN STATUS_CODE_V = 'ER' THEN 'Deactivated' WHEN STATUS_CODE_V = 'PR' THEN 'Pre Terminated' ELSE SERVICE_INFO_V END, ACCOUNT_LINK_CODE_N, PACKAGE_CODE_V FROM CBSOGG.CB_ACCOUNT_SERVICE_LIST WHERE ACCOUNT_CODE_N = :B1 AND SUB_SERVICE_CODE_V IN ('FXL-FIBER', 'FXL-COPER') AND STATUS_CODE_V IN ('AC', 'SP', 'C', 'IA', 'PR', 'ER') AND FROM_DATE_D=(SELECT MAX(FROM_DATE_D) FROM CB_ACCOUNT_SERVICE_LIST WHERE ACCOUNT_CODE_N = :B1 AND SUB_SERVICE_CODE_V IN ('FXL-FIBER', 'FXL-COPER') AND STATUS_CODE_V IN ('AC', 'SP', 'C', 'IA', 'PR', 'ER') ) AND ROWNUM = 1 |
6wm3n4d7bnddg |
SELECT source, (case when time_secs < 1 then 1 else time_secs end) as time_secs, operation FROM ( SELECT 1 as source, trunc((sysdate - cast(ll.log_date as date)) * 86400) as time_secs, decode(ll.operation, 'OPEN', 0 , 1 ) as operation, ll.log_id as log_id FROM DBA_SCHEDULER_WINDOW_LOG ll , ( SELECT max(l.log_id) as max_log_id FROM DBA_SCHEDULER_WINDOW_LOG l , DBA_SCHEDULER_WINGROUP_MEMBERS m WHERE l.window_name = m.window_name AND m.window_group_name = 'MAINTENANCE_WINDOW_GROUP' AND l.operation in ('OPEN', 'CLOSE') AND CAST(l.log_date AS DATE) < ( SELECT cast(min(end_interval_time) as date) as btime FROM WRM$_SNAPSHOT bsi WHERE bsi.dbid = :dbid AND bsi.instance_number = :inst AND bsi.
snap_id = :bid ) ) max_log WHERE ll.log_id = max_log.max_log_id UNION ALL SELECT 2 as source, trunc((sysdate - cast(l.log_date as date)) * 86400) as time_secs, decode(l.operation, 'OPEN', 0 , 1 ) as operation, l.log_id as log_id FROM DBA_SCHEDULER_WINDOW_LOG l , DBA_SCHEDULER_WINGROUP_MEMBERS m WHERE l.window_name = m.window_name AND m.window_group_name = 'MAINTENANCE_WINDOW_GROUP' AND l.operation in ('OPEN', 'CLOSE') AND CAST(l.log_date AS DATE) <= ( SELECT cast(max(end_interval_time) as date) as etime FROM WRM$_SNAPSHOT esi WHERE esi.dbid = :dbid AND esi.instance_number = :inst AND esi.snap_id = :eid ) AND CAST(l.log_date AS DATE) >=
( SELECT cast(min(end_interval_time) as date) as btime FROM WRM$_SNAPSHOT bsi WHERE bsi.dbid = :dbid AND bsi.instance_number = :inst AND bsi.snap_id = :bid ) UNION ALL SELECT 0 as source, trunc((sysdate - et.etime) * 86400) as time_secs, 3 as operation, 0 as log_id FROM ( SELECT cast(max(end_interval_time) as date) as etime FROM WRM$_SNAPSHOT esi WHERE esi.dbid = :dbid AND esi.instance_number = :inst AND esi.snap_id = :eid ) et UNION ALL SELECT 0 as source, trunc((sysdate - bt.btime) * 86400) as time_secs, 2 as operation, 0 as log_id FROM ( SELECT cast(min(end_interval_time) as date) as btime FROM WRM$_SNAPSHOT bsi WHERE bsi.dbid = :dbid AND bsi.instance_number = :inst AND bsi.snap_id = :bid ) bt ) WHERE time_secs >= 0 ORDER B
Y source ASC, time_secs DESC, log_id ASC |
6xvp6nxs4a9n4 | select nvl(sum(space), 0) from recyclebin$ where ts# = :1 |
7ddfg16h7b9m2 | update /*+ streams restrict_all_ref_cons */ "CBSOGG"."CB_SUBS_PROVISIONING" p set "CAI_CMD_RESP_STRING"=dbms_reputil2.get_final_lob(:1, "CAI_CMD_RESP_STRING", :2), "EXECUTION_DATE_DT"=decode(:3, 'N', "EXECUTION_DATE_DT", :4), "NO_OF_TIMES_EXECUTED_N"=decode(:5, 'N', "NO_OF_TIMES_EXECUTED_N", :6), "REMARK_V"=decode(:7, 'N', "REMARK_V", :8), "STATUS_V"=decode(:9, 'N', "STATUS_V", :10) where (:11="CHRONO_NUM_N") and (:12="PROCESS_NO_N") |
7fwum1yuknrsh | select t.ts#, t.file#, t.block#, nvl(t.bobj#, 0), nvl(t.tab#, 0), t.intcols, nvl(t.clucols, 0), t.flags, t.pctfree$, t.pctused$, t.initrans, t.maxtrans, t.rowcnt, t.blkcnt, t.empcnt, t.avgspc, t.chncnt, t.avgrln, t.analyzetime, t.samplesize, t.cols, t.property, nvl(t.degree, 1), nvl(t.instances, 1), t.avgspc_flb, t.flbcnt, t.kernelcols, nvl(t.trigflag, 0), nvl(t.spare1, 0), nvl(t.spare2, 0), t.spare4, t.spare6, ts.cachedblk, ts.cachehit, ts.logicalread from tab$ t, tab_stats$ ts where t.obj#= :1 and t.obj# = ts.obj# (+) |
7jpt4cpfvcy1k | select ts#, online$ from ts$ where name=:1 |
835jgtn27ta1j | create table TB_MT_T |
86kwhy1f0bttn | SELECT /*+ ALL_ROWS */ COUNT(*) FROM DBA_POLICIES V WHERE V.OBJECT_OWNER = :B3 AND V.OBJECT_NAME = :B2 AND (V.POLICY_NAME LIKE '%xdbrls%' OR V.POLICY_NAME LIKE '%$xd_%') AND V.FUNCTION = :B1 |
86x2ztzd4hkhn | create table TB_TT_G |
87u32wt5scu7n |
INSERT /*+ restrict_all_ref_cons */ INTO "CBSOGG"."GSM_HOME_CDRS" ("TYPE_OF_CALL_V", "SWITCH_CALL_TYPE_V", "RECORD_TYPE_V", "PROMOTION_CODE_V", "IN_OUT_V", "TARF_TYPE_V", "CALL_CHRG_TYPE_V", "FAX_DATA_VOICE_V", "CALC_ON_V", "PERCENTAGE_VAL_N", "INTERIM_CALL_INDICATOR_V", "CALL_SEQ_NUM_N", "TELE_SERVICE_NUM_V", "BEARER_SERVICE_NUM_V", "SUPPLIMENTARY_NUM_V", "TRANSMISSION_MODE_V", "MS_CLASS_MARK_V", "ACCOUNT_LINK_CODE_N", "ROAM_SERVICE_PROVIDER_V", "OFFLINE_DISC_OVER_V", "CHRONO_NUM_N", "CALL_DATE_DT", "CALL_DURATION_N", "SUMMARY_SEQ_NUM_N", "ARTICLE_CODE_V", "PRINT_IN_DTL_V", "SINGLE_TARF_FLAG_V", "LDC_FLAG_V", "IMSI_NUM_N", "MOBL_NUM_V", "IMEI_NUM_V", "ORG
INATE_CELL_ID_V", "BTS_SECTOR_V", "MSC_NUM_V", "CIRCUIT_ID_V", "IN_TRUNK_V", "OUT_TRUNK_V", "NUM_PLAN_V", "STD_CODE_LENGTH_N", "CALLED_CALLING_NUM_V", "ACTUAL_NUM_IF_FRWD_V", "DIALED_DIGIT_V", "UTC_OFFSET_TIME_N", "UTC_INC_DEC_V", "ICSRV_PROVIDER_CODE_V", "IC_RATE_ZONE_V", "IC_CONCT_ZONE_V", "IC_SWITCH_PULSE_N", "PULSE_CALC_SWITCH_V", "COUNTRY_CODE_V", "STATE_CODE_V", "CITY_CODE_V", "TARIFF_CODE_V", "RATING_FILE_ID_N", "DAY_CODE_V", "TIME_BAND_V", "IC_RATE_PLAN_CODE_N", "IC_KEY_CODE_N", "IC_VOICE_FRML_N", "IC_VOICE_UNIT_RATE_N", "IC_UNITS_N", "IC_VOICE_AMT_N", "IC_TAX_CODE_V", "IC_TAX_AMT1_N", "IC_TAX_AMT2_N", "IC_TAX_AMT3_N", "MOBL_ORIGINATE
_ZONE_CODE_V", "MOBL_TERMINATE_ZONE_CODE_V", "AIRTM_RATE_PLAN_CODE_N", "AIRTM_KEY_CODE_N", "AIRTM_FRML_N", "AIRTM_VOICE_UNIT_RATE_N", "AIRTM_VOICE_UNITS_N", "AIRTM_AMT_N", "AIRTM_TAX_CODE_V", "AIRTM_TAX_AMT1_N", "AIRTM_TAX_AMT2_N", "AIRTM_TAX_AMT3_N", "DISC_TYPE_V", "DISC_UNITS_N", "LDC_RATING_ZONE_V", "LDC_RATING_FRML_N", "LDC_VOICE_UNIT_RATE_N", "LDC_VOICE_UNITS_N", "LDC_AMT_N", "LDC_TAX_CODE_V", "LDC_TAX_AMT1_N", "LDC_TAX_AMT2_N", "SURCHARGE_N", "DESTINATION_TYPE_V", "RATE_ON_V", "DEST_SERVICE_TYPE_CODE_V", "CONTENT_PROV_TARIFF_CODE_V", "CONTENT_PROV_PLAN_CODE_N", "SERVICE_CATEGORY_CODE_V", "CHARGED_DURATION_N", "DISC_QTM_TYPE_V", "DISCOUNTED_VALUE_N", "DISCOUNTED_AMOU
NT_N", "OUTPUT_DISC_ARTICLE_V", "CHARGE_BEFORE_DISC_N", "PROCESSED_DATE_D", "BILL_CYCL_FULL_CODE_N", "ACCOUNT_CODE_N", "DISC_VARBL_CODE_V", "PROCESS_FLAG_V", "DISC_CODE_AMT_V", "U_TYPE_DISC_AMT_V", "A_TYPE_DISC_AMT_V", "P_TYPE_DISC_AMT_V") VALUES (:1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 , :89 , :90 , :91 ,
:92 , :93 , :94 , :95 , :96 , :97 , :98 , :99 , :100 , :101 , :102 , :103 , :104 , :105 , :106 , :107 , :108 , :109 , :110 ) |
8mdz49zkajhw3 |
SELECT /*+ OPT_PARAM('_fix_control' '16391176:1') */ GROUP_TYPE, BUCKET_START, BUCKET_END, TM_GROUP_TYPE, TM_BUCKET_START, TM_BUCKET_END, SUM(TM_CPU_FIRST_BUCKET_VALUE) TM_CPU_FIRST_BUCKET_VALUE, SUM(TM_CPU_MIDDLE_BUCKETS_VALUE) TM_CPU_MIDDLE_BUCKETS_VALUE, SUM(TM_CPU_LAST_BUCKET_VALUE) TM_CPU_LAST_BUCKET_VALUE, SUM(TM_DB_FIRST_BUCKET_VALUE) TM_DB_FIRST_BUCKET_VALUE, SUM(TM_DB_MIDDLE_BUCKETS_VALUE) TM_DB_MIDDLE_BUCKETS_VALUE, SUM(TM_DB_LAST_BUCKET_VALUE) TM_DB_LAST_BUCKET_VALUE, SUM(RREQS_FIRST_BUCKET_VALUE) RREQS_FIRST_BUCKET_VALUE, SUM(RREQS_MIDDLE_BUCKETS_VALUE) RREQS_MIDDLE_BUCKETS_VALUE, SUM(RREQS_LAST_BUCKET_VALUE) RREQS_LAST_BUCKET_VALUE, SUM(WREQS_FIRST_BUCKET_VALUE) WREQS_FIRST_BUCKET_VALUE, SUM(WREQS_MIDDLE_BUCKETS_VALUE) WREQS_MIDDLE_BUCKETS_VALUE, SUM(WREQS_LAST_BUCKET_VALUE) WREQS_LAST_BUCKET_VALUE, SUM(RBYTES_FIRST_BUCKET_VALUE) RBYTES_FIRST_BUCKET_VALUE, SUM(RBYTES_MIDDLE_BUCKETS_VALUE) RBYTES_MIDDLE_BUCKETS_VALUE, SUM(RBYTES_LAST_BUCKET_VALUE) RBYTES
_LAST_BUCKET_VALUE, SUM(WBYTES_FIRST_BUCKET_VALUE) WBYTES_FIRST_BUCKET_VALUE, SUM(WBYTES_MIDDLE_BUCKETS_VALUE) WBYTES_MIDDLE_BUCKETS_VALUE, SUM(WBYTES_LAST_BUCKET_VALUE) WBYTES_LAST_BUCKET_VALUE, SUM(IBYTES_FIRST_BUCKET_VALUE) IBYTES_FIRST_BUCKET_VALUE, SUM(IBYTES_MIDDLE_BUCKETS_VALUE) IBYTES_MIDDLE_BUCKETS_VALUE, SUM(IBYTES_LAST_BUCKET_VALUE) IBYTES_LAST_BUCKET_VALUE, SUM(CRBYTES_FIRST_BUCKET_VALUE) CRBYTES_FIRST_BUCKET_VALUE, SUM(CRBYTES_MIDDLE_BUCKETS_VALUE) CRBYTES_MIDDLE_BUCKETS_VALUE, SUM(CRBYTES_LAST_BUCKET_VALUE) CRBYTES_LAST_BUCKET_VALUE, SUM(PGA_ALLOC_FIRST_BUCKET_VALUE) PGA_ALLOC_FIRST_BUCKET_VALUE, SUM(PGA_ALLOC_MIDDLE_BUCKETS_VALUE) PGA_ALLOC_MIDDLE_BUCKETS_VALUE, SUM(PGA_ALLOC_LAST_BUCKET_VALUE) PGA_ALLOC_LAST_BUCKET_VALUE, SUM(TMP_ALLOC_FIRST_BUCKET_VALUE) TMP_ALLOC_FIRST_BUCKET_VALUE, SUM(TMP_ALLOC_MIDDLE_BUCKETS_VALUE) TMP_ALLOC_MIDDLE_BUCKETS_VALUE, SUM(TMP_ALLOC_LAST_BUCKET_VALUE) TMP_ALLOC_LAST_BUCKET_VALUE FROM ( SELECT GROUP_TYPE, BUCKET_START, TM
_BUCKET_START, TM_BUCKET_END, BUCKET_END, TM_GROUP_TYPE, SUM(GVTF.TM_CPU_FIRST_BUCKET_VALUE) TM_CPU_FIRST_BUCKET_VALUE, SUM(GVTF.TM_CPU_MIDDLE_BUCKETS_VALUE) TM_CPU_MIDDLE_BUCKETS_VALUE, SUM(GVTF.TM_CPU_LAST_BUCKET_VALUE) TM_CPU_LAST_BUCKET_VALUE, SUM(GVTF.TM_DB_FIRST_BUCKET_VALUE) TM_DB_FIRST_BUCKET_VALUE, SUM(GVTF.TM_DB_MIDDLE_BUCKETS_VALUE) TM_DB_MIDDLE_BUCKETS_VALUE, SUM(GVTF.TM_DB_LAST_BUCKET_VALUE) TM_DB_LAST_BUCKET_VALUE, SUM(GVTF.RREQS_FIRST_BUCKET_VALUE) RREQS_FIRST_BUCKET_VALUE, SUM(GVTF.RREQS_MIDDLE_BUCKETS_VALUE) RREQS_MIDDLE_BUCKETS_VALUE, SUM(GVTF.RREQS_LAST_BUCKET_VALUE) RREQS_LAST_BUCKET_VALUE, SUM(GVTF.WREQS_FIRST_BUCKET_VALUE) WREQS_FIRST_BUCKET_VALUE, SUM(GVTF.WREQS_MIDDLE_BUCKETS_VALUE) WREQS_MIDDLE_BUCKETS_VALUE, SUM(GVTF.WREQS_LAST_BUCKET_VALUE) WREQS_LAST_BUCKET_VALUE, SUM(GVTF.RBYTES_FIRST_BUCKET_VALUE) RBYTES_FIRST_BUCKET_VALUE, SUM(GVTF.RBYTES_MIDDLE_BUCKETS_VALUE) RBYTES_MIDDLE_BUCKETS_VALUE, SUM(GVTF.RBYTES_LAST_BUCKET_VALUE) RBYTES_LAST_BU
CKET_VALUE, SUM(GVTF.WBYTES_FIRST_BUCKET_VALUE) WBYTES_FIRST_BUCKET_VALUE, SUM(GVTF.WBYTES_MIDDLE_BUCKETS_VALUE) WBYTES_MIDDLE_BUCKETS_VALUE, SUM(GVTF.WBYTES_LAST_BUCKET_VALUE) WBYTES_LAST_BUCKET_VALUE, SUM(GVTF.IBYTES_FIRST_BUCKET_VALUE) IBYTES_FIRST_BUCKET_VALUE, SUM(GVTF.IBYTES_MIDDLE_BUCKETS_VALUE) IBYTES_MIDDLE_BUCKETS_VALUE, SUM(GVTF.IBYTES_LAST_BUCKET_VALUE) IBYTES_LAST_BUCKET_VALUE, SUM(GVTF.CRBYTES_FIRST_BUCKET_VALUE) CRBYTES_FIRST_BUCKET_VALUE, SUM(GVTF.CRBYTES_MIDDLE_BUCKETS_VALUE) CRBYTES_MIDDLE_BUCKETS_VALUE, SUM(GVTF.CRBYTES_LAST_BUCKET_VALUE) CRBYTES_LAST_BUCKET_VALUE, SUM(GVTF.PGA_ALLOC_FIRST_BUCKET_VALUE) PGA_ALLOC_FIRST_BUCKET_VALUE, SUM(GVTF.PGA_ALLOC_MIDDLE_BUCKETS_VALUE) PGA_ALLOC_MIDDLE_BUCKETS_VALUE, SUM(GVTF.PGA_ALLOC_LAST_BUCKET_VALUE) PGA_ALLOC_LAST_BUCKET_VALUE, SUM(GVTF.TMP_ALLOC_FIRST_BUCKET_VALUE) TMP_ALLOC_FIRST_BUCKET_VALUE, SUM(GVTF.TMP_ALLOC_MIDDLE_BUCKETS_VALUE) TMP_ALLOC_MIDDLE_BUCKETS_VALUE, SUM(GVTF.TMP_ALLOC_LAST_BUCKET_VALUE) TMP_A
LLOC_LAST_BUCKET_VALUE FROM TABLE(SYS.GV$(CURSOR( SELECT INST_ID, GROUP_TYPE, BUCKET_START, TM_BUCKET_START, TM_BUCKET_END, BUCKET_END, TM_GROUP_TYPE, SUM(TM_DELTA_CPU_TIME * TM_FIRST_BUCKET_RATIO) TM_CPU_FIRST_BUCKET_VALUE, SUM(TM_DELTA_CPU_TIME * TM_MIDDLE_BUCKETS_RATIO) TM_CPU_MIDDLE_BUCKETS_VALUE, SUM(TM_DELTA_CPU_TIME * TM_LAST_BUCKET_RATIO) TM_CPU_LAST_BUCKET_VALUE, SUM(TM_DELTA_DB_TIME * TM_FIRST_BUCKET_RATIO) TM_DB_FIRST_BUCKET_VALUE, SUM(TM_DELTA_DB_TIME * TM_MIDDLE_BUCKETS_RATIO) TM_DB_MIDDLE_BUCKETS_VALUE, SUM(TM_DELTA_DB_TIME * TM_LAST_BUCKET_RATIO) TM_DB_LAST_BUCKET_VALUE, SUM(DELTA_READ_REQUESTS * FIRST_BUCKET_RATIO) RREQS_FIRST_BUCKET_VALUE, SUM(DELTA_READ_REQUESTS * MIDDLE_BUCKETS_RATIO) RREQS_MIDDLE_BUCKETS_VALUE, SUM(DELTA_READ_REQUESTS * LAST_BUCKET_RATIO) RREQS_LAST_BUCKET_VALUE, SUM(DELTA_WRITE_REQUESTS * FIRST_BUCKET_RATIO) WREQS_FIRST_BUCKET_VALUE, SUM(DELTA_WRITE_REQUESTS * MIDDLE_BUCKETS_RATIO) WREQS_MIDDLE_BUCKETS_VALUE, SUM(DELTA_WRITE_REQUE
STS * LAST_BUCKET_RATIO) WREQS_LAST_BUCKET_VALUE, SUM(DELTA_READ_BYTES * FIRST_BUCKET_RATIO) RBYTES_FIRST_BUCKET_VALUE, SUM(DELTA_READ_BYTES * MIDDLE_BUCKETS_RATIO) RBYTES_MIDDLE_BUCKETS_VALUE, SUM(DELTA_READ_BYTES * LAST_BUCKET_RATIO) RBYTES_LAST_BUCKET_VALUE, SUM(DELTA_WRITE_BYTES * FIRST_BUCKET_RATIO) WBYTES_FIRST_BUCKET_VALUE, SUM(DELTA_WRITE_BYTES * MIDDLE_BUCKETS_RATIO) WBYTES_MIDDLE_BUCKETS_VALUE, SUM(DELTA_WRITE_BYTES * LAST_BUCKET_RATIO) WBYTES_LAST_BUCKET_VALUE, SUM(DELTA_INTERCONNECT_BYTES * FIRST_BUCKET_RATIO) IBYTES_FIRST_BUCKET_VALUE, SUM(DELTA_INTERCONNECT_BYTES * MIDDLE_BUCKETS_RATIO) IBYTES_MIDDLE_BUCKETS_VALUE, SUM(DELTA_INTERCONNECT_BYTES * LAST_BUCKET_RATIO) IBYTES_LAST_BUCKET_VALUE, SUM(DELTA_READ_MEM_BYTES * FIRST_BUCKET_RATIO) CRBYTES_FIRST_BUCKET_VALUE, SUM(DELTA_READ_MEM_BYTES * MIDDLE_BUCKETS_RATIO) CRBYTES_MIDDLE_BUCKETS_VALUE, SUM(DELTA_READ_MEM_BYTES * LAST_BUCKET_RATIO) CRBYTES_LAST_BUCKET_VALUE, SUM(PGA_ALLOCATED * LENGTH_SEG * FIRST_BUCKET_R
ATIO) PGA_ALLOC_FIRST_BUCKET_VALUE, SUM(PGA_ALLOCATED * LENGTH_SEG * MIDDLE_BUCKETS_RATIO) PGA_ALLOC_MIDDLE_BUCKETS_VALUE, SUM(PGA_ALLOCATED * LENGTH_SEG * LAST_BUCKET_RATIO) PGA_ALLOC_LAST_BUCKET_VALUE, SUM(TEMP_SPACE_ALLOCATED * LENGTH_SEG * FIRST_BUCKET_RATIO) TMP_ALLOC_FIRST_BUCKET_VALUE, SUM(TEMP_SPACE_ALLOCATED * LENGTH_SEG * MIDDLE_BUCKETS_RATIO) TMP_ALLOC_MIDDLE_BUCKETS_VALUE, SUM(TEMP_SPACE_ALLOCATED * LENGTH_SEG * LAST_BUCKET_RATIO) TMP_ALLOC_LAST_BUCKET_VALUE FROM ( SELECT USERENV('INSTANCE') INST_ID, ROW_ID, SID, SAMPLE_TIME, CASE WHEN BUCKET_END IS NULL OR BUCKET_START IS NULL THEN NULL WHEN BUCKET_START = TM_BUCKET_START AND BUCKET_START = BUCKET_END THEN 'CO' WHEN BUCKET_START = TM_BUCKET_START THEN 'CM' WHEN BUCKET_START = BUCKET_END THEN 'SO' ELSE 'SM' END GROUP_TYPE, CASE WHEN TM_BUCKET_START IS NULL OR BUCKET_END IS NULL OR (TM_BUCKET_START = BUCKET_START) THEN NULL WHEN TM_BUCKET_START = BUCKET_END THEN 'O' ELSE 'M' END TM_GROUP_TYPE, START_SEG, BUCKET_S
TART, BUCKET_START_OFFSET, TM_START_SEG, CASE WHEN TM_BUCKET_START IS NULL OR (TM_BUCKET_START = BUCKET_START) THEN NULL ELSE TM_BUCKET_START END TM_BUCKET_START, CASE WHEN TM_BUCKET_START IS NULL OR (TM_BUCKET_START = BUCKET_START) THEN NULL ELSE BUCKET_END END TM_BUCKET_END, TM_BUCKET_START_OFFSET, LENGTH_SEG, TM_LENGTH_SEG, END_SEG, BUCKET_END, BUCKET_END_OFFSET, CASE WHEN BUCKET_START != BUCKET_END THEN (:B7 - BUCKET_START_OFFSET) / LENGTH_SEG ELSE 1 END FIRST_BUCKET_RATIO, CASE WHEN BUCKET_END >= BUCKET_START + 2 THEN :B7 / LENGTH_SEG ELSE NULL END MIDDLE_BUCKETS_RATIO, CASE WHEN BUCKET_START != BUCKET_END THEN BUCKET_END_OFFSET / LENGTH_SEG ELSE NULL END LAST_BUCKET_RATIO, CASE WHEN TM_BUCKET_START != BUCKET_END THEN (:B7 - TM_BUCKET_START_OFFSET) / TM_LENGTH_SEG ELSE 1 END TM_FIRST_BUCKET_RATIO, CASE WHEN BUCKET_END >= TM_BUCKET_START + 2 THEN :B7 / TM_LENGTH_SEG ELSE NULL END TM_MIDDLE_BUCKETS_RATIO, CASE WHEN TM_BUCKET_START != BUCKET_END THEN BUCKET_END_
OFFSET / TM_LENGTH_SEG ELSE NULL END TM_LAST_BUCKET_RATIO, TM_DELTA_CPU_TIME, TM_DELTA_DB_TIME, DELTA_READ_IO_REQUESTS DELTA_READ_REQUESTS, DELTA_WRITE_IO_REQUESTS DELTA_WRITE_REQUESTS, DELTA_READ_IO_BYTES DELTA_READ_BYTES, DELTA_WRITE_IO_BYTES DELTA_WRITE_BYTES, DELTA_INTERCONNECT_IO_BYTES DELTA_INTERCONNECT_BYTES, DELTA_READ_MEM_BYTES DELTA_READ_MEM_BYTES, PGA_ALLOCATED, TEMP_SPACE_ALLOCATED FROM (SELECT ROW_ID, SID, SAMPLE_TIME, START_SEG, TRUNC(START_SEG / :B7 ) BUCKET_START, MOD(START_SEG, :B7 ) BUCKET_START_OFFSET, TM_START_SEG, TRUNC(TM_START_SEG/:B7 ) TM_BUCKET_START, MOD(TM_START_SEG, :B7 ) TM_BUCKET_START_OFFSET, TRUNC(END_SEG/:B7 ) BUCKET_END, MOD(END_SEG, :B7 ) BUCKET_END_OFFSET, END_SEG, LENGTH_SEG, TM_LENGTH_SEG, TM_DELTA_CPU_TIME, TM_DELTA_DB_TIME, DELTA_READ_IO_REQUESTS, DELTA_WRITE_IO_REQUESTS, DELTA_READ_IO_BYTES, DELTA_WRITE_IO_BYTES, DELTA_INTERCONNECT_IO_BYTES, DELTA_READ_MEM_BYTES, PGA_ALLOCATED, TEMP_SPACE_ALLOCATED FROM (SELEC
T ROW_ID, SID, SAMPLE_TIME, TIME_INTERVAL, CASE WHEN START_SEG < 0 THEN 0 ELSE START_SEG END START_SEG, CASE WHEN TM_START_SEG < 0 THEN 0 ELSE TM_START_SEG END TM_START_SEG, CASE WHEN END_SEG > TIME_INTERVAL THEN TIME_INTERVAL ELSE END_SEG END END_SEG, (LENGTH_SEG - (CASE WHEN START_SEG < 0 THEN -START_SEG ELSE 0 END + CASE WHEN END_SEG > TIME_INTERVAL THEN END_SEG - TIME_INTERVAL ELSE 0 END)) LENGTH_SEG, (TM_LENGTH_SEG - (CASE WHEN TM_START_SEG < 0 THEN -TM_START_SEG ELSE 0 END + CASE WHEN END_SEG > TIME_INTERVAL THEN END_SEG - TIME_INTERVAL ELSE 0 END)) TM_LENGTH_SEG, TM_DELTA_CPU_TIME, TM_DELTA_DB_TIME, DELTA_READ_IO_REQUESTS, DELTA_WRITE_IO_REQUESTS, DELTA_READ_IO_BYTES, DELTA_WRITE_IO_BYTES, DELTA_INTERCONNECT_IO_BYTES, DELTA_READ_MEM_BYTES, PGA_ALLOCATED, TEMP_SPACE_ALLOCATED FROM (SELECT ROW_ID, SID, SAMPLE_TIME, TIME_INTERVAL, LENGTH_SEG, TM_LENGTH_SEG, END_SEG - TM_LENGTH_SEG TM_START_SEG, END_SEG - LENGTH_SEG START_SEG, END_SEG,
TM_DELTA_CPU_TIME, TM_DELTA_DB_TIME, DELTA_READ_IO_REQUESTS, DELTA_WRITE_IO_REQUESTS, DELTA_READ_IO_BYTES, DELTA_WRITE_IO_BYTES, DELTA_INTERCONNECT_IO_BYTES, DELTA_READ_MEM_BYTES, PGA_ALLOCATED, TEMP_SPACE_ALLOCATED FROM (SELECT ROW_ID, SID, SAMPLE_TIME, EXTRACT(SECOND FROM REL_SAMPLE_TIME_INT) + EXTRACT(MINUTE FROM REL_SAMPLE_TIME_INT)*60 + EXTRACT(HOUR FROM REL_SAMPLE_TIME_INT)*3600 + EXTRACT(DAY FROM REL_SAMPLE_TIME_INT)*3600*24 END_SEG, TIME_INTERVAL, DELTA_TIME/1000000 LENGTH_SEG, TM_DELTA_TIME/1000000 TM_LENGTH_SEG, TM_DELTA_CPU_TIME, TM_DELTA_DB_TIME, DELTA_READ_IO_REQUESTS, DELTA_WRITE_IO_REQUESTS, DELTA_READ_IO_BYTES, DELTA_WRITE_IO_BYTES, DELTA_INTERCONNECT_IO_BYTES, DELTA_READ_MEM_BYTES, PGA_ALLOCATED, TEMP_SPACE_ALLOCATED FROM (SELECT ROWNUM ROW_ID, SESSION_ID SID, CAST(FROM_TZ(SAMPLE_TIME, DBTIMEZONE) AS DATE) SAMPLE_DATE, SAMPLE_TIME, (SAMPLE_TIME - CAST(:B6 AS TIMESTAMP)) REL_SAMPLE_TIME_INT, TRUNC((:B5 - :B6 ) * 3600 * 24) TIME_INTERVAL,
:B6 AS BND_START_INTERVAL , :B5 AS BND_END_INTERVAL , TM_DELTA_TIME, TM_DELTA_CPU_TIME, TM_DELTA_DB_TIME, DELTA_TIME, DELTA_READ_IO_REQUESTS, DELTA_WRITE_IO_REQUESTS, DELTA_READ_IO_BYTES, DELTA_WRITE_IO_BYTES, DELTA_INTERCONNECT_IO_BYTES, DELTA_READ_MEM_BYTES, PGA_ALLOCATED, TEMP_SPACE_ALLOCATED FROM (SELECT ASH0.* FROM V$ACTIVE_SESSION_HISTORY ASH0 WHERE ((SESSION_ID = :B2 AND SESSION_SERIAL# = :B1 AND USERENV('INSTANCE') = :B3 ) OR (:B4 = 'yes' AND QC_INSTANCE_ID = :B3 AND QC_SESSION_ID = :B2 AND QC_SESSION_SERIAL# = :B1 ))) ) ASH1 WHERE SAMPLE_DATE >= BND_START_INTERVAL AND SAMPLE_DATE <= BND_END_INTERVAL + 120/3600/24 ) ) WHERE START_SEG <= TIME_INTERVAL ) WHERE (LENGTH_SEG IS NOT NULL AND LENGTH_SEG > 0) OR (TM_LENGTH_SEG IS NOT NULL AND TM_LENGTH_SEG > 0)) ) GROUP BY INST_ID, GROUP_TYPE, BUCKET_START, BUCKET_END, TM_GROUP_TYPE, TM_BUCKET_START, TM_BUCKET_END))) GVTF WHERE INST_ID >= :B9 AND INST_ID <= :B8 GROUP BY GROUP_TYPE, BUCKET_START
, BUCKET_END, TM_GROUP_TYPE, TM_BUCKET_START, TM_BUCKET_END ) GROUP BY GROUPING SETS ( (GROUP_TYPE, BUCKET_START, BUCKET_END), (TM_GROUP_TYPE, TM_BUCKET_START, TM_BUCKET_END) ) |
8p9z2ztb272bm | SELECT sx.instance_number, sx.id, sum(decode(e.snap_id, NULL, 0, 1)) as cnt FROM (SELECT s.instance_number, s.snap_id, x.id, x.name FROM WRM$_SNAPSHOT s , X$KEHSQT x WHERE s.dbid = :dbid AND s.instance_number = :inst AND s.snap_id >= :bid AND s.snap_id <= :eid AND s.status = 0 AND x.ver_type = :existence ) sx, WRM$_SNAP_ERROR e WHERE e.dbid(+) = :dbid AND e.instance_number(+) = sx.instance_number AND e.snap_id(+) = sx.snap_id AND e.table_name(+) = sx.name GROUP BY sx.instance_number, sx.id ORDER BY sx.instance_number |
8zc85a8249x81 | update obj$ set obj#=:4, type#=:5, ctime=:6, mtime=:7, stime=:8, status=:9, dataobj#=:10, flags=:11, oid$=:12, spare1=:13, spare2=:14, spare3=:15, signature=:16, spare7=:17, spare8=:18, spare9=:19 where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null and linkname is null and subname is null |
9ddxxas8hu8sv | select count(*) from ( select u.name from registry$ r, user$ u where r.status in (0, 1, 2, 3, 4, 5, 6, 7) and r.namespace = 'SERVER' and r.schema# = u.user# and u.name = :1 union all select u.name from registry$ r, registry$schemas s, user$ u where r.status in (0, 1, 2, 3, 4, 5, 6, 7) and r.namespace = 'SERVER' and r.cid = s.cid and s.schema# = u.user# and u.name = :1) |
9dzjush42kmfs | select spare4 from sys.optstat_hist_control$ where sname=:1 |
a6ygk0r9s5xuj | SELECT A.JOB_NAME, ( CASE A.STATE WHEN 'SCHEDULED' THEN :B11 WHEN 'DISABLED' THEN :B10 WHEN 'RUNNING' THEN :B9 ELSE :B8 END ) FROM DBA_SCHEDULER_JOBS A, ILM_RESULTS$ B, USER$ C, ILM_EXECUTION$ D WHERE A.JOB_NAME = B.JOBNAME AND (B.EXECUTION_ID = :B7 OR :B7 =:B6 ) AND B.EXECUTION_ID = D.EXECUTION_ID AND (B.JOBTYPE = :B5 OR :B5 = :B3 ) AND (B.JOBTYPE1 = :B4 OR :B4 = :B3 ) AND C.USER# = D.OWNER AND (:B1 = :B2 OR D.FLAG = :B1 ) |
akh9zqqkx3wj7 | select 1, max(id) from sys.wri$_adv_objects where task_id = :1 union all select 2, max(id) from sys.wri$_adv_recommendations where task_id = :1 union all select 3, max(id) from sys.wri$_adv_actions where task_id = :1 union all select 4, max(id) from sys.wri$_adv_findings where task_id = :1 union all select 5, max(id) from sys.wri$_adv_rationale where task_id = :1 |
avdp76f7hk0bq | DELETE CBS_ORDER_REPORT |
bb926a5dcb8kr |
merge into sys.mon_mods$ m using dual on (m.obj# = :objn and (:pobjn = 0 or m.obj# = :pobjn or m.obj# in (select obj# from tabpart$ where bo# = :pobjn and obj# = :objn union all select obj# from tabcompart$ where bo# = :pobjn and obj# = :objn union all select ts
p.obj# from tabsubpart$ tsp, tabcompart$ tcp where tsp.pobj# = tcp.obj# and (tcp.bo# = :pobjn or tcp.obj# = :pobjn) and tsp.obj# = :objn))) when matched then update set inserts = inserts + :ins, updates = updates + :upd, deletes = deletes + :del, flags = (decode(bitand(flags, :flag), :flag, flags, flags + :flag)), drop_segments = drop_segments + :dropseg, timestamp = :time when NOT matched then insert (obj#, inserts, updates, del
etes, timestamp, flags, drop_segments) values (:objn, :ins, :upd, :del, :time, :flag, :dropseg) |
bjwxsk192yrzv | INSERT INTO SYSTEM.LOGMNR_DICTSTATE$ (LOGMNR_UID, START_SCNBAS, START_SCNWRP, END_SCNBAS, END_SCNWRP, REDO_THREAD, RBASQN, RBABLK, RBABYTE) SELECT :B1 , START_SCNBAS, START_SCNWRP, :B7 , :B6 , :B5 , :B4 , :B3 , :B2 FROM SYSTEM.LOGMNR_DICTSTATE$ WHERE LOGMNR_UID = :B1 AND ROWNUM = 1 |
bn8y4pm7dzva4 |
INSERT /*+ restrict_all_ref_cons */ INTO "CBSOGG"."GPRS_HOME_CDRS" ("TYPE_OF_CALL_V", "SWITCH_CALL_TYPE_V", "RECORD_TYPE_V", "TARF_TYPE_V", "PROMOTION_CODE_V", "CALL_CHRG_TYPE_V", "CALC_ON_V", "PERCENTAGE_VAL_N", "INTERIM_CALL_INDICATOR_V", "CALL_SEQ_NUM_N", "ACCOUNT_LINK_CODE_N", "OFFLINE_DISC_OVER_V", "CHRONO_NUM_N", "CALL_DATE_DT", "CALL_DURATION_N", "SUMMARY_SEQ_NUM_N", "ARTICLE_CODE_V", "KEY_CODE_N", "PRINT_IN_DTL_V", "SINGLE_TARF_FLAG_V", "IMSI_NUM_N", "MOBL_NUM_V", "IMEI_NUM_V", "ORGINATE_CELL_ID_V", "TARIFF_CODE_V", "RATE_PLAN_CODE_N", "RATE_PLAN_KEY_N", "RATING_FIELD_ID_N", "DAY_CODE_V", "TIME_BAND_V", "MULTI_RATE_INDICATOR_V", "CDR_CHRONO_NUMBER_
N", "DISC_TYPE_V", "DISC_UNITS_N", "TYPE_OF_CONTROLLING_NODE_V", "PDP_TYPE_V", "PDP_ADDRESS_V", "CHARGING_CHARACTERISTICS_V", "APN_CODE_V", "CALL_TERMINATION_CAUSE_V", "PARTIAL_TYPE_INDICATOR_V", "CHARGING_ID_N", "QOS_REQUESTED_1_V", "QOS_USED_1_V", "DATA_VOLUME_INCOMING_1_N", "DATA_VOLUME_OUTGOING_1_N", "OUTGOING_UNITS_1_N", "INCOMING_UNITS_1_N", "OUTGOING_AMOUNT_1_N", "INCOMING_AMOUNT_1_N", "QOS_REQUESTED_2_V", "QOS_USED_2_V", "DATA_VOLUME_INCOMING_2_N", "DATA_VOLUME_OUTGOING_2_N", "OUTGOING_UNITS_2_N", "INCOMING_UNITS_2_N", "OUTGOING_AMOUNT_2_N", "INCOMING_AMOUNT_2_N", "QOS_REQUESTED_3_V", "QOS_USED_3_V", "DATA_VOLUME_INCOMING_3_N", "DATA_VOLUME_OUTGOING_3_N", "OUTGOING_UNITS_3_
N", "INCOMING_UNITS_3_N", "OUTGOING_AMOUNT_3_N", "INCOMING_AMOUNT_3_N", "CHARGED_ITEM_V", "TOT_CHARGE_N", "CHARGED_UNITS_N", "TAX_CODE_V", "TAX_AMT_1_N", "TAX_AMT_2_N", "TAX_AMT_3_N", "GGSN_ADDRESS_V", "SGSN_ADDRESS_V", "CHARGE_AT_V", "UPLOAD_VOL_FRML_CODE_N", "DOWNLOAD_VOL_FRML_CODE_N", "DURATION_FRML_CODE_N", "DURATION_AMT_N", "SESSION_FEE_N", "DESTINATION_TYPE_V", "RATE_ON_V", "DEST_SERVICE_TYPE_CODE_V", "MOBL_ORIGINATE_ZONE_CODE_V", "ACCESS_POINT_NAME_V", "DURATION_UNITS", "VOLUME_CONS_SEP_V", "CHARGED_DURATION_N", "CHARGED_VOLUME_N", "DISC_QTM_TYPE_V", "DISCOUNTED_VALUE_N", "DISCOUNTED_AMOUNT_N", "OUTPUT_DISC_ARTICLE_V", "CHARGE_BEFORE_DISC_N", "PROCESSED_D
ATE_D", "BILL_CYCL_FULL_CODE_N", "ACCOUNT_CODE_N", "DISC_CODE_AMT_V", "U_TYPE_DISC_AMT_V", "A_TYPE_DISC_AMT_V", "P_TYPE_DISC_AMT_V") VALUES (:1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 , :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 , :49 , :50 , :51 , :52 , :53 , :54 , :55 , :56 , :57 , :58 , :59 , :60 , :61 , :62 , :63 , :64 , :65 , :66 , :67 , :68 , :69 , :70 , :71 , :72 , :73 , :74 , :75 , :76 , :77 , :78 , :79 , :80 , :81 , :82 , :83 , :84 , :85 , :86 , :87 , :88 , :89 , :90 , :91 , :92 , :93 , :94 , :95 , :96 , :97 , :98 , :99 , :100 , :101 , :102 ) |
bwqq7u3mzctv7 | SELECT /*+ ordered index(u) index(o) index(po) */ MOD(PO.SPARE2, 256), PO.PARTTYPE FROM SYS.USER$ U, SYS.OBJ$ O, SYS.PARTOBJ$ PO WHERE U.NAME = :B3 AND O.NAME = :B2 AND O.NAMESPACE = :B1 AND U.USER# = O.OWNER# AND O.OBJ# = PO.OBJ# |
c79fcfw22nqu9 | SELECT OLDEST_SCN, COMMIT_SCN, SYNCH_SCN, SPARE1, EPOCH, PROCESSED_SCN, SOURCE_DB_NAME, START_SCN, OLDEST_TRANSACTION_ID, SPILL_LWM_SCN, LWM_EXTERNAL_POS, OLDEST_POSITION, SPILL_LWM_POSITION, START_POSITION, PROCESSED_POSITION, OLDEST_CREATE_TIME, SPILL_LWM_CREATE_TIME, XOUT_PROCESSED_POSITION, XOUT_PROCESSED_CREATE_TIME, XOUT_PROCESSED_TID, XOUT_PROCESSED_TIME, APPLIED_HIGH_POSITION, SPARE4, SOURCE_ROOT_NAME , FLAGS, PTO_RECOVERY_SCN FROM SYS.STREAMS$_APPLY_MILESTONE WHERE APPLY#=:1 |
cmb9scbhf5qv3 |
declare loc_source_obj# number := :1; loc_source_rowid rowid := :2; result_status number := 0; fnd_src_rowid number := 0; found boolean := true; begin select count(*) into fnd_src_rowid from system.logmnrt_mddl$ y where y.source_obj# = loc_source_obj# and y.source_rowid = loc_source_rowid; begin if 0 = fnd_src_rowid THEN insert into system.logmnrt_mddl$ z (z.source_obj#, z.source_rowid, z.dest_rowid) select loc_source_obj#, loc_source_rowid, x.rowid from SYSTEM.LOGMNR_OBJ$ x where x.OBJ# = :3 AND x.LOGMNR_UID = :4 and x.rowid not in (select y.dest_rowid from system.logmnrt_mddl$ y where y.source_obj# = loc_source_obj#);end if; exception when dup_val_on_index then dbms_system.ksdwrt(dbms_system.alert_file, 'LOGMINER DICTIONARY ERROR: update modifying more than one row.');result_status := 1; end; update SYSTEM.LOGMNR_OBJ$ x set x.OBJ# = :5 , x.TYPE# = :6 , x.STIME = :7 , x.FLAGS = :8 , x.OID$ = :9 , x.OBJV# = :10, x.SPARE3 = :11 where x.rowid = (select z.dest_r
owid from system.logmnrt_mddl$ z where z.source_obj# = loc_source_obj# and z.source_rowid = loc_source_rowid); if (SQL%ROWCOUNT <> 1) then dbms_system.ksdwrt(dbms_system.alert_file, 'LOGMINER DICTIONARY ERROR: update modified ' || SQL%ROWCOUNT ||' rows.'); result_status := 1; end if; :12 := result_status; end; |
cusp9gtyj36y5 | select /*+ index(do) */ dir_cnt from opt_directive_own$ do where dir_own# = :1 |
cwr268sbr4vk5 | SELECT DISPLAY_DESCRIPTION_V FROM CBSOGG.CB_SUBS_OFFER_DETAILS F, CBSOGG.CB_OFFERS H WHERE F.SCHEME_REF_CODE_N = H.SCHEME_REF_CODE_N AND F.ACCOUNT_LINK_CODE_N = :B1 AND F.STATUS_OPTN_V = 'A' |
dfffkcnqfystw |
WITH MONITOR_DATA AS (SELECT INST_ID, KEY, NVL2(PX_QCSID, NULL, STATUS) STATUS, FIRST_REFRESH_TIME, LAST_REFRESH_TIME, REFRESH_COUNT, PROCESS_NAME, SID, SQL_ID, SQL_EXEC_START, SQL_EXEC_ID, DBOP_NAME, DBOP_EXEC_ID, SQL_PLAN_HASH_VALUE, SQL_FULL_PLAN_HASH_VALUE, SESSION_SERIAL#, SQL_TEXT, IS_FULL_SQLTEXT, PX_SERVER#, PX_SERVER_GROUP, PX_SERVER_SET, PX_QCINST_ID, PX_QCSID, CASE WHEN ELAPSED_TIME < (CPU_TIME+ APPLICATION_WAIT_TIME+ CONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) THEN (CPU_TIME+ APPLICATION_WAIT_TIME+ CONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) ELSE ELAPSED_TIME END ELAPSED_TIME, QUEUING_TIME, CPU_TIME, APPLICATION_WAIT_TIME, CONCURRENCY_WAIT_TIME, CLUSTER_WAIT_TIME, USER_IO_WAIT_TIME, CASE WHEN ELAPSED_TIME < (CPU_TIME+ APPLICATION_WAIT_TIME+ CONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) THEN 0 ELSE ELAPSED_TIME - (CPU_TIME+ APPLICATION_WAIT_TIME+ C
ONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) END OTHER_WAIT_TIME, PLSQL_EXEC_TIME, JAVA_EXEC_TIME, FETCHES, BUFFER_GETS, IO_INTERCONNECT_BYTES IO_INTER_BYTES, PHYSICAL_READ_REQUESTS READ_REQS, PHYSICAL_READ_BYTES READ_BYTES, PHYSICAL_WRITE_REQUESTS WRITE_REQS, PHYSICAL_WRITE_BYTES WRITE_BYTES, NVL(PHYSICAL_READ_BYTES, 0) + NVL(PHYSICAL_WRITE_BYTES, 0) IO_BYTES, NVL(PHYSICAL_READ_REQUESTS, 0) + NVL(PHYSICAL_WRITE_REQUESTS, 0) IO_REQS, USER# USERID, USERNAME, MODULE, ACTION, SERVICE_NAME, CLIENT_IDENTIFIER, CLIENT_INFO, PROGRAM, PLSQL_OBJECT_ID PL_OID, PLSQL_SUBPROGRAM_ID PL_PROGID, PLSQL_ENTRY_OBJECT_ID PL_ENTRY_OID, PLSQL_ENTRY_SUBPROGRAM_ID PL_ENTRY_PROGID, PX_MAXDOP MAX_DOP, PX_IS_CROSS_INSTANCE, PX_MAXDOP_INSTANCES MAX_DOP_INSTANCES, PX_SERVERS_REQUESTED SERVERS_REQUESTED, PX_SERVERS_ALLOCATED SERVERS_ALLOCATED, ERROR_NUMBER, ERROR_FACILITY, ERROR_MESSAGE, NVL2(OTHER_XML, 'Y', NULL) HAS_OTHER_XML, NVL2(BINDS_XML, '
Y', NULL) HAS_BINDS_XML, NVL2(RM_CONSUMER_GROUP, NVL2(RM_LAST_ACTION_TIME, TO_CHAR(RM_LAST_ACTION_TIME, :B12 ), '00/00/0000 00:00:01') || XMLELEMENT( "rminfo", XMLATTRIBUTES( RM_LAST_ACTION AS "rmlastact", RM_LAST_ACTION_REASON AS "rmlastreason", TO_CHAR(RM_LAST_ACTION_TIME, :B12 ) AS "rmlasttime", RM_CONSUMER_GROUP AS "rmcg")).GETSTRINGVAL(), '00/00/0000 00:00:00') RM_INFO, CON_NAME, CON_ID FROM GV$SQL_MONITOR MO1 WHERE MO1.INST_ID BETWEEN :B11 AND :B10 AND MO1.SQL_ID = NVL(:B9 , MO1.SQL_ID) AND MO1.SQL_EXEC_START = NVL(:B8 , MO1.SQL_EXEC_START) AND MO1.SQL_EXEC_ID = NVL(:B7 , MO1.SQL_EXEC_ID) OR (MO1.DBOP_NAME = NVL(:B6 , MO1.DBOP_NAME) AND MO1.DBOP_EXEC_ID = NVL(:B5 , MO1.DBOP_EXEC_ID)) AND ((:B4 = 1 AND MO1.PX_QCSID IS NULL) OR (MO1.PX_SERVER_GROUP = NVL(:B3 , MO1.PX_SERVER_GROUP) AND MO1.PX_SERVER_SET = NVL(:B2 , MO1.PX_SERVER_SET) AND MO1.PX_SERVER# = NVL(:B1 , MO1.PX_SERVER#)))), MONITOR_AGG AS (SELECT MAX_
PX_QCSID, MAX_KEY, MAX_INST_ID, MAX_SESSION_ID, MAX_SESSION_SERIAL, MAX_PX_DOP, MAX_PX_DOP_INSTANCES, MAX_PX_IS_CROSS_INSTANCE, SUM_SERVERS_REQUESTED, SUM_SERVERS_ALLOCATED, DIST_INST_COUNT, DIST_PX_GROUP_COUNT, DIST_PX_SET_COUNT, MAX_PLAN_HASH_VALUE, MAX_FULL_PLAN_HASH_VALUE, MAX_USERID, MAX_PROGRAM, MAX_USERNAME, MAX_MODULE, MAX_ACTION, MAX_SERVICE_NAME, MAX_CLIENT_ID, MAX_CLIENT_INFO, MAX_ERROR_NUMBER, MAX_ERROR_FACILITY, MAX_ERROR_MESSAGE, QC_HAS_OTHER_XML, QC_HAS_BINDS_XML, MAX_PL_OID, MAX_PL_PROGID, MAX_PL_ENTRY_OID, MAX_PL_ENTRY_PROGID, MAX_SQL_ID, MAX_SQL_EXEC_START, MAX_SQL_EXEC_ID, MAX_LAST_REFRESH_TIME, MAX_DBOP_NAME, MAX_DBOP_EXEC_ID, CASE WHEN MAX_PL_OID IS NOT NULL THEN NVL((SELECT P.OWNER || '.' || P.OBJECT_NAME || DECODE(P.PROCEDURE_NAME, NULL, '', '.' || P.PROCEDURE_NAME) FROM DBA_PROCEDURES P WHERE P.OBJECT_ID = MAX_PL_OID AND P.SUBPROGRAM_ID = MAX_PL_PROGID AND ROWNUM = 1), 'Unavailable') END MAX_PL_NAME, CASE WHEN MAX_PL_EN
TRY_OID IS NOT NULL THEN NVL((SELECT P.OWNER || '.' || P.OBJECT_NAME || DECODE(P.PROCEDURE_NAME, NULL, '', '.' || P.PROCEDURE_NAME) FROM DBA_PROCEDURES P WHERE P.OBJECT_ID = MAX_PL_ENTRY_OID AND P.SUBPROGRAM_ID = MAX_PL_ENTRY_PROGID AND ROWNUM = 1), 'Unavailable') END MAX_PL_ENTRY_NAME, MAX_STATUS, SUM_REFRESH_COUNT, MIN_FIRST_REFRESH_TIME, IS_FULL_TEXT, SQLMON_TEXT, SUM_ELAPSED_TIME, MAX_ELAPSED_TIME, MAX_QUEUING_TIME, SUM_CPU_TIME, SUM_USER_IO_WAIT_TIME, SUM_APPLICATION_WAIT_TIME, SUM_CONCURRENCY_WAIT_TIME, SUM_CLUSTER_WAIT_TIME, SUM_PLSQL_EXEC_TIME, SUM_JAVA_EXEC_TIME, SUM_OTHER_WAIT_TIME, SUM_FETCHES, SUM_BUFFER_GETS, SUM_READ_REQS, SUM_READ_BYTES, SUM_WRITE_REQS, SUM_WRITE_BYTES, SUM_IO_BYTES, SUM_IO_INTER_BYTES, DECODE(:B14 , 1, 'db_name', DB.DB_UNIQUE_NAME) DB_UNIQUE_NAME, DECODE(:B14 , 1, 'platform_name', DB.PLATFORM_NAME) PLATFORM_NAME, DECODE(:B14 , 1, 'host_name', INST.HOST_NAME) HOST_NAME, AGG_RM_INFO MAX_RM_INFO, MAX_CON_NAME, DEC
ODE(MAX_CON_ID, 0, NULL, MAX_CON_ID) MAX_CON_ID FROM (SELECT MAX(PX_QCSID) MAX_PX_QCSID, MAX(CASE WHEN PX_QCSID IS NULL THEN KEY ELSE NULL END) MAX_KEY, MAX(CASE WHEN PX_QCSID IS NULL THEN INST_ID ELSE NULL END) MAX_INST_ID, MAX(CASE WHEN PX_QCSID IS NULL THEN SID ELSE NULL END) MAX_SESSION_ID, MAX(CASE WHEN PX_QCSID IS NULL THEN SESSION_SERIAL# ELSE NULL END) MAX_SESSION_SERIAL, MAX(MAX_DOP) MAX_PX_DOP, MAX(MAX_DOP_INSTANCES) MAX_PX_DOP_INSTANCES, MAX(PX_IS_CROSS_INSTANCE) MAX_PX_IS_CROSS_INSTANCE, SUM(SERVERS_REQUESTED) SUM_SERVERS_REQUESTED, SUM(SERVERS_ALLOCATED) SUM_SERVERS_ALLOCATED, COUNT(DISTINCT INST_ID) DIST_INST_COUNT, COUNT(DISTINCT PX_SERVER_GROUP) DIST_PX_GROUP_COUNT, COUNT(DISTINCT PX_SERVER_SET) DIST_PX_SET_COUNT, MAX(SQL_PLAN_HASH_VALUE) MAX_PLAN_HASH_VALUE, MAX(SQL_FULL_PLAN_HASH_VALUE) MAX_FULL_PLAN_HASH_VALUE, MAX(USERID) MAX_USERID, MAX(PROGRAM) MAX_PROGRAM, MAX(USERNAME) MAX_USERNAME, MAX(MODULE) MAX_MODULE, MAX(ACTION) MAX_ACTION, MAX(SERVI
CE_NAME) MAX_SERVICE_NAME, MAX(CLIENT_IDENTIFIER) MAX_CLIENT_ID, MAX(CLIENT_INFO) MAX_CLIENT_INFO, MAX(ERROR_NUMBER) MAX_ERROR_NUMBER, MAX(ERROR_FACILITY) MAX_ERROR_FACILITY, MAX(ERROR_MESSAGE) MAX_ERROR_MESSAGE, MAX(NVL2(PX_QCSID, HAS_OTHER_XML, NULL)) QC_HAS_OTHER_XML, MAX(HAS_BINDS_XML) QC_HAS_BINDS_XML, MAX(PL_OID) MAX_PL_OID, MAX(PL_PROGID) MAX_PL_PROGID, MAX(PL_ENTRY_OID) MAX_PL_ENTRY_OID, MAX(PL_ENTRY_PROGID) MAX_PL_ENTRY_PROGID, MAX(SQL_ID) MAX_SQL_ID, MAX(SQL_EXEC_START) MAX_SQL_EXEC_START, MAX(SQL_EXEC_ID) MAX_SQL_EXEC_ID, MAX(LAST_REFRESH_TIME) MAX_LAST_REFRESH_TIME, MAX(STATUS) MAX_STATUS, SUM(REFRESH_COUNT) SUM_REFRESH_COUNT, MIN(FIRST_REFRESH_TIME) MIN_FIRST_REFRESH_TIME, MAX(DBOP_NAME) MAX_DBOP_NAME, MAX(DBOP_EXEC_ID) MAX_DBOP_EXEC_ID, CASE WHEN :B13 = 0 THEN NULL ELSE MAX(SQL_TEXT) END SQLMON_TEXT, MAX(IS_FULL_SQLTEXT) IS_FULL_TEXT, SUM(ELAPSED_TIME) SUM_ELAPSED_TIME, MAX(ELAPSED_TIME) MAX_ELAPSED_TIME, MAX(QUEUING_TIME) MAX_QUEUING_TIME, SUM
(CPU_TIME) SUM_CPU_TIME, SUM(USER_IO_WAIT_TIME) SUM_USER_IO_WAIT_TIME, SUM(APPLICATION_WAIT_TIME) SUM_APPLICATION_WAIT_TIME, SUM(CONCURRENCY_WAIT_TIME) SUM_CONCURRENCY_WAIT_TIME, SUM(CLUSTER_WAIT_TIME) SUM_CLUSTER_WAIT_TIME, SUM(PLSQL_EXEC_TIME) SUM_PLSQL_EXEC_TIME, SUM(JAVA_EXEC_TIME) SUM_JAVA_EXEC_TIME, SUM(OTHER_WAIT_TIME) SUM_OTHER_WAIT_TIME, SUM(FETCHES) SUM_FETCHES, SUM(BUFFER_GETS) SUM_BUFFER_GETS, SUM(READ_REQS) SUM_READ_REQS, SUM(READ_BYTES) SUM_READ_BYTES, SUM(WRITE_REQS) SUM_WRITE_REQS, SUM(WRITE_BYTES) SUM_WRITE_BYTES, NVL(SUM(READ_BYTES), 0) + NVL(SUM(WRITE_BYTES), 0) SUM_IO_BYTES, SUM(IO_INTER_BYTES) SUM_IO_INTER_BYTES, MAX(RM_INFO) AGG_RM_INFO, MAX(CON_NAME) MAX_CON_NAME, MAX(CON_ID) MAX_CON_ID FROM MONITOR_DATA) MD, (SELECT HOST_NAME FROM V$INSTANCE) INST, (SELECT DB_UNIQUE_NAME, PLATFORM_NAME FROM V$DATABASE) DB), ASH_DATA AS (SELECT AD0.INST_ID, AD0.SESSION_ID, AD0.PLAN_LINE_ID, AD0.PLSQL_OBJECT_ID, AD0.PLSQL_SUBPROGRAM_ID, AD0.ACTIVITY_BU
CKET_NUM, AD0.PLAN_ACTIVITY_BUCKET_NUM, AD0.SQL, AD0.TOP_LEVEL_SQL_ID, AD0.DBOP_NAME, AD0.IS_MONITORED_SQL, AD0.IS_PX_SLAVE, AD0.BUCKET_ACTIVITY_START, AD0.ACTIVITY_START, AD0.BUCKET_ACTIVITY_END, AD0.ACTIVITY_END, AD0.ACTIVITY_COUNT, AD0.ACTIVITY_TYPE, AD0.OTHER_SQL_ACTIVITY_TYPE, AD0.EVENT_NAME, AD0.IMQ_COUNT, AD0.WAIT_COUNT, AD0.CPU_COUNT, AD0.OTHER_SQL_COUNT, AD0.PX_SERVER_SET, AD0.PX_DFO_ACTIVITY_COUNT, AD0.DFO_MOST_ACTIVE_IID, AD0.DFO_MOST_ACTIVE_SID, (CASE WHEN AD0.DFO_MOST_ACTIVE_IID = AD0.INST_ID AND AD0.DFO_MOST_ACTIVE_SID = AD0.SESSION_ID AND (((AD0.PX_DFO_ACTIVITY_COUNT / AD0.DFO_MOST_ACTIVE_COUNT) >= AD0.PX_DOP * 1.05) OR ((AD0.PX_DFO_ACTIVITY_COUNT / AD0.DFO_MOST_ACTIVE_COUNT) <= AD0.PX_DOP *0.95)) AND (AD0.DFO_DURATION * 100) > :B32 THEN AD0.ACTIVITY_COUNT ELSE NULL END) DFO_MOST_ACTIVE_COUNT, AD0.BUCKET_DISTINCT_SAMPLES, AD0.SQL_BUCKET_DISTINCT_SAMPLES, CASE WHEN AD0.PX_SERVER_GROUP IS NULL AND AD0.IS_PX_SLAVE = 1 THEN 1 ELSE AD0.PX_SE
RVER_GROUP END PX_SERVER_GROUP, AD0.PX_STEP_ID, AD0.PX_DFO_PAIR_TYPE, AD0.PX_DFO_PAIR_ID, AD0.PX_STEP_ARG, AD0.PX_DOP, CASE WHEN AD0.PX_DOP IS NOT NULL AND AD0.PX_DOP <> AD0.PX_MIN_DOP AND AD0.PX_MIN_DOP != 0 THEN PX_MIN_DOP ELSE NULL END PX_MIN_DOP FROM (SELECT /*+ use_hash(ash) leading(mo) */ ASH.INST_ID, ASH.IS_PX_SLAVE, ASH.SESSION_ID, ASH.PLAN_LINE_ID, ASH.PLSQL_OBJECT_ID, ASH.PLSQL_SUBPROGRAM_ID, ASH.ACTIVITY_BUCKET_NUM, ASH.PLAN_ACTIVITY_BUCKET_NUM, ASH.SQL, ASH.TOP_LEVEL_SQL_ID, ASH.DBOP_NAME, ASH.IS_MONITORED_SQL, ASH.BUCKET_ACTIVITY_START, ASH.ACTIVITY_START, ASH.BUCKET_ACTIVITY_END, ASH.ACTIVITY_END, ASH.ACTIVITY_COUNT, ASH.ACTIVITY_TYPE, ASH.OTHER_SQL_ACTIVITY_TYPE, ASH.EVENT_NAME, ASH.IMQ_COUNT, ASH.WAIT_COUNT, ASH.CPU_COUNT, ASH.OTHER_SQL_COUNT, MO.PX_SERVER_SET, ASH.PX_DFO_ACTIVITY_COUNT, TRUNC(ASH.MOST_ACTIVE_IN_DFO / 10000000000) DFO_MOST_ACTIVE_COUNT, MOD(TRUNC(ASH.MOST_ACTIVE_IN_DFO / 1000000), 10000) DFO_MOST_ACTIVE_IID, MOD(
ASH.MOST_ACTIVE_IN_DFO, 1000000) DFO_MOST_ACTIVE_SID, ASH.DFO_DURATION, ASH.BUCKET_DISTINCT_SAMPLES, ASH.SQL_BUCKET_DISTINCT_SAMPLES, MO.PX_SERVER_GROUP, ASH.PX_STEP_ID, ASH.PX_DFO_PAIR_TYPE, ASH.PX_DFO_PAIR_ID, ASH.PX_STEP_ARG, ASH.PX_DOP, ASH.PX_MIN_DOP FROM (SELECT /*+ no_merge */ MD.INST_ID, MD.SID, MD.SESSION_SERIAL#, MD.PX_SERVER_SET, MD.PX_SERVER_GROUP FROM MONITOR_DATA MD WHERE MD.SID IS NOT NULL OR :B31 = 1) MO, (SELECT /*+ no_merge */ GVTF.INST_ID, GVTF.GLOBAL_SAMPLE_ID, GVTF.IS_PX_SLAVE, GVTF.SESSION_ID, GVTF.PLAN_LINE_ID, GVTF.PLSQL_OBJECT_ID, GVTF.PLSQL_SUBPROGRAM_ID, GVTF.ACTIVITY_BUCKET_NUM, GVTF.PLAN_ACTIVITY_BUCKET_NUM, GVTF.SQL, GVTF.TOP_LEVEL_SQL_ID, GVTF.DBOP_NAME, GVTF.IS_MONITORED_SQL, GVTF.BUCKET_ACTIVITY_START, GVTF.ACTIVITY_START, GVTF.BUCKET_ACTIVITY_END, GVTF.ACTIVITY_END, GVTF.ACTIVITY_COUNT, GVTF.ACTIVITY_TYPE, GVTF.OTHER_SQL_ACTIVITY_TYPE, GVTF.EVENT_NAME, GVTF.IMQ_COUNT, GVTF.WAIT_COUNT, GVTF.CPU_COUNT, GVTF.OTHER_S
QL_COUNT, MAX(GVTF.PER_SERVER_DFO_COUNT * 10000000000 + GVTF.INST_ID * 1000000 + GVTF.SESSION_ID) OVER(PARTITION BY GVTF.PX_DFO_PAIR_TYPE, GVTF.PX_DFO_PAIR_ID) MOST_ACTIVE_IN_DFO, SUM(GVTF.ACTIVITY_COUNT) OVER(PARTITION BY GVTF.PX_DFO_PAIR_TYPE, GVTF.PX_DFO_PAIR_ID) PX_DFO_ACTIVITY_COUNT, GVTF.DFO_DURATION, GVTF.PX_STEP_ID, GVTF.PX_DFO_PAIR_TYPE, GVTF.PX_DFO_PAIR_ID, GVTF.PX_STEP_ARG, GVTF.PX_DOP, GVTF.PX_MIN_DOP, COUNT(DISTINCT GVTF.GLOBAL_SAMPLE_ID) OVER(PARTITION BY GVTF.ACTIVITY_BUCKET_NUM) BUCKET_DISTINCT_SAMPLES, COUNT(DISTINCT GVTF.GLOBAL_SAMPLE_ID) OVER(PARTITION BY GVTF.SQL, GVTF.ACTIVITY_BUCKET_NUM) SQL_BUCKET_DISTINCT_SAMPLES FROM TABLE(GV$(CURSOR( (SELECT USERENV('INSTANCE') INST_ID, ASH2.GLOBAL_SAMPLE_ID, CASE WHEN :B30 = 1 AND :B27 > 1 THEN BUCKET_NUM ELSE NULL END ACTIVITY_BUCKET_NUM, CASE WHEN :B29 = 1 AND :B27 > 1 THEN BUCKET_NUM ELSE NULL END PLAN_ACTIVITY_BUCKET_NUM, ASH2.SQL, ASH2.TOP_LEVEL_SQL_ID, ASH2.DBOP_NAME, ASH2.IS_MONITORED_SQL, A
SH2.PLAN_LINE_ID, ASH2.PLSQL_OBJECT_ID, ASH2.PLSQL_SUBPROGRAM_ID, ASH2.ACTIVITY_TYPE, ASH2.OTHER_SQL_ACTIVITY_TYPE, ASH2.EVENT_NAME, ASH2.IS_PX_SLAVE, ASH2.SESSION_ID, ASH2.PX_STEP_ID, ASH2.PX_DFO_PAIR_TYPE, ASH2.PX_DFO_PAIR_ID, ASH2.PX_STEP_ARG, CASE WHEN ASH2.PX_DFO_PAIR_ID IS NOT NULL THEN DECODE(ASH2.PX_DOP, 0, :B28 , ASH2.PX_DOP) ELSE NULL END PX_DOP, ASH2.PX_MIN_DOP, :B20 + NUMTODSINTERVAL(:B26 * (ASH2.BUCKET_NUM-1), 'SECOND') BUCKET_ACTIVITY_START, :B20 + NUMTODSINTERVAL( :B26 * ASH2.BUCKET_NUM - 1, 'SECOND') BUCKET_ACTIVITY_END, ASH2.ACTIVITY_START, ASH2.ACTIVITY_END, ASH2.ACTIVITY_COUNT, ASH2.IMQ_COUNT, ASH2.WAIT_COUNT, ASH2.CPU_COUNT, ASH2.OTHER_SQL_COUNT, SUM(ASH2.ACTIVITY_COUNT) OVER(PARTITION BY ASH2.PX_DFO_PAIR_ID, ASH2.PX_DFO_PAIR_TYPE, DECODE(ASH2.PX_DFO_PAIR_ID, NULL, NULL, ASH2.SESSION_ID)) PER_SERVER_DFO_COUNT, CEIL((MAX(ASH2.MAX_SAMPLE_DATE) OVER(PARTITION BY ASH2.PX_DFO_PAIR_ID, ASH2.PX_DFO_PAIR_TYPE) - MIN(ASH2.MIN_SAMPLE_DATE) O
VER(PARTITION BY ASH2.PX_DFO_PAIR_ID, ASH2.PX_DFO_PAIR_TYPE)) * 3600 * 24) DFO_DURATION FROM (SELECT ASH1.BUCKET_NUM, ASH1.GLOBAL_SAMPLE_ID, ASH1.PLAN_LINE_ID, ASH1.PLSQL_OBJECT_ID, ASH1.PLSQL_SUBPROGRAM_ID, ASH1.ACTIVITY_TYPE, ASH1.OTHER_SQL_ACTIVITY_TYPE, ASH1.EVENT_NAME, ASH1.SESSION_ID, ASH1.PX_STEP_ID, ASH1.PX_STEP_ARG, MAX(ASH1.SQL) SQL, MAX(ASH1.IS_MONITORED_SQL) IS_MONITORED_SQL, MAX(ASH1.PX_DFO_PAIR_TYPE) PX_DFO_PAIR_TYPE, MAX(ASH1.PX_DFO_PAIR_ID) PX_DFO_PAIR_ID, MIN(SAMPLE_DATE) MIN_SAMPLE_DATE, MAX(SAMPLE_DATE) MAX_SAMPLE_DATE, MAX(ASH1.IS_PX_SLAVE) IS_PX_SLAVE, MAX(ASH1.PX_DOP) PX_DOP, MIN(ASH1.PX_DOP) PX_MIN_DOP, MIN(ASH1.SAMPLE_DATE) ACTIVITY_START, MAX(ASH1.SAMPLE_DATE) ACTIVITY_END, COUNT(ASH1.SQL) ACTIVITY_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE = 'Cpu' AND ASH1.EVENT_NAME = 'in memory' THEN 1 ELSE NULL END) IMQ_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE != 'Other SQL Execution' AND ASH1.ACTIVITY_TYPE != 'Non SQL' AND ASH1.ACTIVITY_TYPE != 'Cp
u' THEN 1 ELSE NULL END) WAIT_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE = 'Cpu' AND ASH1.EVENT_NAME IS NULL THEN 1 ELSE NULL END) CPU_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE = 'Other SQL Execution' AND ASH1.ACTIVITY_TYPE != 'Non SQL' THEN 1 ELSE NULL END) OTHER_SQL_COUNT, MAX(ASH1.TOP_LEVEL_SQL_ID) TOP_LEVEL_SQL_ID, MAX(ASH1.DBOP_NAME) DBOP_NAME FROM ( SELECT (CASE WHEN :B27 > 1 THEN (TRUNC(DELTA_TIME_SECONDS/ :B26 ) + 1) ELSE 1 END) BUCKET_NUM, ASH00.SQL, ASH00.SAMPLE_DATE, NVL2(DUP.C2, TRUNC(DELTA_TIME_SECONDS/ (:B25 )) + 1, NULL) GLOBAL_SAMPLE_ID, NVL2(DUP.C2, NULL, ASH00.IS_MONITORED_SQL) IS_MONITORED_SQL, NVL2(DUP.C2, NULL, ASH00.IN_INMEMORY_QUERY) IN_INMEMORY_QUERY, NVL2(DUP.C2, NULL, ASH00.WAIT_CLASS) WAIT_CLASS, NVL2(DUP.C2, NULL, ASH00.ACTIVITY_TYPE) ACTIVITY_TYPE, NVL2(DUP.C2, NULL, ASH00.OTHER_SQL_ACTIVITY_TYPE) OTHER_SQL_ACTIVITY_TYPE, NVL2(DUP.C2, NULL, ASH00.EVENT_NAME) EVENT_NAME, NVL2(DUP.C2, NULL, ASH00.TOP_LEVEL_SQL_ID) TOP_LEVEL_SQL
_ID, NVL2(DUP.C2, NULL, ASH00.DBOP_NAME) DBOP_NAME, NVL2(DUP.C2, NULL, ASH00.IS_PX_SLAVE) IS_PX_SLAVE, NVL2(DUP.C2, NULL, ASH00.SESSION_ID) SESSION_ID, NVL2(DUP.C2, NULL, ASH00.PLSQL_OBJECT_ID) PLSQL_OBJECT_ID, NVL2(DUP.C2, NULL, ASH00.PLSQL_SUBPROGRAM_ID) PLSQL_SUBPROGRAM_ID, NVL2(DUP.C2, NULL, ASH00.PLAN_LINE_ID) PLAN_LINE_ID, NVL2(DUP.C2, NULL, ASH00.PX_STEP_ID) PX_STEP_ID, NVL2(DUP.C2, NULL, ASH00.PX_STEP_ARG) PX_STEP_ARG, NVL2(DUP.C2, NULL, ASH00.PX_DFO_PAIR_ID) PX_DFO_PAIR_ID, NVL2(DUP.C2, NULL, ASH00.PX_DFO_PAIR_TYPE) PX_DFO_PAIR_TYPE, NVL2(DUP.C2, NULL, ASH00.PX_DOP) PX_DOP FROM (SELECT 1 C1, NULL C2 FROM V$TIMER UNION ALL SELECT 1 C1, 1 C2 FROM V$TIMER) DUP, (SELECT /*+ no_merge */ 1 C1, ASH000.SAMPLE_DATE, ASH000.IS_MONITORED_SQL, ((EXTRACT(SECOND FROM(DELTA_TIME)) + EXTRACT(MINUTE FROM(DELTA_TIME)) * 60 + EXTRACT(HOUR FROM(DELTA_TIME)) * 3600 + EXTRACT(DAY FROM(DELTA_TIME)) * 86400)) DELTA_TIME_SECONDS, ASH000.IN_INMEMORY_QUERY, ASH00
0.WAIT_CLASS, DECODE(ASH000.IS_MONITORED_SQL, 1, NVL(ASH000.WAIT_CLASS, 'Cpu'), DECODE(SQL_ID, NULL, 'Non SQL', 'Other SQL Execution')) ACTIVITY_TYPE, NVL(ASH000.WAIT_CLASS, 'Cpu') OTHER_SQL_ACTIVITY_TYPE, DECODE(:B24 , 1, CASE WHEN ASH000.IS_MONITORED_SQL = 1 THEN NVL(ASH000.EVENT, DECODE(ASH000.IN_INMEMORY_QUERY, 'Y', 'in memory', ASH000.EVENT)) WHEN ASH000.SQL_ID IS NOT NULL THEN 'sql_id: ' || ASH000.SQL_ID WHEN ASH000.CALL_NAME IS NOT NULL THEN 'call: ' || ASH000.CALL_NAME ELSE 'anonymous: '|| ASH000.EVENT END, NULL) EVENT_NAME, CASE WHEN ASH000.IS_MONITORED_SQL = 1 AND (NVL(ASH000.SQL_ID, :B9 ) = :B9 OR NVL(ASH000.DBOP_NAME, :B6 ) = :B6 ) THEN 'this' WHEN ASH000.IS_PX_SLAVE = 1 AND ASH000.SQL_ID IS NOT NULL AND ASH000.TOP_LEVEL_SQL_ID != ASH000.SQL_ID THEN ASH000.TOP_LEVEL_SQL_ID WHEN ASH000.SQL_ID IS NOT NULL THEN ASH000.SQL_ID ELSE NVL(CALL_NAME, 'anonymous') END SQL, CASE WHEN ASH000.IS_PX_SLAVE = 0 AND (ASH000.SQL_ID IS NULL OR ASH000.TOP_LEVEL_SQL_ID !=
ASH000.SQL_ID) THEN ASH000.TOP_LEVEL_SQL_ID END TOP_LEVEL_SQL_ID, ASH000.DBOP_NAME, ASH000.IS_PX_SLAVE, CASE WHEN ASH000.IS_PX_SLAVE = 1 AND ASH000.IS_MONITORED_SQL != 1 THEN 65536 ELSE ASH000.SESSION_ID END SESSION_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PLSQL_OBJECT_ID, NULL) PLSQL_OBJECT_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PLSQL_SUBPROGRAM_ID, NULL) PLSQL_SUBPROGRAM_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.SQL_PLAN_LINE_ID, NULL) PLAN_LINE_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PX_STEP_ID, NULL) PX_STEP_ID, CASE WHEN ASH000.IS_PX_SLAVE = 1 AND ASH000.IS_MONITORED_SQL = 1 AND ASH000.PX_STEP_ID IN (1, 2, 3) THEN ASH000.PX_STEP_ARG ELSE NULL END PX_DFO_PAIR_ID, CASE WHEN ASH000.IS_PX_SLAVE = 0 OR ASH000.IS_MONITORED_SQL != 1 THEN NULL WHEN ASH000.PX_STEP_ID = 1 THEN 1 WHEN ASH000.PX_STEP_ID IN (2, 3) THEN 0 ELSE NULL END PX_DFO_PAIR_TYPE, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PX_STEP_ARG, NULL) PX_STEP_ARG, DECODE(ASH000.IS_
MONITORED_SQL, 1, ASH000.PX_DOP, NULL) PX_DOP FROM (SELECT ASH0.*, CASE WHEN ASH0.IS_TARGET_SQL = 1 OR (ASH0.IS_PX_SLAVE = 1 AND ((NVL(ASH0.TOP_LEVEL_SQL_ID, ASH0.SQL_ID) IS NOT NULL AND NVL(ASH0.TOP_LEVEL_SQL_ID, ASH0.SQL_ID) = :B9 ) OR (SQL_ID IS NULL AND :B23 = 'Y'))) THEN 1 ELSE 0 END IS_MONITORED_SQL FROM (SELECT (CASE WHEN (ASH.SQL_ID = :B9 AND ASH.SQL_EXEC_ID = :B7 AND ASH.SQL_EXEC_START = :B8 ) THEN 1 ELSE 0 END) IS_TARGET_SQL, ASH.SQL_ID, ASH.SQL_PLAN_LINE_ID, ASH.PLSQL_OBJECT_ID, ASH.PLSQL_SUBPROGRAM_ID, ASH.TOP_LEVEL_SQL_ID, DECODE(ASH.SQL_ID, NULL, ASH.TOP_LEVEL_CALL_NAME, NULL) CALL_NAME, ASH.EVENT, ASH.IN_INMEMORY_QUERY, ASH.WAIT_CLASS, ASH.SQL_EXEC_ID, ASH.SQL_EXEC_START, ASH.DBOP_NAME, ASH.DBOP_EXEC_ID, ASH.SESSION_ID, ASH.SESSION_SERIAL#, CASE WHEN QC_INSTANCE_ID IS NOT NULL AND (ASH.SESSION_ID != ASH.QC_SESSION_ID OR ASH.SESSION_SERIAL# != ASH.QC_SESSION_SERIAL# OR USERENV('instance') != ASH.QC_INSTANCE_ID) THEN 1 ELSE 0 END IS_PX_SLAVE, SAMP
LE_TIME - CAST(:B20 AS TIMESTAMP) DELTA_TIME, CAST(FROM_TZ(ASH.SAMPLE_TIME, DBTIMEZONE) AS DATE) SAMPLE_DATE, TRUNC(MOD(PX_FLAGS/65536, 32)) PX_STEP_ID, MOD(PX_FLAGS, 65536) PX_STEP_ARG, TRUNC(PX_FLAGS/2097152) PX_DOP FROM V$ACTIVE_SESSION_HISTORY ASH WHERE ((ASH.SESSION_ID = :B19 AND ASH.SESSION_SERIAL# = :B18 AND USERENV('INSTANCE') = :B17 ) OR (ASH.QC_SESSION_ID IS NOT NULL AND ASH.QC_SESSION_ID = :B19 AND ASH.QC_SESSION_SERIAL# = :B18 AND ASH.QC_INSTANCE_ID = :B17 )) AND SAMPLE_TIME BETWEEN :B16 AND :B15 ) ASH0 WHERE (ASH0.SAMPLE_DATE BETWEEN :B20 + 1/24/3600 AND :B22 - 1/24/3600 OR (ASH0.SQL_ID = :B9 AND ASH0.SQL_EXEC_START = :B8 AND ASH0.SQL_EXEC_ID = :B7 ) OR (ASH0.DBOP_NAME = :B6 AND ASH0.DBOP_EXEC_ID = :B5 )) AND (:B21 IS NULL OR ASH0.SQL_PLAN_LINE_ID = :B21 ) AND (ASH0.IS_PX_SLAVE = 0 OR ASH0.SQL_ID IS NOT NULL)) ASH000 ) ASH00 WHERE ASH00.C1 = DUP.C1) ASH1 WHERE ASH1.BUCKET_NUM > 0 AND ASH1.BUCKET_NUM <= :B27 GROUP BY USERENV('INSTANCE'), ASH1.GLOBAL_SAMPLE_ID,
ASH1.BUCKET_NUM, ASH1.SESSION_ID, ASH1.PLAN_LINE_ID, ASH1.PLSQL_OBJECT_ID, ASH1.PLSQL_SUBPROGRAM_ID, ASH1.ACTIVITY_TYPE, ASH1.EVENT_NAME, ASH1.OTHER_SQL_ACTIVITY_TYPE, ASH1.PX_STEP_ID, ASH1.PX_STEP_ARG) ASH2)))) GVTF WHERE GVTF.INST_ID BETWEEN :B11 AND :B10 ) ASH WHERE ASH.GLOBAL_SAMPLE_ID IS NULL AND ASH.SESSION_ID = MO.SID(+) AND ASH.INST_ID = MO.INST_ID(+)) AD0), RESPONSE_TIME_DATA AS (SELECT ADH.BUCKET_NUM, ADH.SQL_ROWNUM, ADH.SQL, ADH.TOP_LEVEL_SQL_ID, ADH.DBOP_NAME, ADH.PX_ID, DECODE( ADH.PX_STEP_ID, NULL, NULL, 0, NULL, 1, 'PX Server(s) - Executing Parent DFO', 2, 'PX Server(s) - Executing Child DFO', 3, 'PX Server(s) - Sampling Child DFO', 4, 'PX Server(s) - Joining Group', 5, 'QC - Scheduling Child DFO', 6, 'QC - Scheduling Parent DFO', 7, 'QC - Initializing Objects', 8, 'QC - Flushing Objects', 9, 'QC - Allocating Slaves', 10, 'QC - Initializing Granules', 11, 'PX Server(s) - Parsing Cursor', 12, 'PX Server(s) - Executing Cursor',
13, 'PX Server(s) - Preparing Transaction', 14, 'PX Server(s) - Joining Transaction', 15, 'PX Server(s) - Load Commit', 16, 'PX Server(s) - Aborting Transaction', 17, 'QC - Executing Child DFO', 18, 'QC - Executing Parent DFO', 'PX Step - ' || PX_STEP_ID) PX_STEP_ID, ADH.PX_STEP_ARG, ADH.PX_DFO_PAIR_ID, ADH.PX_DOP, ADH.PX_MIN_DOP, ADH.DFO_MOST_ACTIVE_IID, ADH.DFO_MOST_ACTIVE_SID, ADH.DFO_MOST_ACTIVE_COUNT, ADH.ACTIVITY_START, ADH.ACTIVITY_END, ADH.ACTIVITY_TYPE, ADH.OTHER_SQL_ACTIVITY_TYPE, ADH.EVENT_NAME, ADH.PLAN_LINE_ID, ADH.PLSQL_OBJECT_ID, ADH.PLSQL_SUBPROGRAM_ID, CASE WHEN PLSQL_ROWNUM = 1 AND ADH.PLSQL_OBJECT_ID IS NOT NULL THEN NVL((SELECT P.OWNER || '.' || P.OBJECT_NAME || DECODE(P.PROCEDURE_NAME, NULL, '', '.' || P.PROCEDURE_NAME) FROM DBA_PROCEDURES P WHERE P.OBJECT_ID = ADH.PLSQL_OBJECT_ID AND P.SUBPROGRAM_ID = ADH.PLSQL_SUBPROGRAM_ID), 'Unavailable') ELSE NULL END PLSQL_NAME, ADH.ACTIVITY_COUNT, ADH.BUCKET_ACTIVE_SECONDS, ADH.BUCKET_IDL
E_SECONDS, (CASE WHEN ADH.IS_MONITORED_SQL = 0 THEN ADH.ACTIVE_SECONDS WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.DFO_PAIR_CPU_HEIGHT >= :B34 THEN DECODE(ADH.ACTIVITY_TYPE, 'Cpu', (ADH.DFO_PAIR_ACTIVITY_HEIGHT / ADH.DFO_PAIR_CPU_HEIGHT) * ADH.DFO_PAIR_TOTAL_SECONDS, 0) WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.PX_DOP > :B34 THEN (ADH.DFO_PAIR_TOTAL_SECONDS * DECODE(ADH.ACTIVITY_TYPE, 'Cpu', ADH.DFO_PAIR_ACTIVITY_HEIGHT, (ADH.DFO_PAIR_ACTIVITY_HEIGHT * (:B34 - ADH.DFO_PAIR_CPU_HEIGHT)) / (ADH.DFO_PAIR_TOTAL_HEIGHT_ADJ - ADH.DFO_PAIR_CPU_HEIGHT))) / :B34 WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL THEN (ADH.DFO_PAIR_TOTAL_SECONDS * ADH.DFO_PAIR_ACTIVITY_HEIGHT) / ADH.PX_DOP ELSE ADH.ACTIVE_SECONDS END) RESP_TIME, (CASE WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.DFO_PAIR_IDLE_HEIGHT > 0 AND ADH.PX_DOP > :B34 THEN (ADH.DFO_PAIR_TOTAL_SECONDS * (ADH.DFO_PAIR_IDLE_HEIGHT * (:B34 - ADH.DFO_PAIR_CPU_HEIGHT)) / (ADH.DFO_PAIR_TOTAL_HEIGHT_ADJ - ADH.DFO_PAIR_CPU_HEIGHT)) / :B34 WH
EN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.DFO_PAIR_IDLE_HEIGHT > 0 THEN (ADH.DFO_PAIR_TOTAL_SECONDS * ADH.DFO_PAIR_IDLE_HEIGHT) / ADH.PX_DOP ELSE 0 END) DFO_PAIR_IDLE_RESP_TIME, ADH.DFO_PAIR_ACTIVITY_HEIGHT, ADH.DFO_PAIR_CPU_HEIGHT, ADH.DFO_PAIR_IDLE_HEIGHT, ADH.DFO_PAIR_TOTAL_HEIGHT, ADH.DFO_PAIR_CPU_ACTIVITY, ADH.DFO_PAIR_TOTAL_SECONDS FROM (SELECT ADH_1.*, (ROW_NUMBER() OVER(PARTITION BY ADH_1.PLSQL_OBJECT_ID, ADH_1.PLSQL_SUBPROGRAM_ID ORDER BY ADH_1.BUCKET_NUM, ADH_1.ACTIVITY_TYPE, ADH_1.EVENT_NAME)) PLSQL_ROWNUM, (ROW_NUMBER() OVER(PARTITION BY ADH_1.SQL ORDER BY ADH_1.BUCKET_NUM, ADH_1.ACTIVITY_TYPE, ADH_1.EVENT_NAME)) SQL_ROWNUM, (CASE WHEN ADH_1.PX_DFO_PAIR_ID IS NOT NULL AND (ADH_1.DFO_PAIR_TOTAL_HEIGHT < ADH_1.PX_DOP) AND (ADH_1.DFO_PAIR_CPU_HEIGHT < :B34 ) THEN ADH_1.PX_DOP - ADH_1.DFO_PAIR_TOTAL_HEIGHT ELSE 0 END) DFO_PAIR_IDLE_HEIGHT, (CASE WHEN ADH_1.PX_DFO_PAIR_ID IS NOT NULL AND (ADH_1.DFO_PAIR_TOTAL_HEIGHT < ADH_1.PX_DOP) AND (ADH_1.DFO_PAIR_
CPU_HEIGHT < :B34 ) THEN ADH_1.PX_DOP ELSE ADH_1.DFO_PAIR_TOTAL_HEIGHT END) DFO_PAIR_TOTAL_HEIGHT_ADJ FROM (SELECT ADH_0.*, (CASE WHEN ADH_0.DFO_PAIR_TOTAL_SECONDS > 0 THEN (ADH_0.DFO_PAIR_TOTAL_ACTIVITY * :B25 ) / ADH_0.DFO_PAIR_TOTAL_SECONDS ELSE 0 END) DFO_PAIR_TOTAL_HEIGHT, (CASE WHEN ADH_0.DFO_PAIR_TOTAL_SECONDS > 0 THEN (ADH_0.DFO_PAIR_CPU_ACTIVITY * :B25 ) / ADH_0.DFO_PAIR_TOTAL_SECONDS ELSE 0 END) DFO_PAIR_CPU_HEIGHT, (CASE WHEN ADH_0.PX_DFO_PAIR_ID IS NOT NULL AND ADH_0.DFO_PAIR_TOTAL_SECONDS > 0 THEN (ADH_0.ACTIVITY_COUNT * :B25 ) / ADH_0.DFO_PAIR_TOTAL_SECONDS ELSE 0 END) DFO_PAIR_ACTIVITY_HEIGHT FROM (SELECT AD3.*, (SUM(DECODE(AD3.PX_DFO_PAIR_ID, NULL, 0, AD3.ACTIVE_SECONDS)) OVER(PARTITION BY DECODE(AD3.PX_DFO_PAIR_ID, NULL, NULL, AD3.BUCKET_NUM), DECODE(AD3.PX_DFO_PAIR_ID, NULL, NULL, AD3.PX_STEP_ARG))) DFO_PAIR_TOTAL_SECONDS FROM (SELECT AD2.*, CASE WHEN AD2.IS_MONITORED_SQL = 0 THEN SQL_BUCKET_DISTINCT_SAMPLES * :B25 WHEN AD2.PX_ID IS NULL THE
N AD2.ACTIVITY_COUNT * :B25 WHEN AD2.BUCKET_PARALLEL_MON_ACTIVITY > 0 THEN (AD2.ACTIVITY_COUNT * AD2.BUCKET_PARALLEL_MON_SECONDS) / AD2.BUCKET_PARALLEL_MON_ACTIVITY ELSE 0 END ACTIVE_SECONDS, CASE WHEN AD2.BUCKET_INTERVAL > BUCKET_ACTIVE_SECONDS THEN AD2.BUCKET_INTERVAL - BUCKET_ACTIVE_SECONDS ELSE 0 END BUCKET_IDLE_SECONDS FROM (SELECT AD1.*, (AD1.BUCKET_SERIAL_MON_ACTIVITY * :B25 ) BUCKET_SERIAL_MON_SECONDS, (AD1.BUCKET_TOTAL_MON_ACTIVITY - AD1.BUCKET_SERIAL_MON_ACTIVITY) BUCKET_PARALLEL_MON_ACTIVITY, (AD1.BUCKET_ACTIVE_SECONDS - (AD1.BUCKET_OTHER_ACTIVITY + AD1.BUCKET_SERIAL_MON_ACTIVITY) * :B25 ) BUCKET_PARALLEL_MON_SECONDS, (AD1.BUCKET_OTHER_ACTIVITY * :B25 ) BUCKET_OTHER_SECONDS, DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, SUM(AD1.ACTIVITY_COUNT) OVER(PARTITION BY DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, AD1.BUCKET_NUM), AD1.PX_DFO_PAIR_ID)) DFO_PAIR_TOTAL_ACTIVITY, DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, SUM(DECODE(AD1.ACTIVITY_TYPE, 'Cpu', AD1.ACTIVITY_COUNT,
0)) OVER(PARTITION BY DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, AD1.BUCKET_NUM), AD1.PX_DFO_PAIR_ID)) DFO_PAIR_CPU_ACTIVITY FROM (SELECT AD01.*, NVL((SUM(DECODE(AD01.IS_MONITORED_SQL, 1, AD01.ACTIVITY_COUNT, NULL)) OVER(PARTITION BY AD01.BUCKET_NUM)), 0) BUCKET_TOTAL_MON_ACTIVITY, (NVL(SUM(CASE WHEN AD01.IS_MONITORED_SQL = 1 AND AD01.PX_ID IS NULL THEN AD01.ACTIVITY_COUNT ELSE NULL END) OVER(PARTITION BY AD01.BUCKET_NUM), 0)) BUCKET_SERIAL_MON_ACTIVITY, (NVL((SUM(DECODE(AD01.IS_MONITORED_SQL, 0, AD01.SQL_BUCKET_DISTINCT_SAMPLES, NULL)) OVER(PARTITION BY AD01.BUCKET_NUM)), 0)) BUCKET_OTHER_ACTIVITY, (NVL(AD01.BUCKET_DISTINCT_SAMPLES, 0) * :B25 ) BUCKET_ACTIVE_SECONDS, DECODE(AD01.BUCKET_NUM, :B27 , MOD(:B32 , :B26 ), :B26 ) BUCKET_INTERVAL FROM (SELECT AD0.ACTIVITY_BUCKET_NUM BUCKET_NUM, AD0.PX_ID, AD0.ACTIVITY_TYPE, AD0.OTHER_SQL_ACTIVITY_TYPE, AD0.EVENT_NAME, AD0.PLAN_LINE_ID, AD0.PX_STEP_ID, AD0.PX_STEP_ARG, AD0.PLSQL_OBJECT_ID, AD0.PLSQL_SUBPROGRAM_ID,
SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT, MIN(AD0.ACTIVITY_START) ACTIVITY_START, MAX(AD0.ACTIVITY_END) ACTIVITY_END, MAX(AD0.IS_MONITORED_SQL) IS_MONITORED_SQL, MAX(AD0.SQL) SQL, MAX(AD0.TOP_LEVEL_SQL_ID) TOP_LEVEL_SQL_ID, MAX(AD0.DBOP_NAME) DBOP_NAME, MAX(DECODE(AD0.DFO_MOST_ACTIVE_COUNT, NULL, NULL, AD0.DFO_MOST_ACTIVE_IID)) DFO_MOST_ACTIVE_IID, MAX(DECODE(AD0.DFO_MOST_ACTIVE_COUNT, NULL, NULL, AD0.DFO_MOST_ACTIVE_SID)) DFO_MOST_ACTIVE_SID, SUM(AD0.DFO_MOST_ACTIVE_COUNT) DFO_MOST_ACTIVE_COUNT, MAX(PX_DFO_PAIR_TYPE) PX_DFO_PAIR_TYPE, MAX(PX_DFO_PAIR_ID) PX_DFO_PAIR_ID, MAX(AD0.PX_DOP) PX_DOP, MIN(AD0.PX_MIN_DOP) PX_MIN_DOP, MAX(AD0.BUCKET_DISTINCT_SAMPLES) BUCKET_DISTINCT_SAMPLES, MAX(AD0.SQL_BUCKET_DISTINCT_SAMPLES) SQL_BUCKET_DISTINCT_SAMPLES FROM (SELECT AD00.*, (CASE WHEN AD00.IS_MONITORED_SQL = 1 AND (AD00.SESSION_ID != :B19 OR AD00.INST_ID != :B17 ) THEN AD00.PX_SERVER_GROUP END) PX_ID FROM ASH_DATA AD00 WHERE :B33 = 1 ) AD0 GROUP BY AD0.ACTIVITY_BUCKET_NUM,
AD0.PX_ID, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, AD0.OTHER_SQL_ACTIVITY_TYPE, AD0.PLAN_LINE_ID, AD0.PLSQL_OBJECT_ID, AD0.PLSQL_SUBPROGRAM_ID, AD0.PX_STEP_ID, AD0.PX_STEP_ARG ) AD01) AD1) AD2) AD3) ADH_0) ADH_1) ADH) SELECT /*+ no_monitor no_xml_query_rewrite */ XMLELEMENT( "sql_monitor_report", XMLATTRIBUTES(:B59 AS "version", TO_CHAR(:B58 , :B12 ) AS "sysdate"), XMLELEMENT( "report_parameters", NULL, CASE WHEN :B57 IS NOT NULL THEN XMLFOREST( :B57 AS "dbop_name", :B56 AS "dbop_exec_id") ELSE XMLFOREST( :B55 AS "sql_id", :B54 AS "sql_exec_id") END, XMLFOREST( :B53 AS "session_id", :B52 AS "session_serial", TO_CHAR(:B51 , :B12 ) AS "sql_exec_start", :B27 AS "bucket_count", TO_CHAR(:B50 , :B12 ) AS "interval_start", TO_CHAR(:B22 , :B12 ) AS "interval_end", DECODE(:B49 , 'Y', :B48 , NULL) AS "auto_refresh", :B47
AS "base_path"), CASE WHEN :B23 = 'Y' AND :B46 IS NOT NULL AND NOT (:B4 = 1 AND :B3 IS NULL AND :B2 IS NULL AND :B1 IS NULL) THEN XMLELEMENT( "parallel_filter", NULL, XMLFOREST( DECODE(:B4 , 1, 'yes', 'no') AS "qc", :B3 AS "server_group", :B2 AS "server_set", :B1 AS "server_number")) ELSE NULL END), CASE WHEN :B14 = 1 THEN XMLELEMENT( "derived_parameters_testing", NULL, XMLFOREST(:B11 AS "instance_id_low", :B10 AS "instance_id_high", :B26 AS "bucket_interval_sec", :B32 AS "interval_second", :B27 AS "bucket_calc_count", :B45 AS "bucket_calc_max_count", :B13 AS "sel_sqltext")) ELSE NULL END, (SELECT XMLCONCAT( CASE WHEN :B46 IS NULL AND :B60 IS NULL THEN XMLELEMENT( "target", XMLATTRIBUTES(:B17 AS "instance_id", :B19 AS "session_id", :B18 AS "session_serial", NVL2(:B6 , NULL, :B9 ) AS
"sql_id", NVL2(:B6 , NULL, TO_CHAR(:B8 , :B12 )) AS "sql_exec_start", NVL2(:B6 , NULL, :B7 ) AS "sql_exec_id", NVL2(:B6 , :B6 , NULL) AS "dbop_name", NVL2(:B6 , :B5 , NULL) AS "dbop_exec_id", NVL2(:B6 , TO_CHAR(:B8 , :B12 ), NULL) AS "dbop_exec_start", NVL2(:B6 , NULL, MAX_PLAN_HASH_VALUE) AS "sql_plan_hash", NVL2(:B6 , NULL, MAX_FULL_PLAN_HASH_VALUE) AS "sql_full_plan_hash", MAGG.DB_UNIQUE_NAME AS "db_unique_name", MAGG.PLATFORM_NAME AS "db_platform_name", MAGG.HOST_NAME AS "report_host_name"), NVL2(SUM_SERVERS_REQUESTED, XMLELEMENT( "servers_requested", NULL, SUM_SERVERS_REQUESTED), NULL), NVL2(SUM_SERVERS_ALLOCATED, XMLELEMENT( "servers_allocated", NULL, SUM_SERVERS_ALLOCATED), NULL), NVL2(MAX_USERID, XMLELEMENT( "user_id", NULL, MAX_USERID), NULL), NVL2(MAX_USERNAME, XMLELEMENT( "user", NULL
, MAX_USERNAME), NULL), NVL2(MAX_CON_ID, XMLELEMENT( "con_id", NULL, MAX_CON_ID), NULL), NVL2(MAX_CON_NAME, XMLELEMENT( "con_name", NULL, MAX_CON_NAME), NULL), NVL2(MAX_PROGRAM, XMLELEMENT( "program", NULL, MAX_PROGRAM), NULL), NVL2(MAX_MODULE, XMLELEMENT( "module", NULL, MAX_MODULE), NULL), NVL2(MAX_ACTION, XMLELEMENT( "action", NULL, MAX_ACTION), NULL), NVL2(MAX_SERVICE_NAME, XMLELEMENT( "service", NULL, MAX_SERVICE_NAME), NULL), NVL2(MAX_CLIENT_ID, XMLELEMENT( "client_id", NULL, MAX_CLIENT_ID), NULL), NVL2(MAX_CLIENT_INFO, XMLELEMENT( "client_info", NULL, MAX_CLIENT_INFO), NULL), NVL2(MAX_PL_ENTRY_OID, XMLELEMENT( "plsql_entry_object_id", NULL, MAX_PL_ENTRY_OID), NULL), NVL2(MAX_PL_ENTRY_PROGID, XMLELEMENT( "plsql_entry_subprogram_id", NULL, MAX_PL_ENTRY_PROGID), NULL), NVL2(MAX_PL_ENTRY_NAME, XMLELEMENT( "plsql_entry_name
", NULL, MAX_PL_ENTRY_NAME), NULL), NVL2(MAX_PL_OID, XMLELEMENT( "plsql_object_id", NULL, MAX_PL_OID), NULL), NVL2(MAX_PL_PROGID, XMLELEMENT( "plsql_subprogram_id", NULL, MAX_PL_PROGID), NULL), NVL2(MAX_PL_NAME, XMLELEMENT( "plsql_name", NULL, MAX_PL_NAME), NULL), CASE WHEN (:B13 = 0 OR :B6 IS NOT NULL) THEN NULL ELSE XMLELEMENT( "sql_fulltext", XMLATTRIBUTES(NVL2(SQL_VTEXT, 'Y', IS_FULL_TEXT) AS "is_full"), NVL2(SQL_VTEXT, SQL_VTEXT, SQLMON_TEXT)) END, XMLELEMENT( "status", NULL, MAX_STATUS), XMLELEMENT( "refresh_count", NULL, SUM_REFRESH_COUNT), XMLELEMENT( "first_refresh_time", NULL, TO_CHAR(MIN_FIRST_REFRESH_TIME, :B12 )), XMLELEMENT( "last_refresh_time", NULL, TO_CHAR(:B58 , :B12 )), XMLELEMENT( "duration", NULL, GREATEST(:B65 , LEAST(MAX_ELAPSED_TIME/1000000, 1), CEIL(MAX_QUEUING_TIME/1000000))), DECODE(MAX_RM_INFO, '00/00/0000 00
:00:00', NULL, XMLTYPE(SUBSTR(MAX_RM_INFO, 20))), CASE WHEN (:B63 = 'Y') THEN XMLELEMENT( "adaptive_plan", XMLATTRIBUTES(:B64 AS "is_final"), :B63 ) ELSE NULL END, NVL((SELECT XMLFOREST( XMLAGG( XMLELEMENT( "param", XMLATTRIBUTES(E.NAME AS "name"), DECODE(:B14 , 1, 'XXXX', E.VALUE)) ORDER BY E.NAME) AS "optimizer_env") SQL_ENV FROM GV$SQL_OPTIMIZER_ENV E WHERE E.INST_ID = :B17 AND E.SQL_ID = :B9 AND E.CHILD_ADDRESS = HEXTORAW(:B66 ) AND (DECODE(:B14 , 1, 'YES', E.ISDEFAULT) = 'NO' OR E.ID IN (2, 12, 24, 35, 36, 37, 246, 256, 257, 274, 275, 289, 290))), (SELECT XMLELEMENT( "optimizer_env", XMLATTRIBUTES('sys' AS "type"), XMLAGG( XMLELEMENT( "param", XMLATTRIBUTES(E.NAME AS "name"), DECODE(:B14 , 1, 'XXXX', E.VALUE)) ORDER BY E.NAME)) SYS_ENV FROM V$SYS_OPTIMIZER_ENV E WHERE (DECODE(:B14 , 1, 'YES', E.ISDEFAULT) = 'NO' OR E.ID IN (2, 12, 24, 35, 36, 37, 24
6, 256, 257, 274, 275, 289, 290)))) ) END, XMLELEMENT( "stats", XMLATTRIBUTES('monitor' AS "type"), DECODE(NVL(SUM_ELAPSED_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), SUM_ELAPSED_TIME)), DECODE(NVL(MAX_QUEUING_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MAX_QUEUING_TIME)), DECODE(NVL(SUM_CPU_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), SUM_CPU_TIME)), DECODE(NVL(SUM_USER_IO_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), SUM_USER_IO_WAIT_TIME)), DECODE(NVL(SUM_APPLICATION_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), SUM_APPLICATION_WAIT_TIME)), DECODE(NVL(SUM_CONCURRENCY_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLAT
TRIBUTES('concurrency_wait_time' AS "name"), SUM_CONCURRENCY_WAIT_TIME)), DECODE(NVL(SUM_CLUSTER_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), SUM_CLUSTER_WAIT_TIME)), DECODE(NVL(SUM_PLSQL_EXEC_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), SUM_PLSQL_EXEC_TIME)), DECODE(NVL(SUM_JAVA_EXEC_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), SUM_JAVA_EXEC_TIME)), DECODE(NVL(SUM_OTHER_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('other_wait_time' AS "name"), SUM_OTHER_WAIT_TIME)), DECODE(NVL(SUM_FETCHES, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), SUM_FETCHES)), DECODE(NVL(SUM_BUFFER_GETS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), SUM_
BUFFER_GETS)), DECODE(NVL(SUM_READ_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('disk_reads' AS "name"), SUM_READ_REQS)), DECODE(NVL(SUM_WRITE_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('direct_writes' AS "name"), SUM_WRITE_REQS)), DECODE(NVL(SUM_READ_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), SUM_READ_REQS)), DECODE(NVL(SUM_READ_BYTES, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), SUM_READ_BYTES)), DECODE(NVL(SUM_WRITE_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), SUM_WRITE_REQS)), DECODE(NVL(SUM_WRITE_BYTES, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), SUM_WRITE_BYTES)), CASE WHEN SUM_IO_INTER_BYTES IS NULL OR SUM_IO_BYTES = 0 OR SUM_IO_INTER_BYTES = SUM_IO_BYTES THEN NULL ELSE XMLELEMENT
( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(SUM_IO_BYTES / DECODE(SUM_IO_INTER_BYTES, 0, 1, SUM_IO_INTER_BYTES), 2)) END), CASE WHEN :B33 = 1 THEN (SELECT CASE WHEN SUM(ACTIVITY_COUNT) > 0 THEN XMLELEMENT( "activity_sampled", XMLAGG( XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME)) ELSE NULL END FROM (SELECT AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT FROM ASH_DATA AD0 GROUP BY AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1) ELSE NULL END, NVL2(MAX_ERROR_NUMBER, XMLELEMENT( "error", XMLATTRIBUTES(MAX_ERROR_NUMBER AS "number", MAX_ERROR_FACILITY AS "facility"), MAX_ERROR_MESSAGE), NULL), CASE WHEN :B62 = 1 AND MAGG.QC_HAS_BINDS_XML = 'Y' THEN (SELECT XMLTYPE(BINDS_XML) FROM GV$SQL_MONITOR MON WHERE MON.INST_ID = :B17
AND MON.KEY = MAGG.MAX_KEY AND MON.SID = MAGG.MAX_SESSION_ID AND MON.SQL_ID = :B9 AND MON.SQL_EXEC_START = :B8 AND MON.SQL_EXEC_ID = :B7 AND ROWNUM = 1) ELSE NULL END, CASE WHEN :B61 = 1 AND MAGG.QC_HAS_OTHER_XML = 'Y' THEN (SELECT XMLTYPE(OTHER_XML) FROM GV$SQL_MONITOR MON WHERE MON.INST_ID = MAGG.MAX_INST_ID AND MON.KEY = MAGG.MAX_KEY AND MON.SID = MAGG.MAX_SESSION_ID AND MON.SQL_ID = :B9 AND MON.SQL_EXEC_START = :B8 AND MON.SQL_EXEC_ID = :B7 AND ROWNUM = 1) ELSE NULL END) FROM (SELECT V.*, CASE WHEN :B13 = 2 AND IS_FULL_TEXT = 'N' AND :B46 IS NULL AND :B60 IS NULL THEN (SELECT SQL_FULLTEXT FROM GV$SQL SQ WHERE SQ.INST_ID BETWEEN :B11 AND :B10 AND SQ.SQL_ID = :B9 AND ROWNUM = 1) ELSE NULL END SQL_VTEXT FROM MONITOR_AGG V) MAGG), CASE WHEN :B44 = 1 THEN (SELECT CASE WHEN AT.ACTIVITY_COUNT > 0 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( :B41 AS "ash_missing_seconds", TO_CHAR(AT.ACTIVITY_START, :B12 ) AS "first_sample_time", TO_CHAR(AT.ACT
IVITY_END, :B12 ) AS "last_sample_time", ROUND((AT.ACTIVITY_END - AT.ACTIVITY_START) * 3600 * 24) + 1 AS "duration", AT.ACTIVITY_COUNT AS "count", AT.IMQ_COUNT AS "imq_count", AT.WAIT_COUNT AS "wait_count", AT.CPU_COUNT AS "cpu_count", DECODE(AT.OTHER_SQL_COUNT, 0, NULL, AT.OTHER_SQL_COUNT) AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), AT.ACTIVITY_TOTAL, AH.GLOB_ACTIVITY_HISTO) WHEN :B41 IS NOT NULL THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( DECODE( :B41 , -1, 'all', TO_CHAR( :B41 )) AS "ash_missing_seconds")) ELSE NULL END FROM (SELECT MIN(AD1.ACTIVITY_START) ACTIVITY_START, MAX(AD1.ACTIVITY_END) ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD1.IMQ_COUNT) IMQ_COUNT, SUM(AD1.WAIT_COUNT) WAIT_COUNT, SUM(AD1.CPU_COUNT) CPU_COUNT, SUM(AD1.OTHER_SQL_COUNT) OTHER_SQL_COUNT, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)||
AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG( XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_TOTAL FROM (SELECT AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(AD0.ACTIVITY_START) ACTIVITY_START, MAX(AD0.ACTIVITY_END) ACTIVITY_END, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTHER_SQL_COUNT FROM ASH_DATA AD0 GROUP BY AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1) AT, (SELECT CASE WHEN :B30 = 1 AND :B27 > 1 THEN XMLELEMENT( "activity_histogram", XMLATTRIBUTES( :B26 AS "bucket_interval", :B27 AS "bucket_count", TO_CHAR( :B20 , :B12 ) AS "start_time", TO_CHAR( :B22 , :B12 ) AS "end_time", ROUND(( :B22 - :B20 ) *3600*24) + 1 AS "duration"), XMLAGG( XMLELEMENT(
"bucket", XMLATTRIBUTES( AD2.BUCKET_NUM AS "number"), ACTIVITY_BUCKET) ORDER BY AD2.BUCKET_NUM)) ELSE NULL END GLOB_ACTIVITY_HISTO FROM (SELECT AD1.BUCKET_NUM, SUM(ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(IMQ_COUNT) IMQ_COUNT, SUM(WAIT_COUNT) WAIT_COUNT, SUM(CPU_COUNT) CPU_COUNT, SUM(OTHER_SQL_COUNT) OTHER_SQL_COUNT, MIN(AD1.ACTIVITY_START) ACTIVITY_START, MAX(AD1.ACTIVITY_END) ACTIVITY_END, MIN(AD1.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD1.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)|| AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG( XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_BUCKET FROM (SELECT AD0.ACTIVITY_BUCKET_NUM BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(AD0.ACTIVITY_START) ACTIVITY_START, MAX(AD0.ACTIVITY_END) ACTIVITY_END, SUM(AD0.
ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTHER_SQL_COUNT, MIN(AD0.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD0.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END FROM ASH_DATA AD0 GROUP BY AD0.ACTIVITY_BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1 GROUP BY AD1.BUCKET_NUM) AD2) AH) ELSE NULL END, CASE WHEN :B33 = 1 THEN (SELECT CASE WHEN AH.ACTIVITY_COUNT > 0 THEN XMLELEMENT( "activity_detail", XMLATTRIBUTES( TO_CHAR( :B20 , :B12 ) AS "start_time", TO_CHAR( :B22 , :B12 ) AS "end_time", :B41 AS "ash_missing_seconds", TO_CHAR(AH.ACTIVITY_START, :B12 ) AS "first_sample_time", TO_CHAR(AH.ACTIVITY_END, :B12 ) AS "last_sample_time", ROUND((AH.ACTIVITY_END - AH.ACTIVITY_START) * 3600 * 24) + 1 AS "duration", :B25 AS "sample_interval", :B26 AS "bucket_interval", :B27 AS
"bucket_count", ROUND((:B22 - :B20 ) *3600*24) + 1 AS "bucket_duration", :B40 AS "cpu_cores", :B34 AS "total_cpu_cores", :B39 AS "hyperthread"), AH.GLOB_ACTIVITY_HISTO) WHEN :B41 IS NOT NULL THEN XMLELEMENT( "activity_detail", XMLATTRIBUTES( DECODE( :B41 , -1, 'all', TO_CHAR( :B41 )) AS "ash_missing_seconds")) ELSE NULL END FROM (SELECT MIN(AD2.ACTIVITY_START) ACTIVITY_START, MAX(AD2.ACTIVITY_END) ACTIVITY_END, SUM(AD2.ACTIVITY_COUNT) ACTIVITY_COUNT, XMLAGG( XMLELEMENT( "bucket", XMLATTRIBUTES( AD2.BUCKET_NUM AS "number"), ACTIVITY_BUCKET_XML) ORDER BY AD2.BUCKET_NUM) GLOB_ACTIVITY_HISTO FROM (SELECT AD1.BUCKET_NUM, MIN(AD1.ACTIVITY_START) ACTIVITY_START, MAX(AD1.ACTIVITY_END) ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) ACTIVITY_COUNT, MAX(AD1.BUCKET_IDLE_SECONDS) BUCKET_IDLE_SECONDS, XMLAGG( XMLCONCAT( CASE WHEN AD1.DFO_PAIR_IDLE_RESP_TIME != 0 AND DFO_PAIR_ROWNUM = 1 THEN XMLELEMENT
( "activity", XMLATTRIBUTES( 'Parallel Skew' AS "class", AD1.PX_STEP_ARG AS "line", AD1.PX_ID AS "px", ROUND(AD1.DFO_PAIR_IDLE_RESP_TIME, 2) AS "rt"), 0) ELSE NULL END, XMLELEMENT( "activity", XMLATTRIBUTES( NVL(AD1.OTHER_SQL, AD1.RPI) AS "sql", AD1.NON_SQL AS "non_sql", AD1.CLASS AS "class", AD1.OTHER_SQL_CLASS AS "other_sql_class", AD1.EVENT AS "event", AD1.PLAN_LINE_ID AS "line", NVL2(AD1.PLSQL_OBJECT_ID, AD1.PLSQL_OBJECT_ID||'.'|| AD1.PLSQL_SUBPROGRAM_ID, NULL) AS "plsql_id", AD1.PLSQL_NAME AS "plsql_name", CASE WHEN AD1.SQL_ROWNUM = 1 THEN AD1.TOP_LEVEL_SQL_ID END AS "top_sql_id", CASE WHEN AD1.DBOP_NAME IS NOT NULL THEN AD1.DBOP_NAME END AS "dbop_name", CASE WHEN AD1.DFO_MOST_ACTIVE_IID IS NOT NULL AND :B67 = 'Y' THEN AD1.DFO_MOST_ACTIVE_IID END AS "skew_iid", DECODE(AD1.DFO_MOST_ACTIVE_COUN
T, NULL, NULL, AD1.DFO_MOST_ACTIVE_SID) AS "skew_sid", AD1.DFO_MOST_ACTIVE_COUNT AS "skew_count", DECODE(AD1.PX_DOP, :B28 , NULL, AD1.PX_DOP) AS "dop", DECODE(AD1.PX_DOP, AD1.PX_MIN_DOP, NULL, AD1.PX_MIN_DOP) AS "min_dop", AD1.PX_ID AS "px", AD1.PX_STEP_ID AS "step", AD1.PX_STEP_ARG AS "arg", DECODE(AD1.ACTIVITY_COUNT, AD1.RESP_TIME, NULL, ROUND(AD1.RESP_TIME, 2)) AS "rt"), AD1.ACTIVITY_COUNT)) ORDER BY AD1.PX_STEP_ID, AD1.PX_STEP_ARG, AD1.DFO_PAIR_ROWNUM) ACTIVITY_BUCKET_XML FROM (SELECT AD01.*, CASE WHEN AD01.ACTIVITY_TYPE != 'Other SQL Execution' AND AD01.ACTIVITY_TYPE != 'Non SQL' THEN AD01.ACTIVITY_TYPE END CLASS, CASE WHEN (AD01.ACTIVITY_TYPE = 'Other SQL Execution' OR AD01.ACTIVITY_TYPE = 'Non SQL') THEN AD01.OTHER_SQL_ACTIVITY_TYPE END OTHER_SQL_CLASS, CASE WHEN AD01.ACTIVITY_TYPE != 'Other SQL Execution' AND AD01.ACTIVITY_TYPE != 'Non SQL' THEN AD01.EVENT_NAME END EVENT, C
ASE WHEN AD01.SQL IN ('this', 'anonymous') THEN NULL ELSE AD01.SQL END RPI, DECODE(AD01.ACTIVITY_TYPE, 'Other SQL Execution', SUBSTR(AD01.EVENT_NAME, 9), NULL) OTHER_SQL, DECODE(AD01.ACTIVITY_TYPE, 'Non SQL', AD01.EVENT_NAME, NULL) NON_SQL, ROW_NUMBER() OVER(PARTITION BY AD01.BUCKET_NUM, AD01.PX_DFO_PAIR_ID ORDER BY AD01.ACTIVITY_TYPE, AD01.EVENT_NAME, AD01.PLAN_LINE_ID) DFO_PAIR_ROWNUM FROM RESPONSE_TIME_DATA AD01) AD1 GROUP BY AD1.BUCKET_NUM) AD2) AH) ELSE NULL END, CASE WHEN :B23 = 'Y' THEN (SELECT XMLELEMENT( "parallel_info", XMLATTRIBUTES( :B17 AS "qc_instance_id", MAX_PX_QCSID AS "qc_session_id", MAX_PX_IS_CROSS_INSTANCE AS "is_cross_instance", MAX_PX_DOP AS "dop", MAX_PX_DOP_INSTANCES AS "max_dop_instances", DIST_INST_COUNT AS "inst_count", DIST_PX_GROUP_COUNT AS "server_group_count", DIST_PX_SET_COUNT AS "server_set_count"), CASE WHEN :B69 = 1 THEN PX_SESSIONS ELSE
NULL END, CASE WHEN :B67 = 'Y' THEN DECODE(:B68 , 1, PX_INSTANCES, NULL) ELSE NULL END) FROM (SELECT MAX_PX_QCSID, MAX_PX_DOP, MAX_PX_DOP_INSTANCES, MAX_PX_IS_CROSS_INSTANCE, SUM_SERVERS_REQUESTED, SUM_SERVERS_ALLOCATED, DIST_INST_COUNT, DIST_PX_GROUP_COUNT, DIST_PX_SET_COUNT, (SELECT XMLELEMENT( "sessions", XMLATTRIBUTES(MAX(PX_SESSION.ACTIVITY_COUNT) AS "max_activity_count", MAX(PX_SESSION.IMQ_COUNT) AS "max_imq_count", MAX(PX_SESSION.CPU_COUNT) AS "max_cpu_count", MAX(PX_SESSION.WAIT_COUNT) AS "max_wait_count", MAX(PX_SESSION.OTHER_SQL_COUNT) AS "max_other_sql_count", MAX(PX_SESSION.MAX_IO_REQS) AS "max_io_reqs", MAX(PX_SESSION.MAX_IO_BYTES) AS "max_io_bytes", MAX(PX_SESSION.MAX_BUFFER_GETS) AS "max_buffer_gets", MAX(PX_SESSION.MAX_ELAPSED_TIME) AS "max_elapsed_time"), XMLAGG(PX_SESSION.PX_SESSION_XML ORDER BY PX_SERVER_GROUP NULLS FIRST, PX_SERVER_SET, PX_SER
VER#)) FROM (SELECT PX_SERVER_GROUP, PX_SERVER_SET, PX_SERVER#, MAX(PI.MAX_ELAPSED_TIME) MAX_ELAPSED_TIME, MAX(PI.MAX_IO_REQS) MAX_IO_REQS, MAX(PI.MAX_IO_BYTES) MAX_IO_BYTES, MAX(PI.MAX_BUFFER_GETS) MAX_BUFFER_GETS, SUM(PI.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(PI.IMQ_COUNT) IMQ_COUNT, SUM(PI.WAIT_COUNT) WAIT_COUNT, SUM(PI.CPU_COUNT) CPU_COUNT, SUM(PI.OTHER_SQL_COUNT) OTHER_SQL_COUNT, XMLELEMENT( "session", XMLATTRIBUTES( INST_ID AS "inst_id", PROCESS_NAME AS "process_name", SID AS "session_id", SESSION_SERIAL# AS "session_serial", PX_SERVER_GROUP AS "server_group", PX_SERVER_SET AS "server_set", PX_SERVER# AS "server_num"), XMLELEMENT( "stats", XMLATTRIBUTES( 'monitor' AS "type"), NVL2(MAX(ELAPSED_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MAX(ELAPSED_TIME)), NULL), NVL2(MAX(QUEUING_TIME), XMLELEMENT( "stat"
, XMLATTRIBUTES('queuing_time' AS "name"), MAX(QUEUING_TIME)), NULL), NVL2(MAX(CPU_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MAX(CPU_TIME)), NULL), NVL2(MAX(USER_IO_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MAX(USER_IO_WAIT_TIME)), NULL), NVL2(MAX(APPLICATION_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MAX(APPLICATION_WAIT_TIME)), NULL), NVL2(MAX(CONCURRENCY_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('concurrency_wait_time' AS "name"), MAX(CONCURRENCY_WAIT_TIME)), NULL), NVL2(MAX(CLUSTER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MAX(CLUSTER_WAIT_TIME)), NULL), NVL2(MAX(PLSQL_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MAX(PLSQL_EXEC_TIME)), NULL), NVL2(MAX(JAVA
_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MAX(JAVA_EXEC_TIME)), NULL), NVL2(MAX(OTHER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES( 'other_wait_time' AS "name"), MAX(OTHER_WAIT_TIME)), NULL), NVL2(MAX(FETCHES), XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MAX(FETCHES)), NULL), NVL2(MAX(BUFFER_GETS), XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), MAX(BUFFER_GETS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('disk_reads' AS "name"), MAX(READ_REQS)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('direct_writes' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MAX(READ_REQS)), NULL), NVL2(MAX(READ_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES
('read_bytes' AS "name"), MAX(READ_BYTES)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(WRITE_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MAX(WRITE_BYTES)), NULL), CASE WHEN MAX(IO_INTER_BYTES) IS NULL OR NVL(MAX(IO_BYTES), 0) = 0 OR MAX(IO_INTER_BYTES) = MAX(IO_BYTES) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MAX(IO_BYTES) / DECODE(MAX(IO_INTER_BYTES), 0, 1, MAX(IO_INTER_BYTES)), 2)) END), CASE WHEN SUM(PI.ACTIVITY_COUNT) > 0 AND :B33 = 1 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( TO_CHAR(MIN(PI.ACTIVITY_START), :B12 ) AS "first_sample_time", TO_CHAR(MAX(PI.ACTIVITY_END), :B12 ) AS "last_sample_time", ROUND((MAX(PI.ACTIVITY_END) - MIN(PI.ACTIVITY_START)) * 3600 * 24) + 1 AS "duration", SU
M(PI.ACTIVITY_COUNT) AS "count", SUM(PI.IMQ_COUNT) AS "imq_count", SUM(PI.CPU_COUNT) AS "cpu_count", SUM(PI.WAIT_COUNT) AS "wait_count", SUM(PI.OTHER_SQL_COUNT)AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), XMLAGG( NVL2(ACTIVITY_TYPE, XMLELEMENT( "activity", XMLATTRIBUTES( PI.ACTIVITY_TYPE AS "class", PI.EVENT_NAME AS "event"), ACTIVITY_COUNT), NULL) ORDER BY PI.ACTIVITY_TYPE, PI.EVENT_NAME)) ELSE NULL END, CASE WHEN :B61 = 1 AND PI.HAS_OTHER_XML = 'Y' THEN (SELECT XMLTYPE(OTHER_XML) FROM GV$SQL_MONITOR MON WHERE MON.INST_ID = PI.INST_ID AND MON.KEY = PI.KEY AND MON.SID = PI.SID AND MON.SQL_ID = :B9 AND MON.SQL_EXEC_START = :B8 AND MON.SQL_EXEC_ID = :B7 AND ROWNUM = 1) ELSE NULL END) PX_SESSION_XML FROM (SELECT MO.HAS_OTHER_XML, MO.KEY, MO.INST_ID, DECODE(MO.PROCESS_NAME, 'ora', 'PX Coordinator', MO.PROCESS_NAME) PROCESS_NAME, MO.SID, MO.SESSION_
SERIAL#, MO.PX_SERVER_GROUP, MO.PX_SERVER_SET, MO.PX_SERVER#, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME, MAX(MO.IO_REQS) MAX_IO_REQS, MAX(MO.IO_BYTES) MAX_IO_BYTES, MAX(MO.BUFFER_GETS) MAX_BUFFER_GETS, MAX(MO.ELAPSED_TIME) MAX_ELAPSED_TIME, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.ACTIVITY_COUNT)) ACTIVITY_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.IMQ_COUNT)) IMQ_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.WAIT_COUNT)) WAIT_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.CPU_COUNT)) CPU_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.OTHER_SQL_COUNT)) OTHER_SQL_COUNT, MIN(ASH0.ACTIVITY_START) ACTIVITY_START, MAX(ASH0.ACTIVITY_END) ACTIVITY_END, MAX(DECODE(MO.ELAPSED_TIME, 0, NULL, MO.ELAPSED_TIME)) ELAPSED_TIME, MAX(DECODE(MO.QUEUING_TIME, 0, NULL, MO.QUEUING_TIME)) QUEUING_TIME, MAX(DECODE(MO.CPU_TIME, 0, NULL, CPU_TIME)) CPU_TIME, MAX(DECODE(MO.FETCHES, 0, NULL, FETCHES)) FETCHES, MAX(DECODE(MO.BUF
FER_GETS, 0, NULL, MO.BUFFER_GETS)) BUFFER_GETS, MAX(DECODE(MO.IO_INTER_BYTES, 0, NULL, MO.IO_INTER_BYTES)) IO_INTER_BYTES, MAX(DECODE(MO.READ_REQS, 0, NULL, MO.READ_REQS)) READ_REQS, MAX(DECODE(MO.READ_BYTES, 0, NULL, MO.READ_BYTES)) READ_BYTES, MAX(DECODE(MO.WRITE_REQS, 0, NULL, MO.WRITE_REQS)) WRITE_REQS, MAX(DECODE(MO.WRITE_BYTES, 0, NULL, MO.WRITE_BYTES)) WRITE_BYTES, MAX(DECODE(MO.IO_BYTES, 0, NULL, MO.IO_BYTES)) IO_BYTES, MAX(DECODE(MO.APPLICATION_WAIT_TIME, 0, NULL, MO.APPLICATION_WAIT_TIME)) APPLICATION_WAIT_TIME, MAX(DECODE(MO.CONCURRENCY_WAIT_TIME, 0, NULL, MO.CONCURRENCY_WAIT_TIME)) CONCURRENCY_WAIT_TIME, MAX(DECODE(MO.CLUSTER_WAIT_TIME, 0, NULL, MO.CLUSTER_WAIT_TIME)) CLUSTER_WAIT_TIME, MAX(DECODE(MO.USER_IO_WAIT_TIME, 0, NULL, MO.USER_IO_WAIT_TIME)) USER_IO_WAIT_TIME, MAX(DECODE(PLSQL_EXEC_TIME, 0, NULL, PLSQL_EXEC_TIME)) PLSQL_EXEC_TIME, MAX(DECODE(MO.JAVA_EXEC_TIME, 0, NULL, MO.JAVA_EXEC_TIME)) JAVA_EXEC_TIME, MAX(DECO
DE(MO.OTHER_WAIT_TIME, 0, NULL, MO.OTHER_WAIT_TIME)) OTHER_WAIT_TIME FROM MONITOR_DATA MO, (SELECT ASH1.INST_ID, ASH1.SESSION_ID, ASH1.ACTIVITY_TYPE, ASH1.EVENT_NAME, SUM(ASH1.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(ASH1.IMQ_COUNT) IMQ_COUNT, SUM(ASH1.WAIT_COUNT) WAIT_COUNT, SUM(ASH1.CPU_COUNT) CPU_COUNT, SUM(ASH1.OTHER_SQL_COUNT)OTHER_SQL_COUNT, MIN(ASH1.ACTIVITY_START) ACTIVITY_START, MAX(ASH1.ACTIVITY_END) ACTIVITY_END FROM ASH_DATA ASH1 GROUP BY ASH1.INST_ID, ASH1.SESSION_ID, ASH1.ACTIVITY_TYPE, ASH1.EVENT_NAME) ASH0 WHERE MO.INST_ID = ASH0.INST_ID(+) AND MO.SID = ASH0.SESSION_ID(+) AND (:B69 = 1 OR :B68 = 1) GROUP BY MO.INST_ID, MO.KEY, MO.HAS_OTHER_XML, MO.PROCESS_NAME, MO.SID, MO.SESSION_SERIAL#, MO.PX_SERVER_GROUP, MO.PX_SERVER_SET, MO.PX_SERVER#, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME) PI WHERE (:B69 = 1) GROUP BY PI.INST_ID, PI.KEY, PI.HAS_OTHER_XML, PI.SID, PI.PROCESS_NAME, PI.SESSION_SERIAL#, PI.PX_SERVER_GROUP, PI.PX_SERVER_SET, PI.PX_SERVER#) P
X_SESSION) PX_SESSIONS, (SELECT XMLELEMENT( "instances", XMLATTRIBUTES( MAX(PX_INSTANCE.ACTIVITY_COUNT) AS "max_activity_count", MAX(PX_INSTANCE.IMQ_COUNT) AS "max_imq_count", MAX(PX_INSTANCE.CPU_COUNT) AS "max_cpu_count", MAX(PX_INSTANCE.WAIT_COUNT) AS "max_wait_count", MAX(PX_INSTANCE.OTHER_SQL_COUNT) AS "max_other_sql_count", MAX(PX_INSTANCE.ELAPSED_TIME) AS "max_elapsed_time", MAX(PX_INSTANCE.BUFFER_GETS) AS "max_buffer_gets", MAX(PX_INSTANCE.IO_REQS) AS "max_io_reqs", MAX(PX_INSTANCE.IO_BYTES) AS "max_io_bytes"), XMLAGG(PX_INSTANCE.PX_INSTANCES_XML ORDER BY INST_ID)) FROM (SELECT PI.INST_ID, MAX(PI.ELAPSED_TIME) ELAPSED_TIME, MAX(PI.IO_REQS) IO_REQS, MAX(PI.IO_BYTES) IO_BYTES, MAX(PI.BUFFER_GETS) BUFFER_GETS, SUM(PI.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(PI.IMQ_COUNT) IMQ_COUNT, SUM(PI.WAIT_COUNT) WAIT_COUNT, SUM(PI.CPU_COUNT) CPU_COUNT, SUM(PI.OTHER_SQL_COUNT) OTHE
R_SQL_COUNT, XMLELEMENT( "instance", XMLATTRIBUTES( INST_ID AS "inst_id"), XMLELEMENT( "stats", XMLATTRIBUTES( 'monitor' AS "type"), NVL2(MAX(ELAPSED_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MAX(ELAPSED_TIME)), NULL), NVL2(MAX(QUEUING_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MAX(QUEUING_TIME)), NULL), NVL2(MAX(CPU_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MAX(CPU_TIME)), NULL), NVL2(MAX(USER_IO_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MAX(USER_IO_WAIT_TIME)), NULL), NVL2(MAX(APPLICATION_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MAX(APPLICATION_WAIT_TIME)), NULL), NVL2(MAX(CONCURRENCY_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('concurrency_wait_time' AS
"name"), MAX(CONCURRENCY_WAIT_TIME)), NULL), NVL2(MAX(CLUSTER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MAX(CLUSTER_WAIT_TIME)), NULL), NVL2(MAX(PLSQL_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MAX(PLSQL_EXEC_TIME)), NULL), NVL2(MAX(JAVA_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MAX(JAVA_EXEC_TIME)), NULL), NVL2(MAX(OTHER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES( 'other_wait_time' AS "name"), MAX(OTHER_WAIT_TIME)), NULL), NVL2(MAX(FETCHES), XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MAX(FETCHES)), NULL), NVL2(MAX(BUFFER_GETS), XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), MAX(BUFFER_GETS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('disk_reads' AS "
name"), MAX(READ_REQS)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('direct_writes' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MAX(READ_REQS)), NULL), NVL2(MAX(READ_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), MAX(READ_BYTES)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(WRITE_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MAX(WRITE_BYTES)), NULL), CASE WHEN MAX(IO_INTER_BYTES) IS NULL OR NVL(MAX(IO_BYTES), 0) = 0 OR MAX(IO_INTER_BYTES) = MAX(IO_BYTES) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MAX(IO_BYTES)/ DECODE(MAX(IO_INTER_BYTES), 0, 1, MAX(IO_INTER_BYTES)), 2)) E
ND), CASE WHEN :B33 = 1 AND SUM(PI.ACTIVITY_COUNT) > 0 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( TO_CHAR(MIN(PI.ACTIVITY_START), :B12 ) AS "start_time", TO_CHAR(MAX(PI.ACTIVITY_END), :B12 ) AS "end_time", ROUND((MAX(PI.ACTIVITY_END) - MIN(PI.ACTIVITY_START)) * 3600 * 24) + 1 AS "duration", SUM(PI.ACTIVITY_COUNT) AS "count", SUM(PI.IMQ_COUNT) AS "imq_count", SUM(PI.WAIT_COUNT) AS "wait_count", SUM(PI.CPU_COUNT) AS "cpu_count", SUM(PI.OTHER_SQL_COUNT) AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), XMLAGG( NVL2(ACTIVITY_TYPE, XMLELEMENT( "activity", XMLATTRIBUTES( PI.ACTIVITY_TYPE AS "class", PI.EVENT_NAME AS "event"), ACTIVITY_COUNT), NULL) ORDER BY PI.ACTIVITY_TYPE, PI.EVENT_NAME)) ELSE NULL END) PX_INSTANCES_XML FROM (SELECT MO.INST_ID, ASH.ACTIVITY_TYPE, ASH.EVENT_NAME, ASH.ACTIVITY_COUNT, A
SH.IMQ_COUNT, ASH.WAIT_COUNT, ASH.CPU_COUNT, ASH.OTHER_SQL_COUNT, ASH.ACTIVITY_START, ASH.ACTIVITY_END, MO.ELAPSED_TIME, MO.QUEUING_TIME, MO.CPU_TIME, MO.APPLICATION_WAIT_TIME, MO.CONCURRENCY_WAIT_TIME, MO.CLUSTER_WAIT_TIME, MO.USER_IO_WAIT_TIME, MO.PLSQL_EXEC_TIME, MO.JAVA_EXEC_TIME, MO.OTHER_WAIT_TIME, MO.FETCHES, MO.BUFFER_GETS, MO.IO_INTER_BYTES, MO.IO_BYTES, MO.READ_REQS, MO.READ_BYTES, MO.WRITE_REQS, MO.WRITE_BYTES, MO.IO_REQS FROM (SELECT MO0.INST_ID, SUM(MO0.ELAPSED_TIME) ELAPSED_TIME, SUM(MO0.QUEUING_TIME) QUEUING_TIME, SUM(MO0.CPU_TIME) CPU_TIME, SUM(MO0.FETCHES) FETCHES, SUM(MO0.BUFFER_GETS) BUFFER_GETS, SUM(MO0.IO_INTER_BYTES) IO_INTER_BYTES, SUM(MO0.IO_BYTES) IO_BYTES, SUM(MO0.READ_REQS) READ_REQS, SUM(MO0.READ_BYTES) READ_BYTES, SUM(MO0.WRITE_REQS) WRITE_REQS, SUM(MO0.WRITE_BYTES) WRITE_BYTES, SUM(MO0.IO_REQS) IO_REQS, SUM(MO0.APPLICATION_WAIT_TIME) APPLICATION_WAIT_TIME, SUM(MO0.CONCURRENCY_WAIT_TIME) CONCURRENCY_WAIT_TIME, SUM(MO0.
CLUSTER_WAIT_TIME) CLUSTER_WAIT_TIME, SUM(MO0.USER_IO_WAIT_TIME) USER_IO_WAIT_TIME, SUM(MO0.PLSQL_EXEC_TIME) PLSQL_EXEC_TIME, SUM(MO0.JAVA_EXEC_TIME) JAVA_EXEC_TIME, SUM(MO0.OTHER_WAIT_TIME) OTHER_WAIT_TIME FROM MONITOR_DATA MO0 GROUP BY MO0.INST_ID) MO, (SELECT ASH0.INST_ID, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME, SUM(ASH0.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(ASH0.IMQ_COUNT) IMQ_COUNT, SUM(ASH0.WAIT_COUNT) WAIT_COUNT, SUM(ASH0.CPU_COUNT) CPU_COUNT, SUM(ASH0.OTHER_SQL_COUNT) OTHER_SQL_COUNT, MIN(ASH0.ACTIVITY_START) ACTIVITY_START, MAX(ASH0.ACTIVITY_END) ACTIVITY_END FROM ASH_DATA ASH0 GROUP BY ASH0.INST_ID, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME) ASH, MONITOR_AGG WHERE MO.INST_ID = ASH.INST_ID(+) AND MONITOR_AGG.DIST_INST_COUNT > 0 ) PI GROUP BY PI.INST_ID)PX_INSTANCE) PX_INSTANCES FROM MONITOR_AGG)) ELSE NULL END, XPLAN_XML, CASE WHEN :B43 = 1 THEN (SELECT XMLELEMENT( "plan_monitor", XMLATTRIBUTES(MAX(PLI.MAX_LINE_ACTIVITY_COUNT) AS "max_activity_count
", MAX(PLI.OVERALL_MAX_IO_REQS) AS "max_io_reqs", MAX(PLI.OVERALL_MAX_IO_BYTES) AS "max_io_bytes", MAX(PLI.MAX_LINE_IMQ_COUNT) AS "max_imq_count", MAX(PLI.MAX_LINE_CPU_COUNT) AS "max_cpu_count", MAX(PLI.MAX_LINE_WAIT_COUNT) AS "max_wait_count", MAX(PLI.MAX_LINE_OTHER_SQL_COUNT) AS "max_other_sql_count"), XMLAGG( XMLELEMENT( "operation", XMLATTRIBUTES( PLI.PLAN_LINE_ID AS "id", PLI.PARENT_ID AS "parent_id", PLI.OPERATION AS "name", PLI.OPTIONS AS "options", PLI.DEPTH AS "depth", PLI.POSITION AS "position", PLI.INACTIVE AS "skp", PLI.PX_TYPE AS "px_type"), NVL2(PLI.OBJECT_NAME, XMLELEMENT( "object", XMLATTRIBUTES(PLI.OBJECT_TYPE AS "type"), XMLFOREST(PLI.OBJECT_OWNER AS "owner"), XMLFOREST(PLI.OBJECT_NAME AS "name")), NULL), XMLFOREST(PLI.PARTITION_START AS "partition_s
tart", PLI.PARTITION_STOP AS "partition_stop"), CASE WHEN PLI.CARDINALITY IS NULL AND PLI.BYTES IS NULL AND PLI.COST IS NULL AND PLI.TEMP_SPACE IS NULL AND PLI.TIME IS NULL THEN NULL ELSE XMLELEMENT( "optimizer", NULL, NVL2(PLI.CARDINALITY, XMLFOREST(PLI.CARDINALITY AS "cardinality"), NULL), NVL2(PLI.BYTES, XMLFOREST(PLI.BYTES AS "bytes"), NULL), NVL2(PLI.COST, XMLFOREST(PLI.COST AS "cost"), NULL), NVL2(PLI.CPU_COST, XMLFOREST(PLI.CPU_COST AS "cpu_cost"), NULL), NVL2(PLI.IO_COST, XMLFOREST(PLI.IO_COST AS "io_cost"), NULL), NVL2(PLI.TEMP_SPACE, XMLFOREST(PLI.TEMP_SPACE AS "temp"), NULL), NVL2(PLI.TIME, XMLFOREST(PLI.TIME AS "time"), NULL)) END, XMLELEMENT( "stats", XMLATTRIBUTES('plan_monitor' AS "type"), NVL2(PLI.FIRST_MOVE_TIME, XMLELEMENT( "stat", XMLATTRIBUTES('first_active' AS "name"), TO_CHAR(FIRST_MOVE_TIME, :B12 )),
NULL), CASE WHEN PLI.FIRST_MOVE_TIME != PLI.FIRST_CHANGE_TIME THEN XMLELEMENT( "stat", XMLATTRIBUTES('first_row' AS "name"), TO_CHAR(FIRST_CHANGE_TIME, :B12 )) ELSE NULL END, NVL2(PLI.LAST_MOVE_TIME, XMLELEMENT( "stat", XMLATTRIBUTES('last_active' AS "name"), TO_CHAR(LAST_MOVE_TIME, :B12 )), NULL), CASE WHEN (PLI.FIRST_MOVE_TIME IS NULL OR PLI.LAST_MOVE_TIME IS NULL) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('duration' AS "name"), ROUND((LAST_MOVE_TIME - FIRST_MOVE_TIME) * 3600 * 24)+1) END, CASE WHEN (PLI.OVERALL_LAST_MOVE_TIME IS NULL OR PLI.LAST_MOVE_TIME IS NULL) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('from_most_recent' AS "name"), ROUND((PLI.OVERALL_LAST_MOVE_TIME - PLI.LAST_MOVE_TIME) * 3600 * 24)) END, NVL2(PLI.LAST_MOVE_TIME, XMLELEMENT( "stat", XMLATTRIBUTES( 'from_sql_exec_start' AS "name"), ROUND( (FIRST_MOVE_TIME - :B8 ) * 3600*24)), NU
LL), NVL2(PLI.PERCENT_COMPLETE, XMLELEMENT( "stat", XMLATTRIBUTES('percent_complete' AS "name"), PLI.PERCENT_COMPLETE), NULL), NVL2(PLI.TIME_REMAINING, XMLELEMENT( "stat", XMLATTRIBUTES('time_left' AS "name"), PLI.TIME_REMAINING), NULL), CASE WHEN PLI.HAS_EXECUTED = 1 THEN XMLELEMENT( "stat", XMLATTRIBUTES('starts' AS "name"), PLI.STARTS) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.HAS_EXECUTED = 1 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_starts' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_STARTS/1000000), 10000), NULL) AS "iid", MOD(MAX_STARTS, 1000000) AS "sid"), TRUNC(PLI.MAX_STARTS/10000000000)) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.HAS_EXECUTED = 1 THEN XMLELEMENT( "stat", XMLATTRIBUTES('dop' AS "name"), PLI.DOP) ELSE NULL END, CASE WHEN NEED_ROWS IS NOT NULL AND PLI.FIRST_MOVE_TIME IS NOT NULL THEN XMLELEMENT( "s
tat", XMLATTRIBUTES('cardinality' AS "name"), PLI.OUTPUT_ROWS) ELSE NULL END, CASE WHEN PLI.NEED_ROWS IS NOT NULL AND PLI.DOP > 0 AND PLI.MAX_OUTPUT_ROWS IS NOT NULL AND (PLI.FIRST_MOVE_TIME IS NOT NULL) THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_card' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_OUTPUT_ROWS/1000000), 10000), NULL) AS "iid", MOD(MAX_OUTPUT_ROWS, 1000000) AS "sid"), TRUNC(PLI.MAX_OUTPUT_ROWS/10000000000)) ELSE NULL END, CASE WHEN PLI.MEM > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('memory' AS "name"), PLI.MEM) ELSE NULL END, CASE WHEN PLI.MAX_MEM > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('max_memory' AS "name"), PLI.MAX_MEM) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MIN_MAX_MEM IS NOT NULL AND PLI.MAX_MEM > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'min_max_mem' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MIN_MAX_MEM/10
00000), 10000), NULL) AS "iid", MOD(MIN_MAX_MEM, 1000000) AS "sid"), TRUNC(PLI.MIN_MAX_MEM/10000000000)) ELSE NULL END, CASE WHEN PLI.TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('temp' AS "name"), PLI.TEMP) ELSE NULL END, CASE WHEN PLI.MAX_TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('max_temp' AS "name"), PLI.MAX_TEMP) ELSE NULL END, CASE WHEN PLI.MAX_TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('spill_count' AS "name"), PLI.SPILL_COUNT) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_MAX_TEMP IS NOT NULL AND PLI.MAX_TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_max_temp' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_MAX_TEMP/1000000), 10000), NULL) AS "iid", MOD(MAX_MAX_TEMP, 1000000) AS "sid"), TRUNC(PLI.MAX_MAX_TEMP/10000000000)) ELSE NULL END, CASE WHEN PLI.READ_REQS > 0 THEN XMLELEMENT( "stat"
, XMLATTRIBUTES('read_reqs' AS "name"), PLI.READ_REQS) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_READ_REQS IS NOT NULL AND PLI.READ_REQS > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_read_reqs' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_READ_REQS/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_READ_REQS, 1000000) AS "sid"), TRUNC(PLI.MAX_READ_REQS/10000000000)) ELSE NULL END, CASE WHEN PLI.READ_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), PLI.READ_BYTES) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_READ_BYTES IS NOT NULL AND PLI.READ_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_read_bytes' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_READ_BYTES/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_READ_BYTES, 1000000) AS "sid"), TRUNC(PLI.MAX_READ_BYTES/10000000000)) ELSE NULL END, CASE
WHEN PLI.WRITE_REQS > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), PLI.WRITE_REQS) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_WRITE_REQS IS NOT NULL AND PLI.WRITE_REQS > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_write_reqs' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_WRITE_REQS/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_WRITE_REQS, 1000000) AS "sid"), TRUNC(PLI.MAX_WRITE_REQS/10000000000)) ELSE NULL END, CASE WHEN PLI.WRITE_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), PLI.WRITE_BYTES) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_WRITE_BYTES IS NOT NULL AND PLI.WRITE_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_write_bytes' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_WRITE_BYTES/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_WRITE_BYTES, 1000000) AS
"sid"), TRUNC(PLI.MAX_WRITE_BYTES/10000000000)) ELSE NULL END, CASE WHEN PLI.IO_INTER_BYTES IS NOT NULL AND PLI.IO_BYTES > 0 AND PLI.IO_BYTES != PLI.IO_INTER_BYTES THEN XMLELEMENT( "stat", XMLATTRIBUTES('io_inter_bytes' AS "name"), PLI.IO_INTER_BYTES) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_IO_INTER_BYTES IS NOT NULL AND PLI.IO_BYTES > 0 AND PLI.IO_BYTES != PLI.IO_INTER_BYTES THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_io_inter_bytes' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_IO_INTER_BYTES/1000000), 10000), NULL) AS "iid", MOD(MAX_IO_INTER_BYTES, 1000000) AS "sid"), TRUNC(PLI.MAX_IO_INTER_BYTES/10000000000)) ELSE NULL END, CASE WHEN PLI.IO_INTER_BYTES IS NOT NULL AND PLI.IO_BYTES > 0 AND PLI.IO_BYTES != PLI.IO_INTER_BYTES THEN XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(PLI.IO_BYTES / DECODE(PLI.IO_INTER_BYTES, 0, 1, PLI
.IO_INTER_BYTES), 2)) ELSE NULL END), NVL2(STAT_GID, XMLELEMENT( "rwsstats", XMLATTRIBUTES( PLI.STAT_GID AS "group_id"), DECODE(GID_ROWNUM, 1, (SELECT XMLELEMENT( "metadata", NULL, XMLAGG( XMLELEMENT( "stat", XMLATTRIBUTES( ROWNUM AS "id", NAME AS "name", DESCRIPTION AS "desc", TYPE AS "type", DECODE(FLAGS, 0, NULL, FLAGS) AS "flags"), NULL) ORDER BY ID)) FROM V$SQL_MONITOR_STATNAME WHERE GROUP_ID = PLI.STAT_GID), NULL), NVL2(STAT1_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(1 AS "id"), STAT1_VALUE), NULL), NVL2(STAT2_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(2 AS "id"), STAT2_VALUE), NULL), NVL2(STAT3_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(3 AS "id"), STAT3_VALUE), NULL), NVL2(STAT4_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(4 AS "id"), STAT4_VALUE), NULL), NVL2(STAT5_VALUE, XMLELE
MENT( "stat", XMLATTRIBUTES(5 AS "id"), STAT5_VALUE), NULL), NVL2(STAT6_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(6 AS "id"), STAT6_VALUE), NULL), NVL2(STAT7_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(7 AS "id"), STAT7_VALUE), NULL), NVL2(STAT8_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(8 AS "id"), STAT8_VALUE), NULL), NVL2(STAT9_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(9 AS "id"), STAT9_VALUE), NULL), NVL2(STAT10_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(10 AS "id"), STAT10_VALUE), NULL)), NULL), CASE WHEN PLI.LINE_ACTIVITY_COUNT > 0 AND :B33 = 1 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( TO_CHAR(PLI.LINE_ACTIVITY_START, :B12 ) AS "start_time", TO_CHAR(PLI.LINE_ACTIVITY_END, :B12 ) AS "end_time", ROUND((PLI.LINE_ACTIVITY_END - PLI.LINE_ACTIVITY_START) * 3600*24) + 1 AS "duration", PLI.L
INE_ACTIVITY_COUNT AS "count", PLI.LINE_IMQ_COUNT AS "imq_count", PLI.LINE_WAIT_COUNT AS "wait_count", PLI.LINE_CPU_COUNT AS "cpu_count", PLI.LINE_OTHER_SQL_COUNT AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), PLI.ACTIVITY_TOTAL, PLI.PLAN_ACTIVITY_HISTO) ELSE NULL END) ORDER BY PLI.PLAN_LINE_ID) ) FROM (SELECT AT.MAX_LINE_ACTIVITY_COUNT, PM.OVERALL_MAX_IO_REQS, PM.OVERALL_MAX_IO_BYTES, AT.MAX_LINE_IMQ_COUNT, AT.MAX_LINE_CPU_COUNT, AT.MAX_LINE_WAIT_COUNT, AT.LINE_OTHER_SQL_COUNT, AT.MAX_LINE_OTHER_SQL_COUNT, PM.PLAN_LINE_ID, PM.PARENT_ID, PM.OPERATION, PM.OPTIONS, PM.DEPTH, PM.POSITION, PM.INACTIVE, CASE WHEN PM.OPERATION = 'PX COORDINATOR' AND :B23 = 'Y' AND (PM.PX_SERVER_SET IS NOT NULL OR AH.PX_SERVER_SET IS NOT NULL) THEN 'QC' WHEN PM.PX_SERVER_SET IS NOT NULL THEN TO_CHAR(PM.PX_SERVER_SET) WHEN AH.PX_SERVER_SET IS NOT NULL THEN TO_CHAR(AH.PX_SERVER_SET) WHEN (:B23 = 'N'
OR (PM.LAST_CHANGE_TIME IS NULL AND AT.LINE_ACTIVITY_END IS NULL)) THEN NULL ELSE 'QC' END PX_TYPE, PM.FIRST_CHANGE_TIME, AT.LINE_ACTIVITY_START, PM.LAST_CHANGE_TIME, PM.OVERALL_LAST_CHANGE_TIME, AT.LINE_ACTIVITY_END, AT.OVERALL_LINE_ACTIVITY_END, LEAST(NVL(AT.LINE_ACTIVITY_START, PM.FIRST_CHANGE_TIME), NVL(PM.FIRST_CHANGE_TIME, AT.LINE_ACTIVITY_START)) FIRST_MOVE_TIME, GREATEST(NVL(AT.LINE_ACTIVITY_END, PM.LAST_CHANGE_TIME), NVL(PM.LAST_CHANGE_TIME, AT.LINE_ACTIVITY_END)) LAST_MOVE_TIME, GREATEST(NVL(AT.OVERALL_LINE_ACTIVITY_END, PM.OVERALL_LAST_CHANGE_TIME), NVL(PM.OVERALL_LAST_CHANGE_TIME, AT.OVERALL_LINE_ACTIVITY_END)) OVERALL_LAST_MOVE_TIME, CASE WHEN PM.STARTS IS NOT NULL AND PM.STARTS > 0 THEN 1 ELSE 0 END HAS_EXECUTED, PM.OBJECT_NAME, PM.OBJECT_TYPE, PM.OBJECT_OWNER, PM.PARTITION_START, PM.PARTITION_STOP, PM.CARDINALITY, PM.BYTES, PM.COST, PM.TEMP_SPACE, PM.TIME, PM.CPU_COST, PM.IO_COST, LO.PERCENT_COMPLETE, LO.TIME_REMAINING, PM.STARTS, PM
.DOP, PM.MAX_STARTS, PM.OUTPUT_ROWS, PM.NEED_ROWS, PM.MAX_OUTPUT_ROWS, PM.MEM, PM.MAX_MEM, PM.MIN_MAX_MEM, PM.TEMP, PM.MAX_TEMP, PM.SPILL_COUNT, PM.MAX_MAX_TEMP, PM.READ_REQS, PM.MAX_READ_REQS, PM.READ_BYTES, PM.MAX_READ_BYTES, PM.WRITE_REQS, PM.MAX_WRITE_REQS, PM.WRITE_BYTES, PM.MAX_WRITE_BYTES, PM.IO_INTER_BYTES, PM.IO_BYTES, PM.MAX_IO_INTER_BYTES, AT.LINE_ACTIVITY_COUNT, AT.LINE_IMQ_COUNT, AT.LINE_WAIT_COUNT, AT.LINE_CPU_COUNT, AT.ACTIVITY_TOTAL, AH.PLAN_ACTIVITY_HISTO, PM.STAT_GID, PM.GID_ROWNUM, PM.STAT1_VALUE, PM.STAT2_VALUE, PM.STAT3_VALUE, PM.STAT4_VALUE, PM.STAT5_VALUE, PM.STAT6_VALUE, PM.STAT7_VALUE, PM.STAT8_VALUE, PM.STAT9_VALUE, PM.STAT10_VALUE FROM (SELECT AT0.*, MAX(LINE_ACTIVITY_END) OVER() OVERALL_LINE_ACTIVITY_END, MAX(LINE_ACTIVITY_COUNT) OVER() MAX_LINE_ACTIVITY_COUNT, MAX(LINE_IMQ_COUNT) OVER() MAX_LINE_IMQ_COUNT, MAX(LINE_CPU_COUNT) OVER() MAX_LINE_CPU_COUNT, MAX(LINE_WAIT_COUNT) OVER() MAX_LINE_WAIT_COUNT, MAX(LINE_OT
HER_SQL_COUNT) OVER() MAX_LINE_OTHER_SQL_COUNT FROM (SELECT AD1.PLAN_LINE_ID, MIN(AD1.LINE_ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD1.LINE_ACTIVITY_END) LINE_ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) LINE_ACTIVITY_COUNT, SUM(AD1.IMQ_COUNT) LINE_IMQ_COUNT, SUM(AD1.WAIT_COUNT) LINE_WAIT_COUNT, SUM(AD1.OTHER_SQL_COUNT) LINE_OTHER_SQL_COUNT, SUM(AD1.CPU_COUNT) LINE_CPU_COUNT, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)|| AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG(XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_TOTAL FROM (SELECT AD0.PLAN_LINE_ID, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(AD0.ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD0.ACTIVITY_END) LINE_ACTIVITY_END, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTH
ER_SQL_COUNT, MAX(AD0.DFO_MOST_ACTIVE_IID) DFO_MOST_ACTIVE_IID, MAX(AD0.DFO_MOST_ACTIVE_SID) DFO_MOST_ACTIVE_SID, SUM(AD0.DFO_MOST_ACTIVE_COUNT) DFO_MOST_ACTIVE_COUNT FROM ASH_DATA AD0 WHERE AD0.PLAN_LINE_ID IS NOT NULL GROUP BY AD0.PLAN_LINE_ID, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1 GROUP BY AD1.PLAN_LINE_ID) AT0) AT, (SELECT AD2.PLAN_LINE_ID, MIN(AD2.PX_SERVER_SET) PX_SERVER_SET, MIN(AD2.LINE_ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD2.LINE_ACTIVITY_END) LINE_ACTIVITY_END, SUM(AD2.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD2.IMQ_COUNT) IMQ_COUNT, SUM(AD2.WAIT_COUNT) WAIT_COUNT, SUM(AD2.CPU_COUNT) CPU_COUNT, SUM(AD2.OTHER_SQL_COUNT) OTHER_SQL_COUNT, CASE WHEN :B29 = 1 AND SUM(AD2.ACTIVITY_COUNT) > 0 THEN XMLELEMENT( "activity_histogram", XMLATTRIBUTES( :B26 AS "bucket_interval", :B27 AS "bucket_count", TO_CHAR( :B20 , :B12 ) AS "start_time", TO_CHAR(:B22 , :B12 ) AS "end_time", ROUND((:B22 -:B20 ) *3600*24) + 1 AS
"duration"), XMLAGG(XMLELEMENT( "bucket", XMLATTRIBUTES( AD2.BUCKET_NUM AS "number"), AD2.ACTIVITY_BUCKET) ORDER BY AD2.BUCKET_NUM)) ELSE NULL END PLAN_ACTIVITY_HISTO FROM (SELECT AD1.PLAN_LINE_ID, AD1.BUCKET_NUM, MIN(AD1.PX_SERVER_SET) PX_SERVER_SET, MIN(AD1.LINE_ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD1.LINE_ACTIVITY_END) LINE_ACTIVITY_END, MIN(AD1.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD1.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD1.IMQ_COUNT) IMQ_COUNT, SUM(AD1.WAIT_COUNT) WAIT_COUNT, SUM(AD1.CPU_COUNT) CPU_COUNT, SUM(AD1.OTHER_SQL_COUNT) OTHER_SQL_COUNT, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)|| AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG(NVL2(AD1.ACTIVITY_TYPE, XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT), NULL) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_BUC
KET FROM (SELECT AD0.PLAN_LINE_ID, AD0.PLAN_ACTIVITY_BUCKET_NUM BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(NVL2(AD0.ACTIVITY_START, AD0.PX_SERVER_SET, NULL)) PX_SERVER_SET, MIN(AD0.ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD0.ACTIVITY_END) LINE_ACTIVITY_END, MIN(AD0.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD0.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTHER_SQL_COUNT, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT FROM ASH_DATA AD0 GROUP BY AD0.PLAN_LINE_ID, AD0.PLAN_ACTIVITY_BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1 GROUP BY AD1.PLAN_LINE_ID, AD1.BUCKET_NUM) AD2 GROUP BY AD2.PLAN_LINE_ID) AH, (SELECT LO.SQL_PLAN_LINE_ID PLAN_LINE_ID, DECODE(SUM(LO.TOTALWORK), 0, NULL, ROUND(SUM(LO.SOFAR)*100/SUM(LO.TOTALWORK))) PERCENT_COMPLETE, MAX(LO.TIME_REMAINING) TIME_REMAINING FROM GV$SESSION_LONGOPS LO, MONITOR_DATA MO WHERE (:B49 = 'Y'
OR :B70 = 'DONE (ERROR)') AND LO.SQL_ID = :B9 AND LO.SQL_EXEC_START = :B8 AND LO.SQL_EXEC_ID = :B7 AND LO.INST_ID = MO.INST_ID AND LO.SID = MO.SID GROUP BY LO.SQL_PLAN_LINE_ID) LO, (SELECT PM0.*, CASE WHEN PM0.STARTS IS NULL OR PM0.STARTS = 0 OR PM0.OUTPUT_ROWS IS NULL THEN NULL ELSE 1 END NEED_ROWS, ROW_NUMBER() OVER(PARTITION BY PM0.STAT_GID ORDER BY PM0.PLAN_LINE_ID ) GID_ROWNUM, MAX(LAST_CHANGE_TIME) OVER() OVERALL_LAST_CHANGE_TIME, MAX(MAX_IO_REQS) OVER() OVERALL_MAX_IO_REQS, MAX(MAX_IO_BYTES) OVER() OVERALL_MAX_IO_BYTES FROM (SELECT /*+ leading(mo) use_hash(plm) */ PLM.PLAN_LINE_ID PLAN_LINE_ID, PLM.PLAN_OPERATION OPERATION, PLM.PLAN_OPTIONS OPTIONS, MAX(PLM.PLAN_PARENT_ID) PARENT_ID, MAX(PLM.PLAN_DEPTH) DEPTH, MAX(PLM.PLAN_POSITION) POSITION, MAX(PLM.PLAN_OPERATION_INACTIVE) INACTIVE, MAX(PLM.PLAN_OBJECT_OWNER) OBJECT_OWNER, MAX(PLM.PLAN_OBJECT_NAME) OBJECT_NAME, MAX(PLM.PLAN_OBJECT_TYPE) OBJECT_TYPE, MAX(PLM.PLAN_COST) COST, MAX(PLM.PLAN_CARDINALITY) CARDINALI
TY, MAX(PLM.PLAN_BYTES) BYTES, MAX(PLM.PLAN_CPU_COST) CPU_COST, MAX(PLM.PLAN_IO_COST) IO_COST, MAX(PLM.PLAN_TEMP_SPACE) TEMP_SPACE, MAX(PLM.PLAN_TIME) TIME, MAX(PLM.PLAN_PARTITION_START) PARTITION_START, MAX(PLM.PLAN_PARTITION_STOP) PARTITION_STOP, MIN(PLM.FIRST_CHANGE_TIME) FIRST_CHANGE_TIME, MAX(PLM.LAST_CHANGE_TIME) LAST_CHANGE_TIME, MIN(PLM.LAST_CHANGE_TIME) MIN_LAST_CHANGE_TIME, MIN(NVL2(PLM.FIRST_CHANGE_TIME, MO.PX_SERVER_SET, NULL)) PX_SERVER_SET, COUNT(CASE WHEN PLM.PAR IS NOT NULL AND PLM.STARTS IS NOT NULL AND PLM.STARTS > 0 AND PLM.PLAN_LINE_ID != 0 AND PLM.PLAN_OPERATION != 'PX COORDINATOR' THEN 1 ELSE NULL END) DOP, SUM(PLM.STARTS) STARTS, MAX(NVL2(PAR, PLM.STARTS * 10000000000 + PLM.ES, NULL)) MAX_STARTS, SUM(PLM.OUTPUT_ROWS) OUTPUT_ROWS, MAX(NVL2(PAR, PLM.OUTPUT_ROWS * 10000000000 +PLM.ES, NULL)) MAX_OUTPUT_ROWS, SUM(PLM.WORKAREA_MEM) MEM, SUM(PLM.WORKAREA_MAX_MEM) MAX_MEM, MIN(NVL2(PAR, PLM.WORKAREA_MAX_MEM * 10000000000 + PLM.ES, NULL)) MI
N_MAX_MEM, SUM(PLM.WORKAREA_TEMPSEG) TEMP, SUM(PLM.WORKAREA_MAX_TEMPSEG) MAX_TEMP, MAX(NVL2(PAR, PLM.WORKAREA_MAX_TEMPSEG * 10000000000 + PLM.ES, NULL)) MAX_MAX_TEMP, COUNT(PLM.WORKAREA_MAX_TEMPSEG) SPILL_COUNT, SUM(PLM.PHYSICAL_READ_REQUESTS) READ_REQS, MAX(NVL2(PAR, PLM.PHYSICAL_READ_REQUESTS * 10000000000 + PLM.ES, NULL)) MAX_READ_REQS, SUM(PLM.PHYSICAL_READ_BYTES) READ_BYTES, MAX(NVL2(PAR, PLM.PHYSICAL_READ_BYTES * 10000000000 + PLM.ES, NULL)) MAX_READ_BYTES, SUM(PLM.PHYSICAL_WRITE_REQUESTS) WRITE_REQS, MAX(NVL2(PAR, PLM.PHYSICAL_WRITE_REQUESTS * 10000000000 + PLM.ES, NULL)) MAX_WRITE_REQS, SUM(PLM.PHYSICAL_WRITE_BYTES) WRITE_BYTES, MAX(NVL2(PAR, PLM.PHYSICAL_WRITE_BYTES * 10000000000 + PLM.ES, NULL)) MAX_WRITE_BYTES, NVL(SUM(PLM.PHYSICAL_READ_BYTES), 0) + NVL(SUM(PLM.PHYSICAL_WRITE_BYTES), 0) IO_BYTES, SUM(NVL(PLM.PHYSICAL_READ_REQUESTS, 0) + NVL(PLM.PHYSICAL_WRITE_REQUESTS, 0)) MAX_IO_REQS, SUM(NVL(PLM.PHYSICAL_READ_BYTES, 0) + NVL(PLM.PHYSICAL_WRITE
_BYTES, 0)) MAX_IO_BYTES, SUM(PLM.IO_INTERCONNECT_BYTES) IO_INTER_BYTES, MAX(NVL2(PAR, PLM.IO_INTERCONNECT_BYTES * 10000000000 + PLM.ES, NULL)) MAX_IO_INTER_BYTES, MAX(OTHERSTAT_GROUP_ID) STAT_GID, NVL(DECODE(MAX(OTHERSTAT_1_TYPE), 3, MAX(OTHERSTAT_1_VALUE), 4, MAX(OTHERSTAT_1_VALUE), 6, MIN(OTHERSTAT_1_VALUE), 7, MIN(OTHERSTAT_1_VALUE), NULL), SUM(DECODE(OTHERSTAT_1_TYPE, 1, OTHERSTAT_1_VALUE, 2, OTHERSTAT_1_VALUE, NULL))) STAT1_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_2_TYPE), 3, MAX(OTHERSTAT_2_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_2_VALUE), 7, MIN(RMAX1 + OTHERSTAT_2_VALUE), NULL), 6, MIN(OTHERSTAT_2_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_2_TYPE, 1, OTHERSTAT_2_VALUE, 2, OTHERSTAT_2_VALUE, NULL))) STAT2_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_3_TYPE), 3, MAX(OTHERSTAT_3_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_3_VALUE), 7, MIN(RMAX1 + OTHERSTAT_3_VALUE), NULL), 6, M
IN(OTHERSTAT_3_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_3_TYPE, 1, OTHERSTAT_3_VALUE, 2, OTHERSTAT_3_VALUE, NULL))) STAT3_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_4_TYPE), 3, MAX(OTHERSTAT_4_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_4_VALUE), 7, MIN(RMAX1 + OTHERSTAT_4_VALUE), NULL), 6, MIN(OTHERSTAT_4_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_4_TYPE, 1, OTHERSTAT_4_VALUE, 2, OTHERSTAT_4_VALUE, NULL))) STAT4_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_5_TYPE), 3, MAX(OTHERSTAT_5_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_5_VALUE), 7, MIN(RMAX1 + OTHERSTAT_5_VALUE), NULL), 6, MIN(OTHERSTAT_5_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_5_TYPE, 1, OTHERSTAT_5_VALUE, 2, OTHERSTAT_5_VALUE, NULL))) STAT5_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_6_TYPE), 3, MAX(OTHERSTAT_6_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_6_VALUE), 7, MIN(RMAX1 +
OTHERSTAT_6_VALUE), NULL), 6, MIN(OTHERSTAT_6_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_6_TYPE, 1, OTHERSTAT_6_VALUE, 2, OTHERSTAT_6_VALUE, NULL))) STAT6_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_7_TYPE), 3, MAX(OTHERSTAT_7_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_7_VALUE), 7, MIN(RMAX1 + OTHERSTAT_7_VALUE), NULL), 6, MIN(OTHERSTAT_7_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_7_TYPE, 1, OTHERSTAT_7_VALUE, 2, OTHERSTAT_7_VALUE, NULL))) STAT7_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_8_TYPE), 3, MAX(OTHERSTAT_8_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_8_VALUE), 7, MIN(RMAX1 + OTHERSTAT_8_VALUE), NULL), 6, MIN(OTHERSTAT_8_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_8_TYPE, 1, OTHERSTAT_8_VALUE, 2, OTHERSTAT_8_VALUE, NULL))) STAT8_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_9_TYPE), 3, MAX(OTHERSTAT_9_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + O
THERSTAT_9_VALUE), 7, MIN(RMAX1 + OTHERSTAT_9_VALUE), NULL), 6, MIN(OTHERSTAT_9_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_9_TYPE, 1, OTHERSTAT_9_VALUE, 2, OTHERSTAT_9_VALUE, NULL))) STAT9_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_10_TYPE), 3, MAX(OTHERSTAT_10_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_10_VALUE), 7, MIN(RMAX1 + OTHERSTAT_10_VALUE), NULL), 6, MIN(OTHERSTAT_10_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_10_TYPE, 1, OTHERSTAT_10_VALUE, 2, OTHERSTAT_10_VALUE, NULL))) STAT10_VALUE FROM (SELECT A.*, OTHERSTAT_1_VALUE * 10000000000000000 RMAX1, A.INST_ID * 1000000 + A.SID ES, DECODE(A.PROCESS_NAME, 'ora', NULL, 1) PAR FROM GV$SQL_PLAN_MONITOR A) PLM, MONITOR_DATA MO WHERE PLM.SQL_ID = :B9 AND PLM.SQL_EXEC_START = :B8 AND PLM.SQL_EXEC_ID = :B7 AND PLM.INST_ID = MO.INST_ID AND PLM.INST_ID BETWEEN :B11 AND :B10 AND PLM.KEY = MO.KEY GROUP BY PLM.PLAN_LINE_ID, PLM.PLAN_OPERATION, PLM.PLAN_OPTION
S) PM0) PM WHERE AH.PLAN_LINE_ID(+) = PM.PLAN_LINE_ID AND AT.PLAN_LINE_ID(+) = PM.PLAN_LINE_ID AND LO.PLAN_LINE_ID(+) = PM.PLAN_LINE_ID AND (:B21 IS NULL OR PM.PLAN_LINE_ID = :B21 )) PLI) ELSE NULL END, CASE WHEN :B42 = 1 THEN DBMS_SQLTUNE.BUILD_STASH_XML( SESSION_ID=>:B19 , SESSION_SERIAL=>:B18 , SESSION_INST_ID=>:B17 , PX_MODE=>'yes', START_TIME=>:B20 , END_TIME=>:B22 , MISSING_SECONDS=> :B41 , INSTANCE_LOW_FILTER=>:B11 , INSTANCE_HIGH_FILTER=>:B10 , BUCKET_MAX_COUNT=>NULL, BUCKET_INTERVAL=>:B26 , REPORT_LEVEL=>'typical', CPU_CORES=>:B40 , IS_HYPER=>:B39 ) ELSE NULL END), (CASE WHEN :B38 = 1 THEN (SELECT XMLELEMENT( "skewed_sessions", XMLATTRIBUTES( DECODE(MIN(INST_ID), NULL, :B17 , MIN(INST_ID)) AS "min_iid", DECODE(MAX(INST_ID), NULL, :B17 , MAX(INST_ID)) AS "max_iid"), XMLAGG( XMLELEMENT( "s", XMLATTRIBUTES( INST_ID AS "i"), SESSION_ID) ORDER BY INST_ID, SESSION_I
D)) FROM (SELECT SESS.* FROM (SELECT DECODE(AD.DFO_MOST_ACTIVE_IID, :B17 , NULL, AD.DFO_MOST_ACTIVE_IID) INST_ID, AD.DFO_MOST_ACTIVE_SID SESSION_ID FROM ASH_DATA AD WHERE AD.DFO_MOST_ACTIVE_COUNT IS NOT NULL GROUP BY AD.DFO_MOST_ACTIVE_IID, AD.DFO_MOST_ACTIVE_SID ORDER BY MAX(AD.DFO_MOST_ACTIVE_COUNT) DESC) SESS WHERE ROWNUM <= 100)) ELSE NULL END), (CASE WHEN :B37 = 1 THEN (SELECT XMLELEMENT( "report_repository_summary", CASE WHEN MA.MAX_DBOP_NAME IS NOT NULL THEN XMLELEMENT( "dbop", XMLATTRIBUTES('F' AS "detail", MA.MAX_DBOP_NAME AS "dbop_name", TO_CHAR(MA.MIN_FIRST_REFRESH_TIME, :B12 ) AS "dbop_exec_start", MA.MAX_DBOP_EXEC_ID AS "dbop_exec_id"), XMLFOREST( MA.MAX_STATUS AS "status", TO_CHAR(NVL(MA.MAX_SQL_EXEC_START, MA.MIN_FIRST_REFRESH_TIME), :B12 )AS "first_refresh_time", TO_CHAR(MA.MAX_LAST_REFRESH_TIME, :B12 )AS "last_refresh_time", MA.SUM_REFRESH_COUNT AS "refr
esh_count", MA.MAX_INST_ID AS "inst_id", MA.MAX_SESSION_ID AS "session_id", MA.MAX_SESSION_SERIAL AS "session_serial", MA.MAX_USERID AS "user_id", MA.MAX_USERNAME AS "user", MA.MAX_CON_ID AS "con_id", MA.MAX_CON_NAME AS "con_name", MA.MAX_MODULE AS "module", MA.MAX_ACTION AS "action", MA.MAX_SERVICE_NAME AS "service", MA.MAX_CLIENT_ID AS "client_id", MA.MAX_CLIENT_INFO AS "client_info", MA.MAX_PROGRAM AS "program", MA.MAX_PL_ENTRY_OID AS "plsql_entry_object_id", MA.MAX_PL_ENTRY_PROGID AS "plsql_entry_subprogram_id", MA.MAX_PL_OID AS "plsql_object_id", MA.MAX_PL_PROGID AS "plsql_subprogram_id", MA.MAX_PX_IS_CROSS_INSTANCE AS "is_cross_instance", MA.MAX_PX_DOP AS "dop", MA.MAX_PX_DOP_INSTANCES AS "instances"), CASE WHEN MA.MAX_ERROR_NUMBER IS NULL THEN NULL ELSE XML
ELEMENT( "error", XMLATTRIBUTES(MA.MAX_ERROR_NUMBER AS "number", MA.MAX_ERROR_FACILITY AS "facility"), MA.MAX_ERROR_MESSAGE) END, XMLELEMENT( "stats", XMLATTRIBUTES('monitor' AS "type"), XMLELEMENT( "stat", XMLATTRIBUTES('duration' AS "name"), GREATEST(ROUND((MA.MAX_LAST_REFRESH_TIME- NVL(MA.MAX_SQL_EXEC_START, MA.MIN_FIRST_REFRESH_TIME))*86400), LEAST(MA.SUM_ELAPSED_TIME/1000000, 1), CEIL(MA.MAX_QUEUING_TIME/1000000))), DECODE(MA.SUM_ELAPSED_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MA.SUM_ELAPSED_TIME)), DECODE(MA.MAX_QUEUING_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MA.MAX_QUEUING_TIME)), DECODE(MA.SUM_CPU_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MA.SUM_CPU_TIME)), DECODE(MA.SUM_USER_IO_WAIT_TIME, 0, NULL, XMLELEMENT( "
stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MA.SUM_USER_IO_WAIT_TIME)), DECODE(MA.SUM_APPLICATION_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MA.SUM_APPLICATION_WAIT_TIME)), DECODE(MA.SUM_CONCURRENCY_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('concurrency_wait_time' AS "name"), MA.SUM_CONCURRENCY_WAIT_TIME)), DECODE(MA.SUM_CLUSTER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MA.SUM_CLUSTER_WAIT_TIME)), DECODE(MA.SUM_PLSQL_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MA.SUM_PLSQL_EXEC_TIME)), DECODE(MA.SUM_JAVA_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MA.SUM_JAVA_EXEC_TIME)), DECODE(MA.SUM_OTHER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRI
BUTES('other_wait_time' AS "name"), MA.SUM_OTHER_WAIT_TIME)), DECODE(MA.SUM_FETCHES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MA.SUM_FETCHES)), DECODE(MA.SUM_BUFFER_GETS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), MA.SUM_BUFFER_GETS)), DECODE(MA.SUM_READ_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MA.SUM_READ_REQS)), DECODE(MA.SUM_READ_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), MA.SUM_READ_BYTES)), DECODE(MA.SUM_WRITE_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MA.SUM_WRITE_REQS)), DECODE(MA.SUM_WRITE_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MA.SUM_WRITE_BYTES)), CASE WHEN MA.SUM_IO_INTER_BYTES IS NULL OR MA.SUM_IO_INTER_BYTES = MA.SUM_IO_
BYTES OR MA.SUM_IO_BYTES = 0 THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MA.SUM_IO_BYTES / DECODE(MA.SUM_IO_INTER_BYTES, 0, 1, MA.SUM_IO_INTER_BYTES), 2)) END) ) ELSE XMLELEMENT( "sql", XMLATTRIBUTES( MA.MAX_SQL_ID AS "sql_id", TO_CHAR(MA.MAX_SQL_EXEC_START, :B12 ) AS "sql_exec_start", MA.MAX_SQL_EXEC_ID AS "sql_exec_id"), XMLFOREST(MA.MAX_STATUS AS "status", SUBSTR(MA.SQLMON_TEXT, 1, 100) AS "sql_text", TO_CHAR(MA.MIN_FIRST_REFRESH_TIME, :B12 ) AS "first_refresh_time", TO_CHAR(MA.MAX_LAST_REFRESH_TIME, :B12 ) AS "last_refresh_time", MA.SUM_REFRESH_COUNT AS "refresh_count", MA.MAX_INST_ID AS "inst_id", MA.MAX_SESSION_ID AS "session_id", MA.MAX_SESSION_SERIAL AS "session_serial", MA.MAX_USERID AS "user_id", MA.MAX_USERNAME AS "user", MA.MAX_CON_ID AS "
con_id", MA.MAX_CON_NAME AS "con_name", MA.MAX_MODULE AS "module", MA.MAX_ACTION AS "action", MA.MAX_SERVICE_NAME AS "service", MA.MAX_CLIENT_ID AS "client_id", MA.MAX_CLIENT_INFO AS "client_info", MA.MAX_PROGRAM AS "program", MA.MAX_PLAN_HASH_VALUE AS "plan_hash", MA.MAX_PL_ENTRY_OID AS "plsql_entry_object_id", MA.MAX_PL_ENTRY_PROGID AS "plsql_entry_subprogram_id", MA.MAX_PL_OID AS "plsql_object_id", MA.MAX_PL_PROGID AS "plsql_subprogram_id", MA.MAX_PX_IS_CROSS_INSTANCE AS "is_cross_instance", MA.MAX_PX_DOP AS "dop", MA.MAX_PX_DOP_INSTANCES AS "instances", MA.SUM_SERVERS_REQUESTED AS "px_servers_requested", MA.SUM_SERVERS_ALLOCATED AS "px_servers_allocated"), XMLELEMENT( "stats", XMLATTRIBUTES('monitor' AS "type"), XMLELEMENT( "stat", XMLATTRIBUTES('duration' AS
"name"), GREATEST(ROUND((MA.MAX_LAST_REFRESH_TIME- MA.MAX_SQL_EXEC_START)*86400), LEAST(MA.SUM_ELAPSED_TIME/1000000, 1), CEIL(MA.MAX_QUEUING_TIME/1000000))), DECODE(MA.SUM_ELAPSED_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MA.SUM_ELAPSED_TIME)), DECODE(MA.MAX_QUEUING_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MA.MAX_QUEUING_TIME)), DECODE(MA.SUM_CPU_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MA.SUM_CPU_TIME)), DECODE(MA.SUM_USER_IO_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MA.SUM_USER_IO_WAIT_TIME)), DECODE(MA.SUM_APPLICATION_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MA.SUM_APPLICATION_WAIT_TIME)), DECODE(MA.SUM_CONCURRENCY_WAIT_TIME, 0, NULL, XMLELEMENT(
"stat", XMLATTRIBUTES('concurrency_wait_time' AS "name"), MA.SUM_CONCURRENCY_WAIT_TIME)), DECODE(MA.SUM_CLUSTER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MA.SUM_CLUSTER_WAIT_TIME)), DECODE(MA.SUM_PLSQL_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MA.SUM_PLSQL_EXEC_TIME)), DECODE(MA.SUM_JAVA_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MA.SUM_JAVA_EXEC_TIME)), DECODE(MA.SUM_OTHER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('other_wait_time' AS "name"), MA.SUM_OTHER_WAIT_TIME)), DECODE(MA.SUM_FETCHES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MA.SUM_FETCHES)), DECODE(MA.SUM_BUFFER_GETS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"),
MA.SUM_BUFFER_GETS)), DECODE(MA.SUM_READ_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MA.SUM_READ_REQS)), DECODE(MA.SUM_READ_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), MA.SUM_READ_BYTES)), DECODE(MA.SUM_WRITE_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MA.SUM_WRITE_REQS)), DECODE(MA.SUM_WRITE_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MA.SUM_WRITE_BYTES)), CASE WHEN MA.SUM_IO_INTER_BYTES IS NULL OR MA.SUM_IO_INTER_BYTES = MA.SUM_IO_BYTES OR MA.SUM_IO_BYTES = 0 THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MA.SUM_IO_BYTES / DECODE(MA.SUM_IO_INTER_BYTES, 0, 1, MA.SUM_IO_INTER_BYTES), 2)) END) ) END) FROM MONITOR_AGG MA) ELSE NULL END) FROM (SELECT CASE WHEN V1.XPLAN_XML IS NULL OR V1.XPLAN_
XML.EXISTSNODE('/error') > 0 THEN NULL ELSE V1.XPLAN_XML END XPLAN_XML FROM (SELECT CASE WHEN :B36 = 1 THEN DBMS_XPLAN.BUILD_PLAN_XML(TABLE_NAME=>'gv$sql_plan', PLAN_TAG=>'plan', FILTER_PREDS=>:B35 , FORMAT=>'-PROJECTION +ALIAS +ADAPTIVE') ELSE NULL END XPLAN_XML FROM DUAL) V1) CONST_VIEW |
dk5x86qv8nbrd | SELECT A.* FROM CBSOGG.CB_SUBS_POS_SERVICES A WHERE ROWID = (SELECT MAX (ROWID) FROM CBSOGG.CB_SUBS_POS_SERVICES B WHERE B.ORDER_REF_NO = A.ORDER_REF_NO) AND SERVICE_CODE_V='FXL' |
dmhzq6rk3ppnx | SELECT SEGCOL#, INTCOL#, COL#, COLNAME, TYPE#, LENGTH, PRECISION, SCALE, INTERVAL_LEADING_PRECISION, INTERVAL_TRAILING_PRECISION, PROPERTY, CHARSETID, CHARSETFORM, XTYPESCHEMANAME, XTYPENAME, XFQCOLNAME, XTOPINTCOL, XREFFEDTABLEOBJN, XREFFEDTABLEOBJV, XCOLTYPEFLAGS, XOPQTYPETYPE, XOPQTYPEFLAGS, XOPQLOBINTCOL, XOPQOBJINTCOL, XXMLINTCOL, EAOWNER#, EAMKEYID, EAENCALG, EAINTALG, EACOLKLC, EAKLCLEN, EAFLAGS, LOGMNRDERIVEDFLAGS FROM SYS.LOGMNR_GTCS_SUPPORT WHERE LOGMNR_UID = :B2 AND OBJ# = :B1 ORDER BY LOGMNR_UID, OBJ#, INTCOL# |
dp950ydwaah3a | SELECT PACKAGE_CODE_V FROM CBSOGG.CB_ACCOUNT_SERVICE_LIST WHERE ACCOUNT_LINK_CODE_N=:B1 |
f5pn6f46sqyh4 | CREATE TABLE request |
f9hcz8j9zwhrh | SELECT SERVICE_REQ_ID_V FROM CBSOGG.CB_ORDER_REQUEST_DTLS WHERE ORDER_REF_NO_V = :B1 |
fhf8upax5cxsz | BEGIN sys.dbms_auto_report_internal.i_save_report (:rep_ref, :snap_id, :pr_class, :rep_id, :suc); END; |
frjd8zfy2jfdq | SELECT executions, end_of_fetch_count, elapsed_time/px_servers elapsed_time, cpu_time/px_servers cpu_time, buffer_gets/executions buffer_gets FROM (SELECT sum(executions) as executions, sum(case when px_servers_executions > 0 then px_servers_executions else executions end) as px_servers, sum(end_of_fetch_count) as end_of_fetch_count, sum(elapsed_time) as elapsed_time, sum(cpu_time) as cpu_time, sum(buffer_gets) as buffer_gets FROM gv$sql WHERE executions > 0 AND sql_id = :1 AND parsing_schema_name = :2) |
g22f2h8s9vfrz | select nvl2(stale_stats, decode(stale_stats, 'NO', 3, 1), 2) from dba_tab_statistics where owner=:1 and table_name=:2 |
gavdwsru7d7k2 |
SELECT "Custom SQL Query"."ACTIVITY_NAME_V" AS "ACTIVITY_NAME_V"
FROM (
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at
time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl
_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt
.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CO
DE_N
union all
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_
date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_v
oice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_co
de_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_cod
e_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM_HISTORY a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT_HISTORY c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cbsogg.cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union all
select distinct 'FLR' Category,
tt.docket_number_n ticket_no, null Workflow_desc,
null sla_time, tt.ticket_regn_dt_d registration_date, null wf_reg_date_sec, null start_date,
null wf_start_date_sec, null wf_end_date, null wf_end_date_sec, tt.ticket_resp_dt_d workflw_resp_date,
null wf_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v
<> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voic
e_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
null bin_expiry_date, null bin_expiry_date_sec, null bin_assign_date, null bin_assign_date_sec, null bin_comp_date,
null bin_compl_date_sec,
null wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
null Assign_to,
C.GROUP_NAME_V activity_name,
tt.question_v, tt.answer_v,
TTI.NOTES_V Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT--, TT_TICKETINFO c
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
B.USER_NAME_V user_name
from cbsogg.TT_TICKETINFO tt, cbsogg.CB_USERS B, cbsogg.CB_USER_GROUP C, cbsogg.TT_TICKETINCIDENT TTI
where tt.docket_number_n not in(select event_refno_v from WF_WORKFLOW@cbsstandby)
AND TTI.INCIDENT_NUMBER_N = tt.docket_number_n
AND tt.LOGGED_BY_N = B.USER_CODE_N
AND C.GROUP_CODE_N = B.GROUP_CODE_N
) "Custom SQL Query"
GROUP BY "Custom SQL Query"."ACTIVITY_NAME_V"
ORDER BY 1 ASC NULLS FIRST |
gb82hrngtp4q6 |
SELECT "Custom SQL Query"."CATEGORY" AS "CATEGORY"
FROM (
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zone 'GM
T') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v f
rom cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.en
tity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v
and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union
all
select distinct 'Workflow' Category,
tt.docket_number_n ticket_no,
wm.wrkflw_desc_v Workflow_desc,
wm.estimated_resoln_tm_n sla_time, tt.ticket_regn_dt_d ticket_reg_date,
round((cast((FROM_TZ(CAST(tt.ticket_regn_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_reg_date_sec,
x.start_dt_d ticket_start_date,
round((cast((FROM_TZ(CAST(x.start_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_start_date_sec,
x.end_dt_d ticket_end_date,
round((cast((FROM_TZ(CAST(x.end_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_end_date_sec,
tt.ticket_resp_dt_d ticket_resp_date,
round((cast((FROM_TZ(CAST(tt.ticket_resp_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) tk_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Complaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISD
N,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscriber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbso
gg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
a.expiry_time_d bin_expiry_date,
round((cast((FROM_TZ(CAST(a.expiry_time_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_expiry_date_sec,
a.assignment_dt_d bin_assign_date,
round((cast((FROM_TZ(CAST(a.assignment_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_assign_date_sec,
a.work_completion_dt_d bin_comp_date,
round((cast((FROM_TZ(CAST(a.work_completion_dt_d as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) bin_compl_date_sec,
x.status_v wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Cat
egory_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
cu.user_name_v Assign_to,
e.GROUP_NAME_V activity_name_v,
tt.question_v, tt.answer_v,
a.notes_v Notes,
(SELECT CFT.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
cu.user_name_v user_name
from cbsogg.WF_TODOITEM_HISTORY a,
WF_WORKFLOW@cbsstandby x , cbsogg.WF_WORKASSIGNMENT_HISTORY c,
cbsogg.TT_TICKETINFO tt, cbsogg.WF_WRKFLWMGR wm, cbsogg.cb_users cu , cbsogg.cb_user_group e
where a.event_refno_v = x.event_refno_v
and tt.docket_number_n = x.event_refno_v
and x.wrkflw_id_n = wm.wrkflw_id_n
and a.work_id_n = c.work_id_n
--and tt.docket_number_n = '35022'
and a.user_id_n = cu.user_code_n
AND cu.GROUP_CODE_N = e.GROUP_CODE_N
union all
select distinct 'FLR' Category,
tt.docket
_number_n ticket_no, null Workflow_desc,
null sla_time, tt.ticket_regn_dt_d registration_date, null wf_reg_date_sec, null start_date,
null wf_start_date_sec, null wf_end_date, null wf_end_date_sec, tt.ticket_resp_dt_d workflw_resp_date,
null wf_resp_date_sec,
round((cast((FROM_TZ(CAST(sysdate as timestamp), sessiontimezone) at time zone 'GMT') as date) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400) sys_date,
decode(tt.status_v, 'P', 'Pending', 'A', 'Task completed', 'C', 'Closed', 'R', 'Resolved') StatusTicket,
decode(tt.ticket_type_v, 'Q', 'Query', 'C', 'Complaint Type', 'R', 'Service Request') Ticket_type,
(select A3.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER A3 where A3.category_code_v =
(select A2.parent_category_code_v from cbsogg.TT_CATEGORY_MASTER A2 where A2.category_code_v =
(select t1.subcategory_id_v from cbsogg.TT_TICKETINFO t1 where t1.docket_number_n = tt.docket_number_n))
and A3.parent_category_code_v <> '0') Co
mplaint_type,
(SELECT distinct A1.CATEGORY_DESCRIPTION_V FROM cbsogg.TT_CATEGORY_MASTER A1 WHERE A1.CATEGORY_CODE_V = tt.SUBCATEGORY_ID_V ) SubComplaint_type,
(select d.mobl_num_voice_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) MSISDN,
(select csm.first_name_v||csm.last_name_v
from cbsogg.gsm_service_mast d, cbsogg.cb_account_master cam , cbsogg.cb_subscriber_master csm
where d.account_code_n = cam.account_code_n
and csm.subscriber_code_n = cam.subscriber_code_n
and tt.entity_id_n = d.mobl_num_voice_v ) SUBS_NAME,
(select d.sub_service_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) Service_code,
(select d.subscriber_category_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Segments,
(select g.SUBS_SUB_CATEGORY_DESC_V from cbsogg.gsm_service_mast d, cbsogg.cb_subscriber_sub_category g
where tt.entity_id_n = d.mobl_num_voice_v and d.subscr
iber_category_v = g.subs_category_code_v
and d.subscriber_sub_category_v = g.subs_sub_category_code_v) sub_segments,
(select d.status_code_v from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v ) mob_status,
(select d.account_code_n from cbsogg.gsm_service_mast d
where tt.entity_id_n = d.mobl_num_voice_v) Account_no,
null bin_expiry_date, null bin_expiry_date_sec, null bin_assign_date, null bin_assign_date_sec, null bin_comp_date,
null bin_compl_date_sec,
null wf_status, tt.tt_source_v Source_v,
(select distinct cm.CATEGORY_DESCRIPTION_V from cbsogg.TT_CATEGORY_MASTER cm
where cm.category_code_v = tt.category_id_v and cm.category_type_v = tt.ticket_type_v and cm.parent_category_code_v = '0') Category_desc,
(select f.user_name_v from cbsogg.cb_users f where f.user_code_n = tt.LOGGED_BY_N) Created_by,
null Assign_to,
C.GROUP_NAME_V activity_name,
tt.question_v, tt.answer_v,
TTI.NOTES_V Notes,
(SELECT CFT
.fault_name_v FROM cbsogg.TT_TICKET_ADDNL_INFO TAI, cbsogg.cb_fault_types CFT--, TT_TICKETINFO c
where TAI.FAULT_CODE_V = CFT.FAULT_CODE_V
and tt.docket_number_n = TAI.docket_number_n) ROOT_CAUSE,
B.USER_NAME_V user_name
from cbsogg.TT_TICKETINFO tt, cbsogg.CB_USERS B, cbsogg.CB_USER_GROUP C, cbsogg.TT_TICKETINCIDENT TTI
where tt.docket_number_n not in(select event_refno_v from WF_WORKFLOW@cbsstandby)
AND TTI.INCIDENT_NUMBER_N = tt.docket_number_n
AND tt.LOGGED_BY_N = B.USER_CODE_N
AND C.GROUP_CODE_N = B.GROUP_CODE_N
) "Custom SQL Query"
GROUP BY "Custom SQL Query"."CATEGORY"
ORDER BY 1 ASC NULLS FIRST |
gcn3gu56qu7r9 | SELECT COUNT(1) FROM CBSOGG.CB_ORDER_REQUEST_DTLS A WHERE SERVICE_REQ_ID_V=:B1 AND EXISTS(SELECT 1 FROM CB_SUBS_POS_SERVICES B WHERE A.ORDER_REF_NO_V=B.ORDER_REF_NO AND SERVICE_KEY_CODE_V IN ('MYBB', 'BBMY')) |
gcqvrzzs3jqd0 | DECLARE logmnr_uid NUMBER := :1; ScnBas NUMBER := :2; ScnWrp NUMBER := :3; RedoThrd NUMBER := :4; loc_rbasqn NUMBER := :5; loc_rbablk NUMBER := :6; loc_rbabyte NUMBER := :7; Apply NUMBER := 0; BEGIN sys.logmnr_krvrda_test_apply(logmnr_uid, ScnBas, ScnWrp, RedoThrd, loc_rbasqn, loc_rbablk, loc_rbabyte, Apply); :8 := Apply; END; |
gd28w82ct6rva | select audit$ from tab$ where obj# = :1 |
ghjk279rcm16p | UPDATE SYS.STREAMS$_APPLY_MILESTONE SET OLDEST_SCN=:1, COMMIT_SCN=:2, SYNCH_SCN=:3, SPARE1=:4, EPOCH=:5, PROCESSED_SCN=:6, APPLY_TIME=:7, APPLIED_MESSAGE_CREATE_TIME=:8, START_SCN=:9, OLDEST_TRANSACTION_ID=:10, LWM_EXTERNAL_POS=:11, OLDEST_POSITION=:12, PROCESSED_POSITION=:13, START_POSITION=:14, OLDEST_CREATE_TIME=:15, XOUT_PROCESSED_POSITION=:16, XOUT_PROCESSED_CREATE_TIME=:17, XOUT_PROCESSED_TID=:18, APPLIED_HIGH_POSITION=:19, XOUT_PROCESSED_TIME=:20, SPARE5=:21, PTO_RECOVERY_SCN=:22, PTO_RECOVERY_INCARNATION=DECODE(:23, PTO_RECOVERY_SCN, PTO_RECOVERY_INCARNATION, (select incarnation# from v$database_incarnation where status = 'CURRENT')) WHERE APPLY#=:24 |
gymnsx3hbf2xy | SELECT NETWORK_ELEMENT_V, LOCATION_ZONE_CODE_V FROM CBSOGG.FXL_SERVICE_MAST WHERE SERV_ACC_LINK_CODE_N = :B1 |