SQL Id | SQL Text |
05td93dhf1b7y | BEGIN :1 := XLA_00200_AAD_C_011111_PKG.CreateJournalEntries(:2, :3, :4, :5, :6 ); END; |
05ywgcja87h9m | UPDATE AP_INVOICE_DISTRIBUTIONS_ALL D SET MATCH_STATUS_FLAG = 'S' WHERE NVL(MATCH_STATUS_FLAG, '!') <> 'A' AND NVL(D.POSTED_FLAG, 'N' ) = 'N' AND D.INVOICE_ID = :B1 |
0643vntsbbshw | select V.PROFILE_OPTION_VALUE from FND_PROFILE_OPTIONS O, FND_PROFILE_OPTION_VALUES V where O.PROFILE_OPTION_NAME = :1 and V.LEVEL_ID = :2 and O.START_DATE_ACTIVE <= SYSDATE and nvl(O.END_DATE_ACTIVE, SYSDATE) >= SYSDATE and O.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID and O.APPLICATION_ID = V.APPLICATION_ID and V.LEVEL_VALUE_APPLICATION_ID = :3 and V.LEVEL_VALUE = :4 |
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 |
17d40vwcct4g6 | select instance_name from v$instance |
19p399n80dnsq | begin :con := "ZX_SECURITY"."ADD_ICX_SESSION_ID"(:sn, :on); end; |
19w2h52d7ggr7 | SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER IN ( 'NLS_LANGUAGE', 'NLS_DATE_LANGUAGE', 'NLS_SORT', 'NLS_TERRITORY', 'NLS_DATE_FORMAT', 'NLS_NUMERIC_CHARACTERS', 'NLS_CHARACTERSET' ) |
1c0s28y6dgtp6 |
SELECT /*+ leading(xet) cardinality(xet, 1) */ XET.ENTITY_ID , XET.LEGAL_ENTITY_ID , XET.ENTITY_CODE , XET.TRANSACTION_NUMBER , XET.EVENT_ID , XET.EVENT_CLASS_CODE , XET.EVENT_TYPE_CODE , XET.EVENT_NUMBER , XET.EVENT_DATE , XET.TRANSACTION_DATE , XET.REFERENCE_NUM_1 , XET.REFERENCE_NUM_2 , XET.REFERENCE_NUM_3 , XET.REFERENCE_NUM_4 , XET.REFERENCE_CHAR_1 , XET.REFERENCE_CHAR_2 , XET.REFERENCE_CHAR_3 , XET.REFERENCE_CHAR_4 , XET.REFERENCE_DATE_1 , XET.REFERENCE_DATE_2 , XET.REFERENCE_DATE_3 , XET.REFERENCE_DATE_4 , XET.EVENT_CREATED_BY , XET.BUDGETARY_CONTROL_FLAG , L1.LINE_NUMBER , L3.PO_NUMBER SOURCE_8 , L1.AID_INVOICE_DIST_ID SOURCE_11 , L1.LINE_NUMBER SOURCE_28 , L5.EXCHANGE_VARIANCE_ACCOUNT_ID SOURCE_36 , L1.LCM_ENABLED SOURCE_37 , FVL37.MEANING SOURCE_37_MEANING , L1.AID_LINE_TYPE_LOOKUP_CODE SOURCE_38 , FVL38.MEANING SOURCE_38_MEANING , L5.TAX_VARIANCE_ACCOUNT_ID SOURCE_39 , L1.INV_DIST_BASE_AMOUNT SOURCE_41 , L1.RELATED_INV_DIST_DEST_TYPE SOURCE_42 , FVL42.MEANING SO
URCE_42_MEANING , L1.AID_DIST_CCID SOURCE_50 , L1.ASAT_LIAB_CCID SOURCE_60 , L1.AWT_RELATED_DIST_ACCOUNT SOURCE_63 , L1.AID_RET_RELATED_DIST_CCID SOURCE_65 , L1.VARIANCE_PARENT_DIST_CCID SOURCE_66 , L1.PO_VARIANCE_ACCOUNT SOURCE_70 , L1.POD_ACCRUE_ON_RECEIPT_FLAG SOURCE_74 , FVL74.MEANING SOURCE_74_MEANING , L1.SELF_ASSESSED_TAX_ACCOUNT SOURCE_77 , L1.SELF_ASSESSED_TAX_FLAG SOURCE_78 , FVL78.MEANING SOURCE_78_MEANING , L1.DIST_ACCOUNT_REVERSAL_OPTION SOURCE_80 , L1.DISTRIBUTION_LINK_TYPE SOURCE_82 , L1.ALLOC_TO_MAIN_DIST_ID SOURCE_84 , L1.BUS_FLOW_AP_APP_ID SOURCE_86 , L1.BUS_FLOW_INV_DIST_TYPE SOURCE_87 , L1.BUS_FLOW_INV_ENTITY_CODE SOURCE_88 , L1.BUS_FLOW_INV_DIST_ID SOURCE_89 , L1.BUS_FLOW_INV_ID SOURCE_90 , L1.UPG_ENC_CR_CCID SOURCE_91 , L1.UPG_ENC_CR_AMT SOURCE_92 , L1.UPG_ENC_CR_BASE_AMT SOURCE_94 , L1.UPG_ENC_DR_CCID SOURCE_95 , L1.UPG_ENC_DR_AMT SOURCE_96 , L1.UPG_ENC_DR_BASE_AMT SOURCE_97 , L1.UPG_AP_ENCUM_OPTION SOURCE_98 , L1.AID_AMOUNT SOURCE_99 ,
L1.DEFERRED_END_DATE SOURCE_103 , L1.DEFERRED_OPTION SOURCE_104 , L1.DEFERRED_START_DATE SOURCE_105 , L1.OVERRIDE_ACCTD_AMT_FLAG SOURCE_106 , FVL106.MEANING SOURCE_106_MEANING , L1.AID_PARENT_REVERSAL_ID SOURCE_110 , L1.AID_STAT_AMOUNT SOURCE_111 , L6.TAX_LINE_ID SOURCE_112 , L6.REC_NREC_TAX_DIST_ID SOURCE_113 , L1.SUMMARY_TAX_LINE_ID SOURCE_114 , L1.UPG_CR_ENC_TYPE_ID SOURCE_115 , L1.UPG_DR_ENC_TYPE_ID SOURCE_116 , L1.BUS_FLOW_PO_APP_ID SOURCE_117 , L1.BUS_FLOW_PO_DIST_TYPE SOURCE_118 , L1.BUS_FLOW_PO_ENTITY_CODE SOURCE_119 , L1.BUS_FLOW_PO_DIST_ID SOURCE_120 , L1.BUS_FLOW_PO_DOC_ID SOURCE_121 , L1.PO_RCV_CURR_CONVERSION_DATE SOURCE_125 , L1.PO_RCV_CURR_CONVERSION_RATE SOURCE_126 , L1.PO_RCV_CURR_CONVERSION_TYPE SOURCE_127 , L1.BUS_FLOW_RET_INV_DIST_ID SOURCE_196 , L1.BUS_FLOW_RET_INV_ID SOURCE_197 FROM XLA_EVENTS_GT XET , AP_INVOICE_EXTRACT_DETAILS_V L1 , AP_PO_HEADERS_EXTRACT_V L3 , RCV_PARAMETERS L5 , ZX_AP_DEF_TAX_EXTRACT_V L6 , FND_LOOKUP_VALUES FVL37
, FND_LOOKUP_VALUES FVL38 , FND_LOOKUP_VALUES FVL42 , FND_LOOKUP_VALUES FVL74 , FND_LOOKUP_VALUES FVL78 , FND_LOOKUP_VALUES FVL106 WHERE XET.EVENT_ID BETWEEN :B5 AND :B4 AND XET.EVENT_DATE BETWEEN :B3 AND :B2 AND XET.EVENT_CLASS_CODE = :B1 AND XET.EVENT_STATUS_CODE <> 'N' AND L1.EVENT_ID = XET.EVENT_ID AND L1.POD_PO_HEADER_ID = L3.PO_HEADER_ID (+) AND L1.ORGANIZATION_ID = L5.ORGANIZATION_ID (+) AND L1.ZRND_TAX_DIST_ID = L6.REC_NREC_TAX_DIST_ID (+) AND FVL37.LOOKUP_TYPE(+) = 'YES_NO' AND FVL37.LOOKUP_CODE(+) = L1.LCM_ENABLED AND FVL37.VIEW_APPLICATION_ID(+) = 0 AND FVL37.LANGUAGE(+) = USERENV('LANG') AND FVL38.LOOKUP_TYPE(+) = 'INVOICE DISTRIBUTION TYPE' AND FVL38.LOOKUP_CODE(+) = L1.AID_LINE_TYPE_LOOKUP_CODE AND FVL38.VIEW_APPLICATION_ID(+) = 200 AND FVL38.LANGUAGE(+) = USERENV('LANG') AND FVL42.LOOKUP_TYPE(+) = 'DESTINATION TYPE' AND FVL42.LOOKUP_CODE(+) = L1.RELATED_INV_DIST_DEST_TYPE AND FVL42.VIEW_APPLICATION_ID(+) = 201 AND FVL42.LANGUAGE(+) = USERENV('LANG') AND FVL74.
LOOKUP_TYPE(+) = 'YES_NO' AND FVL74.LOOKUP_CODE(+) = L1.POD_ACCRUE_ON_RECEIPT_FLAG AND FVL74.VIEW_APPLICATION_ID(+) = 0 AND FVL74.LANGUAGE(+) = USERENV('LANG') AND FVL78.LOOKUP_TYPE(+) = 'YES_NO' AND FVL78.LOOKUP_CODE(+) = L1.SELF_ASSESSED_TAX_FLAG AND FVL78.VIEW_APPLICATION_ID(+) = 0 AND FVL78.LANGUAGE(+) = USERENV('LANG') AND FVL106.LOOKUP_TYPE(+) = 'YES_NO' AND FVL106.LOOKUP_CODE(+) = L1.OVERRIDE_ACCTD_AMT_FLAG AND FVL106.VIEW_APPLICATION_ID(+) = 0 AND FVL106.LANGUAGE(+) = USERENV('LANG') |
1dkqbxgby1zrq | select to_char(CODE_COMBINATION_ID), nvl(ENABLED_FLAG, 'Y'), nvl(SUMMARY_FLAG, 'N'), to_char(START_DATE_ACTIVE, 'YYYY/MM/DD HH24:MI:SS'), to_char(END_DATE_ACTIVE, 'YYYY/MM/DD HH24:MI:SS'), SEGMENT1, SEGMENT2, SEGMENT3, SEGMENT4, SEGMENT5, SEGMENT6, SEGMENT7, SEGMENT8, SEGMENT9, SEGMENT10, SEGMENT11, SEGMENT12, ACCOUNT_TYPE, REFERENCE3, JGZZ_RECON_FLAG, DETAIL_BUDGETING_ALLOWED_FLAG, DETAIL_POSTING_ALLOWED_FLAG from GL_CODE_COMBINATIONS where CHART_OF_ACCOUNTS_ID = :FND_BIND1 and CODE_COMBINATION_ID = :FND_BIND2 |
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 |
1ubm0swfj9nv5 | SELECT PRECISION, EXTENDED_PRECISION, MINIMUM_ACCOUNTABLE_UNIT FROM FND_CURRENCIES C WHERE :B1 = C.CURRENCY_CODE |
1v818hwxjxy58 | select FND_FLEX_VALUES_VL.FLEX_VALUE, FND_FLEX_VALUES_VL.FLEX_VALUE, FND_FLEX_VALUES_VL.DESCRIPTION, FND_FLEX_VALUES_VL.ENABLED_FLAG, to_char(FND_FLEX_VALUES_VL.START_DATE_ACTIVE, 'YYYY/MM/DD HH24:MI:SS'), to_char(FND_FLEX_VALUES_VL.END_DATE_ACTIVE, 'YYYY/MM/DD HH24:MI:SS'), FND_FLEX_VALUES_VL.SUMMARY_FLAG, FND_FLEX_VALUES_VL.COMPILED_VALUE_ATTRIBUTES from FND_FLEX_VALUES_VL FND_FLEX_VALUES_VL where (( FND_FLEX_VALUES_VL.FLEX_VALUE_SET_ID = :FND_BIND1) AND (
((1=1)
AND /* GL_COA_BS_TAG */
(GL_AFF_AWC_API_PKG.gl_valid_flex_values(:FND_BIND2, FND_FLEX_VALUES_VL.Flex_Value) = 'Y')
)
)) and FND_FLEX_VALUES_VL.FLEX_VALUE = :FND_BIND3 |
1x86a57bmfjhp | select view_obj.owner# from user$ u, obj$ view_obj, cdef$ cdef, con$ con where u.spare2=:1 and u.ext_username=:2 and u.user#=view_obj.owner# and view_obj.type#=4 and view_obj.obj#=cdef.obj# and cdef.con#=con.con# and con.name=:3 |
26a2tvptkg3hw |
INSERT ALL WHEN (ZX_LOCATION_MISSING = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_LOCATION_MISSING', :B30 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_LINE_CLASS_INVALID = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_LINE_CLASS_INVALID', :B29 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_TRX_LINE_TYPE_INVALID = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID
, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TRX_LINE_TYPE_INVALID', :B28 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_LINE_AMT_INCL_TAX_INVALID = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_LINE_AMT_INCTAX_INVALID', :B27 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (PRODUCT_CATEG_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_
NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_CATEG_NOT_EXIST', :B26 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (PRODUCT_CATEG_NOT_EFFECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_CATEG_NOT_EFFECTIVE', :B25 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (PRODUCT_CATEG_COUNTRY_INCONSIS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE
_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_CATEG_COUNTRY_INCON', :B24 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (USER_DEF_FC_CODE_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_USER_DEF_FC_CODE_NOT_EXIST', :B23 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (USER_DEF_FC_CODE_NOT_EFFECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID
, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_USER_DEF_FC_CODE_NOT_EFFECT', :B22 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (USER_DEF_COUNTRY_INCONSIS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_USER_DEF_COUNTRY_INCONSIS', :B21 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (DOC_FC_CODE_NOT_EFFECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_
DOC_FC_CODE_NOT_EFFECTIVE', :B20 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (TRX_BIZ_FC_CODE_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TRX_BIZ_FC_CODE_NOT_EXIST', :B19 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (TRX_BIZ_FC_CODE_NOT_EFFECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TRX_BIZ_FC_CODE_NOT_EFFECT', :B18 , TRX_LEVEL_TYPE, INTERFACE_LI
NE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (TRX_BIZ_FC_COUNTRY_INCONSIS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TRX_BIZ_FC_COUNTRY_INCONSIS', :B17 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (INTENDED_USE_CODE_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INTENDED_USE_CODE_NOT_EXIST', :B16 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (INTENDED_USE_NOT_EFF
ECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INTENDED_USE_NOT_EFFECTIVE', :B15 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (INTENDED_USE_CONTRY_INCONSIS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INTENDED_USE_COUNTRY_INCON', :B14 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (PRODUCT_TYPE_CODE_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID,
ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_TYPE_CODE_NOT_EXIST', :B13 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (PRODUCT_TYPE_NOT_EFFECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_TYPE_NOT_EFFECTIVE', :B12 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (PRODUCT_FC_CODE_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_T
AX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_FC_CODE_NOT_EXIST', :B11 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_LINE_CTRL_AMT_NOT_NULL = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_LINE_CTRL_AMT_NOT_NULL', :B10 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_EXEMPTION_CTRL_FLAG_INVALID = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERF
ACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_EXEMPTION_CTRL_FLAG_INVALID', :B9 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_PRODUCT_TYPE_INVALID = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_PRODUCT_TYPE_INVALID', :B8 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_INVALID_TAX_LINES = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EV
ENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INVALID_TAX_LINES', :B7 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_INVALID_LINE_TAX_AMT = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INVALID_LINE_TAX_AMT', :B6 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_INVALID_TAX_FOR_ALLOC_FLG = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INVALID_TAX_FOR_ALLOC_FLG', :B5 ,
TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (ZX_INVALID_TAX_ONLY_TAX_LINES = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_INVALID_TAX_ONLY_TAX_LINES', :B4 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (TAX_RATE_NOT_EXISTS = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TAX_RATE_NOT_EXIST', :B3 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (NVL(TAX_R
ATE_NOT_EXISTS, 'N') <> 'Y' AND TAX_RATE_CODE_NOT_EFFECTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TAX_RATE_NOT_EFFECTIVE', :B2 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) WHEN (NVL(TAX_RATE_NOT_EXISTS, 'N') <> 'Y' AND TAX_RATE_CODE_NOT_ACTIVE = 'Y') THEN INTO ZX_VALIDATION_ERRORS_GT( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, SUMMARY_TAX_LINE_NUMBER, MESSAGE_NAME, MESSAGE_TEXT, TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) VALUES( APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, TRX_ID, TRX_LINE_ID, NULL, 'ZX_TAX_RATE_NOT_ACTIVE', :B1 , TRX_LEVEL_TYPE, INTERFACE_LINE_ENTITY_CODE, INTERFACE_LINE_ID ) SEL
ECT HEADER.APPLICATION_ID, HEADER.ENTITY_CODE, HEADER.EVENT_CLASS_CODE, HEADER.TRX_ID, LINES_GT.TRX_LINE_ID, LINES_GT.TRX_LINE_ID INTERFACE_LINE_ID , LINES_GT.ENTITY_CODE INTERFACE_LINE_ENTITY_CODE, LINES_GT.TRX_LEVEL_TYPE, CASE WHEN (LINES_GT.SHIP_FROM_LOCATION_ID IS NOT NULL OR LINES_GT.SHIP_TO_LOCATION_ID IS NOT NULL OR LINES_GT.POA_LOCATION_ID IS NOT NULL OR LINES_GT.POO_LOCATION_ID IS NOT NULL OR LINES_GT.PAYING_LOCATION_ID IS NOT NULL OR LINES_GT.OWN_HQ_LOCATION_ID IS NOT NULL OR LINES_GT.TRADING_HQ_LOCATION_ID IS NOT NULL OR LINES_GT.POC_LOCATION_ID IS NOT NULL OR LINES_GT.POI_LOCATION_ID IS NOT NULL OR LINES_GT.POD_LOCATION_ID IS NOT NULL OR LINES_GT.BILL_TO_LOCATION_ID IS NOT NULL OR LINES_GT.BILL_FROM_LOCATION_ID IS NOT NULL OR LINES_GT.TITLE_TRANSFER_LOCATION_ID IS NOT NULL) THEN NULL ELSE 'Y' END ZX_LOCATION_MISSING, NVL2(LINES_GT.LINE_CLASS, CASE WHEN (NOT EXISTS (SELECT 1 FROM FND_LOOKUPS LKP WHERE LINES_GT.LINE_CLASS = LKP.LOOKUP_CODE AND LKP.LOOKUP_TYPE = 'ZX_
LINE_CLASS')) THEN 'Y' ELSE NULL END, NULL ) ZX_LINE_CLASS_INVALID, CASE WHEN (LINES_GT.TRX_LINE_TYPE NOT IN('ITEM', 'FREIGHT', 'MISC', 'MISCELLANEOUS')) THEN 'Y' ELSE NULL END ZX_TRX_LINE_TYPE_INVALID, CASE WHEN (LINES_GT.LINE_AMT_INCLUDES_TAX_FLAG IS NULL OR LINES_GT.LINE_AMT_INCLUDES_TAX_FLAG NOT IN ('A', 'N', 'S')) THEN 'Y' ELSE NULL END ZX_LINE_AMT_INCL_TAX_INVALID, NVL2(LINES_GT.PRODUCT_CATEGORY, CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_PRODUCT_CATEGORIES_V WHERE CLASSIFICATION_CODE = LINES_GT.PRODUCT_CATEGORY AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) ) ) THEN 'Y' ELSE NULL END, NULL ) PRODUCT_CATEG_NOT_EXISTS, CASE WHEN LINES_GT.PRODUCT_CATEGORY IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_PRODUCT_CATEGORIES_V WHERE CLASSIFICATION_CODE = LINES_GT.PRODUCT_CATEGORY AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY))) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_PRODUCT_CATEGORIES_V WHERE CLASSIFICATION_CODE
= LINES_GT.PRODUCT_CATEGORY AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) AND NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE) BETWEEN EFFECTIVE_FROM AND NVL(EFFECTIVE_TO, NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE)) ) ) THEN 'Y' ELSE NULL END ELSE NULL END PRODUCT_CATEG_NOT_EFFECTIVE, CASE WHEN LINES_GT.PRODUCT_CATEGORY IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_PRODUCT_CATEGORIES_V WHERE CLASSIFICATION_CODE = LINES_GT.PRODUCT_CATEGORY AND COUNTRY_CODE IS NOT NULL)) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_PRODUCT_CATEGORIES_V WHERE CLASSIFICATION_CODE = LINES_GT.PRODUCT_CATEGORY AND COUNTRY_CODE IS NOT NULL AND COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY)) THEN 'Y' ELSE NULL END ELSE NULL END PRODUCT_CATEG_COUNTRY_INCONSIS, NVL2(LINES_GT.USER_DEFINED_FISC_CLASS, CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_USER_DEFINED_V WHERE CLASSIFICATION_CODE = LINES_GT.USER_DEFINED_FISC_CLASS AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_T
AXATION_COUNTRY))) THEN 'Y' ELSE NULL END, NULL) USER_DEF_FC_CODE_NOT_EXISTS, CASE WHEN LINES_GT.USER_DEFINED_FISC_CLASS IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_USER_DEFINED_V WHERE CLASSIFICATION_CODE = LINES_GT.USER_DEFINED_FISC_CLASS AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY))) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_USER_DEFINED_V WHERE CLASSIFICATION_CODE = LINES_GT.USER_DEFINED_FISC_CLASS AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) AND NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE) BETWEEN EFFECTIVE_FROM AND NVL(EFFECTIVE_TO, NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE)) ) ) THEN 'Y' ELSE NULL END ELSE NULL END USER_DEF_FC_CODE_NOT_EFFECTIVE, CASE WHEN LINES_GT.USER_DEFINED_FISC_CLASS IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_USER_DEFINED_V WHERE CLASSIFICATION_CODE = LINES_GT.USER_DEFINED_FISC_CLASS AND COUNTRY_CODE IS NOT NULL)) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_USER_DEFINED_V W
HERE CLASSIFICATION_CODE = LINES_GT.USER_DEFINED_FISC_CLASS AND COUNTRY_CODE IS NOT NULL AND COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY)) THEN 'Y' ELSE NULL END ELSE NULL END USER_DEF_COUNTRY_INCONSIS, CASE WHEN HEADER.DOCUMENT_SUB_TYPE IS NOT NULL AND FC_DOC.CLASSIFICATION_CODE IS NOT NULL THEN CASE WHEN (FC_DOC.COUNTRY_CODE IS NULL OR FC_DOC.COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) THEN CASE WHEN ( LINES_GT.TAX_DATE NOT BETWEEN FC_DOC.EFFECTIVE_FROM AND NVL(FC_DOC.EFFECTIVE_TO, LINES_GT.TAX_DATE) AND (NOT EXISTS (SELECT 1 FROM ZX_TRANSACTION_LINES_GT WHERE APPLICATION_ID = LINES_GT.APPLICATION_ID AND ENTITY_CODE = LINES_GT.ENTITY_CODE AND EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE AND TRX_ID = LINES_GT.TRX_ID AND TRX_LINE_ID < LINES_GT.TRX_LINE_ID AND TRX_LEVEL_TYPE = LINES_GT.TRX_LEVEL_TYPE ) ) ) THEN 'Y' ELSE NULL END ELSE NULL END ELSE NULL END DOC_FC_CODE_NOT_EFFECTIVE, NVL2(LINES_GT.TRX_BUSINESS_CATEGORY, CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_BUSINESS_CA
TEGORIES_V WHERE CLASSIFICATION_CODE = DECODE(LINES_GT.SOURCE_APPLICATION_ID, NULL, LINES_GT.TRX_BUSINESS_CATEGORY, DECODE(LINES_GT.SOURCE_EVENT_CLASS_CODE, 'INTERCOMPANY_TRX', REPLACE(LINES_GT.TRX_BUSINESS_CATEGORY, 'SALES_TRANSACTION', 'PURCHASE_TRANSACTION'), LINES_GT.TRX_BUSINESS_CATEGORY)) AND (APPLICATION_ID IS NULL OR (APPLICATION_ID = LINES_GT.APPLICATION_ID AND (ENTITY_CODE IS NULL OR (ENTITY_CODE = LINES_GT.ENTITY_CODE AND (EVENT_CLASS_CODE IS NULL OR EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE) ) ) ) ) AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY))) THEN 'Y' ELSE NULL END, NULL ) TRX_BIZ_FC_CODE_NOT_EXISTS, CASE WHEN LINES_GT.TRX_BUSINESS_CATEGORY IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_BUSINESS_CATEGORIES_V WHERE CLASSIFICATION_CODE = DECODE(LINES_GT.SOURCE_APPLICATION_ID, NULL, LINES_GT.TRX_BUSINESS_CATEGORY, DECODE(LINES_GT.SOURCE_EVENT_CLASS_CODE, 'INTERCOMPANY_TRX', REPLACE(LINES_GT.TRX_BUSINESS_CATEGORY, 'SALES_TRANS
ACTION', 'PURCHASE_TRANSACTION'), LINES_GT.TRX_BUSINESS_CATEGORY) ) AND (APPLICATION_ID IS NULL OR (APPLICATION_ID = LINES_GT.APPLICATION_ID AND (ENTITY_CODE IS NULL OR (ENTITY_CODE = LINES_GT.ENTITY_CODE AND (EVENT_CLASS_CODE IS NULL OR EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE)))) ) AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) ) ) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_BUSINESS_CATEGORIES_V WHERE CLASSIFICATION_CODE = DECODE(LINES_GT.SOURCE_APPLICATION_ID, NULL, LINES_GT.TRX_BUSINESS_CATEGORY, DECODE(LINES_GT.SOURCE_EVENT_CLASS_CODE, 'INTERCOMPANY_TRX', REPLACE(LINES_GT.TRX_BUSINESS_CATEGORY, 'SALES_TRANSACTION', 'PURCHASE_TRANSACTION'), LINES_GT.TRX_BUSINESS_CATEGORY)) AND (APPLICATION_ID IS NULL OR (APPLICATION_ID = LINES_GT.APPLICATION_ID AND (ENTITY_CODE IS NULL OR (ENTITY_CODE = LINES_GT.ENTITY_CODE AND (EVENT_CLASS_CODE IS NULL OR EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE)))) ) AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE =
HEADER.DEFAULT_TAXATION_COUNTRY) AND NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE) BETWEEN EFFECTIVE_FROM AND NVL(EFFECTIVE_TO, NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE)) ) ) THEN 'Y' ELSE NULL END ELSE NULL END TRX_BIZ_FC_CODE_NOT_EFFECTIVE, CASE WHEN LINES_GT.TRX_BUSINESS_CATEGORY IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_BUSINESS_CATEGORIES_V WHERE CLASSIFICATION_CODE = DECODE(LINES_GT.SOURCE_APPLICATION_ID, NULL, LINES_GT.TRX_BUSINESS_CATEGORY, DECODE(LINES_GT.SOURCE_EVENT_CLASS_CODE, 'INTERCOMPANY_TRX', REPLACE(LINES_GT.TRX_BUSINESS_CATEGORY, 'SALES_TRANSACTION', 'PURCHASE_TRANSACTION'), LINES_GT.TRX_BUSINESS_CATEGORY)) AND (APPLICATION_ID IS NULL OR (APPLICATION_ID = LINES_GT.APPLICATION_ID AND (ENTITY_CODE IS NULL OR (ENTITY_CODE = LINES_GT.ENTITY_CODE AND (EVENT_CLASS_CODE IS NULL OR EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE)))) ) AND COUNTRY_CODE IS NOT NULL)) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_BUSINESS_CATEGORIES_V WHERE CLASSIFICATION_CODE =
DECODE(LINES_GT.SOURCE_APPLICATION_ID, NULL, LINES_GT.TRX_BUSINESS_CATEGORY, DECODE(LINES_GT.SOURCE_EVENT_CLASS_CODE, 'INTERCOMPANY_TRX', REPLACE(LINES_GT.TRX_BUSINESS_CATEGORY, 'SALES_TRANSACTION', 'PURCHASE_TRANSACTION'), LINES_GT.TRX_BUSINESS_CATEGORY)) AND (APPLICATION_ID IS NULL OR (APPLICATION_ID = LINES_GT.APPLICATION_ID AND (ENTITY_CODE IS NULL OR (ENTITY_CODE = LINES_GT.ENTITY_CODE AND (EVENT_CLASS_CODE IS NULL OR EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE)))) ) AND COUNTRY_CODE IS NOT NULL AND COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) ) THEN 'Y' ELSE NULL END ELSE NULL END TRX_BIZ_FC_COUNTRY_INCONSIS, NVL2(LINES_GT.LINE_INTENDED_USE, CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_INTENDED_USE_V WHERE CLASSIFICATION_CODE = LINES_GT.LINE_INTENDED_USE AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY)) ) THEN 'Y' ELSE NULL END, NULL) INTENDED_USE_CODE_NOT_EXISTS, CASE WHEN LINES_GT.LINE_INTENDED_USE IS NOT NULL AND (EXISTS (SELECT 1 FROM
ZX_FC_INTENDED_USE_V WHERE CLASSIFICATION_CODE = LINES_GT.LINE_INTENDED_USE AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY))) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_INTENDED_USE_V WHERE CLASSIFICATION_CODE = LINES_GT.LINE_INTENDED_USE AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY) AND NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE) BETWEEN EFFECTIVE_FROM AND NVL(EFFECTIVE_TO, NVL(LINES_GT.TRX_LINE_DATE, HEADER.TRX_DATE)))) THEN 'Y' ELSE NULL END ELSE NULL END INTENDED_USE_NOT_EFFECTIVE, CASE WHEN LINES_GT.LINE_INTENDED_USE IS NOT NULL AND (EXISTS (SELECT 1 FROM ZX_FC_INTENDED_USE_V WHERE CLASSIFICATION_CODE = LINES_GT.LINE_INTENDED_USE AND COUNTRY_CODE IS NOT NULL)) THEN CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_INTENDED_USE_V WHERE CLASSIFICATION_CODE = LINES_GT.LINE_INTENDED_USE AND COUNTRY_CODE IS NOT NULL AND COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY)) THEN 'Y' ELSE NULL END ELSE NULL END INTENDED_USE_CONTR
Y_INCONSIS, NVL2(LINES_GT.PRODUCT_TYPE, NVL(FND.LOOKUP_CODE, 'Y'), NULL ) PRODUCT_TYPE_CODE_NOT_EXISTS, CASE WHEN (FND.LOOKUP_CODE IS NOT NULL) THEN CASE WHEN ( LINES_GT.TAX_DATE BETWEEN FND.START_DATE_ACTIVE AND NVL(FND.END_DATE_ACTIVE, LINES_GT.TAX_DATE) ) THEN NULL ELSE 'Y' END ELSE NULL END PRODUCT_TYPE_NOT_EFFECTIVE, NVL2(LINES_GT.PRODUCT_FISC_CLASSIFICATION, CASE WHEN (NOT EXISTS (SELECT 1 FROM ZX_FC_PRODUCT_FISCAL_V WHERE CLASSIFICATION_CODE = LINES_GT.PRODUCT_FISC_CLASSIFICATION AND (COUNTRY_CODE IS NULL OR COUNTRY_CODE = HEADER.DEFAULT_TAXATION_COUNTRY))) THEN 'Y' ELSE NULL END, NULL) PRODUCT_FC_CODE_NOT_EXISTS, CASE WHEN (LINES_GT.LINE_LEVEL_ACTION <> 'CREATE' AND LINES_GT.CTRL_TOTAL_LINE_TX_AMT IS NOT NULL ) THEN 'Y' ELSE NULL END ZX_LINE_CTRL_AMT_NOT_NULL, CASE WHEN (LINES_GT.EXEMPTION_CONTROL_FLAG IS NOT NULL AND LINES_GT.EXEMPTION_CONTROL_FLAG NOT IN ('R', 'S', 'E')) THEN 'Y' ELSE NULL END ZX_EXEMPTION_CTRL_FLAG_INVALID, CASE WHEN (LINES_GT.PRODUCT_TYPE IS
NOT NULL AND LINES_GT.PRODUCT_TYPE NOT IN ('GOODS', 'SERVICES')) THEN 'Y' ELSE NULL END ZX_PRODUCT_TYPE_INVALID, CASE WHEN (LINES_GT.CTRL_HDR_TX_APPL_FLAG = 'Y' AND LINES_GT.LINE_LEVEL_ACTION <> 'LINE_INFO_TAX_ONLY' AND EXISTS (SELECT 1 FROM ZX_IMPORT_TAX_LINES_GT IMPTAXES_GT WHERE APPLICATION_ID = LINES_GT.APPLICATION_ID AND ENTITY_CODE = LINES_GT.ENTITY_CODE AND EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE AND TRX_ID = LINES_GT.TRX_ID AND TRX_LINE_ID = LINES_GT.TRX_LINE_ID) ) THEN 'Y' ELSE NULL END ZX_INVALID_TAX_LINES, CASE WHEN (LINES_GT.CTRL_TOTAL_LINE_TX_AMT IS NOT NULL AND EXISTS (SELECT 1 FROM ZX_TRX_TAX_LINK_GT WHERE APPLICATION_ID = LINES_GT.APPLICATION_ID AND ENTITY_CODE = LINES_GT.ENTITY_CODE AND EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE AND TRX_ID = LINES_GT.TRX_ID AND TRX_LINE_ID = LINES_GT.TRX_LINE_ID AND TRX_LEVEL_TYPE = LINES_GT.TRX_LEVEL_TYPE) ) THEN 'Y' ELSE NULL END ZX_INVALID_LINE_TAX_AMT, CASE WHEN (LINES_GT.CTRL_TOTAL_LINE_TX_AMT IS NOT NULL AND EXIS
TS(SELECT 1 FROM ZX_IMPORT_TAX_LINES_GT IMPTAXES_GT WHERE APPLICATION_ID = LINES_GT.APPLICATION_ID AND ENTITY_CODE = LINES_GT.ENTITY_CODE AND EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE AND TRX_ID = LINES_GT.TRX_ID AND TRX_LINE_ID IS NULL AND IMPTAXES_GT.TAX_LINE_ALLOCATION_FLAG = 'N') ) THEN 'Y' ELSE NULL END ZX_INVALID_TAX_FOR_ALLOC_FLG, CASE WHEN (LINES_GT.LINE_LEVEL_ACTION = 'LINE_INFO_TAX_ONLY' AND EXISTS (SELECT 1 FROM ZX_IMPORT_TAX_LINES_GT IMPTAXES_GT WHERE APPLICATION_ID = LINES_GT.APPLICATION_ID AND ENTITY_CODE = LINES_GT.ENTITY_CODE AND EVENT_CLASS_CODE = LINES_GT.EVENT_CLASS_CODE AND TRX_ID = LINES_GT.TRX_ID AND TRX_LINE_ID = LINES_GT.TRX_LINE_ID AND IMPTAXES_GT.TAX_LINE_ALLOCATION_FLAG <> 'Y') ) THEN 'Y' ELSE NULL END ZX_INVALID_TAX_ONLY_TAX_LINES, CASE WHEN LINES_GT.OUTPUT_TAX_CLASSIFICATION_CODE IS NOT NULL AND NOT EXISTS (SELECT 1 FROM ZX_OUTPUT_CLASSIFICATIONS_V WHERE LOOKUP_CODE = LINES_GT.OUTPUT_TAX_CLASSIFICATION_CODE AND ORG_ID IN (HEADER.INTERNAL_ORGANIZA
TION_ID, -99)) THEN 'Y' ELSE CASE WHEN LINES_GT.INPUT_TAX_CLASSIFICATION_CODE IS NOT NULL AND NOT EXISTS (SELECT 1 FROM ZX_INPUT_CLASSIFICATIONS_V WHERE LOOKUP_CODE = LINES_GT.INPUT_TAX_CLASSIFICATION_CODE AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99)) THEN CASE WHEN (LINES_GT.SOURCE_APPLICATION_ID IS NOT NULL AND LINES_GT.SOURCE_EVENT_CLASS_CODE = 'INTERCOMPANY_TRX' AND NOT EXISTS (SELECT 1 FROM ZX_INPUT_CLASSIFICATIONS_V WHERE UPPER(LOOKUP_CODE) = UPPER(LINES_GT.INPUT_TAX_CLASSIFICATION_CODE) AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99))) THEN 'Y' ELSE NULL END ELSE NULL END END TAX_RATE_NOT_EXISTS, CASE WHEN LINES_GT.OUTPUT_TAX_CLASSIFICATION_CODE IS NOT NULL AND NOT EXISTS (SELECT 1 FROM ZX_OUTPUT_CLASSIFICATIONS_V WHERE LOOKUP_CODE = LINES_GT.OUTPUT_TAX_CLASSIFICATION_CODE AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99) AND LINES_GT.TAX_DATE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, LINES_GT.TAX_DATE) ) THEN 'Y' ELSE CASE WHEN LINES_GT.INPUT_TAX_C
LASSIFICATION_CODE IS NOT NULL AND NOT EXISTS (SELECT 1 FROM ZX_INPUT_CLASSIFICATIONS_V WHERE LOOKUP_CODE = LINES_GT.INPUT_TAX_CLASSIFICATION_CODE AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99) AND LINES_GT.TAX_DATE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, LINES_GT.TAX_DATE) ) THEN CASE WHEN (LINES_GT.SOURCE_APPLICATION_ID IS NOT NULL AND LINES_GT.SOURCE_EVENT_CLASS_CODE = 'INTERCOMPANY_TRX' AND NOT EXISTS (SELECT 1 FROM ZX_INPUT_CLASSIFICATIONS_V WHERE UPPER(LOOKUP_CODE) = UPPER(LINES_GT.INPUT_TAX_CLASSIFICATION_CODE) AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99) AND LINES_GT.TAX_DATE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, LINES_GT.TAX_DATE) ) ) THEN 'Y' ELSE NULL END ELSE NULL END END TAX_RATE_CODE_NOT_EFFECTIVE, CASE WHEN LINES_GT.OUTPUT_TAX_CLASSIFICATION_CODE IS NOT NULL AND NOT EXISTS (SELECT 1 FROM ZX_OUTPUT_CLASSIFICATIONS_V WHERE LOOKUP_CODE = LINES_GT.OUTPUT_TAX_CLASSIFICATION_CODE AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99) AND
ENABLED_FLAG = 'Y') THEN 'Y' ELSE CASE WHEN LINES_GT.INPUT_TAX_CLASSIFICATION_CODE IS NOT NULL AND NOT EXISTS (SELECT 1 FROM ZX_INPUT_CLASSIFICATIONS_V WHERE LOOKUP_CODE = LINES_GT.INPUT_TAX_CLASSIFICATION_CODE AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99) AND ENABLED_FLAG = 'Y') THEN CASE WHEN (LINES_GT.SOURCE_APPLICATION_ID IS NOT NULL AND LINES_GT.SOURCE_EVENT_CLASS_CODE = 'INTERCOMPANY_TRX' AND NOT EXISTS (SELECT 1 FROM ZX_INPUT_CLASSIFICATIONS_V WHERE UPPER(LOOKUP_CODE) = UPPER(LINES_GT.INPUT_TAX_CLASSIFICATION_CODE) AND ORG_ID IN (HEADER.INTERNAL_ORGANIZATION_ID, -99) AND ENABLED_FLAG = 'Y')) THEN 'Y' ELSE NULL END ELSE NULL END END TAX_RATE_CODE_NOT_ACTIVE FROM ZX_TRX_HEADERS_GT HEADER, ZX_EVNT_CLS_MAPPINGS EVNTMAP, ZX_TRANSACTION_LINES_GT LINES_GT, ZX_FC_DOCUMENT_FISCAL_V FC_DOC, FND_LOOKUPS FND WHERE LINES_GT.TRX_ID = HEADER.TRX_ID AND LINES_GT.APPLICATION_ID = HEADER.APPLICATION_ID AND LINES_GT.ENTITY_CODE = HEADER.ENTITY_CODE AND LINES_GT.EVENT_CLASS_CODE = HEA
DER.EVENT_CLASS_CODE AND FC_DOC.CLASSIFICATION_CODE(+) = HEADER.DOCUMENT_SUB_TYPE AND HEADER.APPLICATION_ID = EVNTMAP.APPLICATION_ID (+) AND HEADER.ENTITY_CODE = EVNTMAP.ENTITY_CODE (+) AND HEADER.EVENT_CLASS_CODE = EVNTMAP.EVENT_CLASS_CODE(+) AND FND.LOOKUP_TYPE(+) = 'ZX_PRODUCT_TYPE' AND FND.LOOKUP_CODE(+) = LINES_GT.PRODUCT_TYPE |
2a0bdyyn0sgcb | SELECT ALOC.RULE_TYPE FROM AP_INVOICE_LINES AIL, AP_ALLOCATION_RULES ALOC WHERE AIL.INVOICE_ID = :B2 AND AIL.LINE_NUMBER = :B1 AND AIL.INVOICE_ID = ALOC.INVOICE_ID AND AIL.LINE_NUMBER = ALOC.CHRG_INVOICE_LINE_NUMBER(+) |
2aufmzdhuf380 | SELECT APPLICATION_SHORT_NAME FROM FND_APPLICATION WHERE APPLICATION_ID = :B1 |
2g0a1aa03ngs0 | SELECT FPI.STATUS, FPI.INDUSTRY, FPI.PRODUCT_VERSION, FOU.ORACLE_USERNAME, FPI.TABLESPACE, FPI.INDEX_TABLESPACE, FPI.TEMPORARY_TABLESPACE, FPI.SIZING_FACTOR FROM FND_PRODUCT_INSTALLATIONS FPI, FND_ORACLE_USERID FOU, FND_APPLICATION FA WHERE FPI.APPLICATION_ID = FA.APPLICATION_ID AND FPI.ORACLE_ID = FOU.ORACLE_ID AND FA.APPLICATION_SHORT_NAME = :B1 |
2tkw12w5k68vd | select user#, password, datats#, tempts#, type#, defrole, resource$, ptime, decode(defschclass, NULL, 'DEFAULT_CONSUMER_GROUP', defschclass), spare1, spare4, ext_username, spare2 from user$ where name=:1 |
3350m9wncvqvn | select HIERARCHY_TYPE, SITE_ENABLED_FLAG, APP_ENABLED_FLAG, RESP_ENABLED_FLAG, USER_ENABLED_FLAG, SERVER_ENABLED_FLAG, ORG_ENABLED_FLAG, SQL_VALIDATION, SERVERRESP_ENABLED_FLAG from FND_PROFILE_OPTIONS where PROFILE_OPTION_NAME = :1 |
357ymr0xrucg6 | begin :con := "MO_GLOBAL"."ORG_SECURITY"(:sn, :on); end; |
3dah89rz40kn9 | BEGIN dka_iapfacxgs_pkg.import(:errbuf, :rc); END; |
3gbufv8ymg5gg |
INSERT INTO ZX_LINES_DET_FACTORS( EVENT_ID, INTERNAL_ORGANIZATION_ID, APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, EVENT_CLASS_MAPPING_ID, EVENT_TYPE_CODE, DOC_EVENT_STATUS, LINE_LEVEL_ACTION, TRX_ID, TRX_LINE_ID, TRX_LEVEL_TYPE, TRX_DATE, TRX_DOC_REVISION, LEDGER_ID, TRX_CURRENCY_CODE, CURRENCY_CONVERSION_DATE, CURRENCY_CONVERSION_RATE, CURRENCY_CONVERSION_TYPE, MINIMUM_ACCOUNTABLE_UNIT, PRECISION, TRX_LINE_CURRENCY_CODE, TRX_LINE_CURRENCY_CONV_DATE, TRX_LINE_CURRENCY_CONV_RATE, TRX_LINE_CURRENCY_CONV_TYPE, TRX_LINE_MAU, TRX_LINE_PRECISION, LEGAL_ENTITY_ID, ESTABLISHMENT_ID, RECEIVABLES_TRX_TYPE_ID, DEFAULT_TAXATION_COUNTRY, TRX_NUMBER, TRX_LINE_NUMBER, TRX_LINE_DESCRIPTION, TRX_DESCRIPTION, TRX_COMMUNICATED_DATE, BATCH_SOURCE_ID, BATCH_SOURCE_NAME, DOC_SEQ_ID, DOC_SEQ_NAME, DOC_SEQ_VALUE, TRX_DUE_DATE, TRX_TYPE_DESCRIPTION, DOCUMENT_SUB_TYPE, SUPPLIER_TAX_INVOICE_NUMBER, SUPPLIER_TAX_INVOICE_DATE, SUPPLIER_EXCHANGE_RATE, TAX_INVOICE_DA
TE, TAX_INVOICE_NUMBER, FIRST_PTY_ORG_ID, TAX_EVENT_CLASS_CODE, TAX_EVENT_TYPE_CODE, RDNG_SHIP_TO_PTY_TX_PROF_ID, RDNG_SHIP_FROM_PTY_TX_PROF_ID, RDNG_BILL_TO_PTY_TX_PROF_ID, RDNG_BILL_FROM_PTY_TX_PROF_ID, RDNG_SHIP_TO_PTY_TX_P_ST_ID, RDNG_SHIP_FROM_PTY_TX_P_ST_ID, RDNG_BILL_TO_PTY_TX_P_ST_ID, RDNG_BILL_FROM_PTY_TX_P_ST_ID, LINE_INTENDED_USE , TRX_LINE_TYPE , TRX_SHIPPING_DATE, TRX_RECEIPT_DATE, TRX_SIC_CODE, FOB_POINT , TRX_WAYBILL_NUMBER, PRODUCT_ID, PRODUCT_FISC_CLASSIFICATION , PRODUCT_ORG_ID, UOM_CODE, PRODUCT_TYPE , PRODUCT_CODE, PRODUCT_CATEGORY , PRODUCT_DESCRIPTION, USER_DEFINED_FISC_CLASS, LINE_AMT, TRX_LINE_QUANTITY, UNIT_PRICE, CASH_DISCOUNT, VOLUME_DISCOUNT, TRADING_DISCOUNT, TRANSFER_CHARGE, TRANSPORTATION_CHARGE, INSURANCE_CHARGE, OTHER_CHARGE, ASSESSABLE_VALUE, ASSET_FLAG, ASSET_NUMBER, ASSET_ACCUM_DEPRECIATION, ASSET_TYPE, ASSET_COST, RELATED_DOC_APPLICATION_ID, RELATED_DOC_ENTITY_CODE, RELATED_DOC_EVENT_CLASS_CODE, RELATE
D_DOC_TRX_ID, RELATED_DOC_NUMBER, RELATED_DOC_DATE, APPLIED_FROM_APPLICATION_ID, APPLIED_FROM_ENTITY_CODE, APPLIED_FROM_EVENT_CLASS_CODE, APPLIED_FROM_TRX_ID, APPLIED_FROM_LINE_ID, APPLIED_FROM_TRX_NUMBER, ADJUSTED_DOC_APPLICATION_ID, ADJUSTED_DOC_ENTITY_CODE, ADJUSTED_DOC_EVENT_CLASS_CODE, ADJUSTED_DOC_TRX_ID, ADJUSTED_DOC_LINE_ID, ADJUSTED_DOC_NUMBER, ADJUSTED_DOC_DATE, APPLIED_TO_APPLICATION_ID, APPLIED_TO_ENTITY_CODE, APPLIED_TO_EVENT_CLASS_CODE, APPLIED_TO_TRX_ID , APPLIED_TO_TRX_LINE_ID, TRX_ID_LEVEL2, TRX_ID_LEVEL3, TRX_ID_LEVEL4, TRX_ID_LEVEL5, TRX_ID_LEVEL6, TRX_BUSINESS_CATEGORY, EXEMPT_CERTIFICATE_NUMBER, EXEMPT_REASON, HISTORICAL_FLAG, TRX_LINE_GL_DATE, LINE_AMT_INCLUDES_TAX_FLAG, ACCOUNT_CCID, ACCOUNT_STRING, MERCHANT_PARTY_TAX_PROF_ID, HQ_ESTB_PARTY_TAX_PROF_ID, NUMERIC1, NUMERIC2, NUMERIC3, NUMERIC4, NUMERIC5, NUMERIC6, NUMERIC7, NUMERIC8, NUMERIC9, NUMERIC10, CHAR1, CHAR2, CHAR3, CHAR4, CHAR5, CHAR6, CHAR7, CHAR8, CH
AR9, CHAR10, DATE1, DATE2, DATE3, DATE4, DATE5, DATE6, DATE7, DATE8, DATE9, DATE10, MERCHANT_PARTY_NAME, MERCHANT_PARTY_DOCUMENT_NUMBER, MERCHANT_PARTY_REFERENCE, MERCHANT_PARTY_TAXPAYER_ID, MERCHANT_PARTY_TAX_REG_NUMBER, MERCHANT_PARTY_ID, MERCHANT_PARTY_COUNTRY, SHIP_TO_LOCATION_ID, SHIP_FROM_LOCATION_ID, POA_LOCATION_ID, POO_LOCATION_ID, BILL_TO_LOCATION_ID, BILL_FROM_LOCATION_ID, PAYING_LOCATION_ID, OWN_HQ_LOCATION_ID, TRADING_HQ_LOCATION_ID, POC_LOCATION_ID, POI_LOCATION_ID, POD_LOCATION_ID, TITLE_TRANSFER_LOCATION_ID, SHIP_TO_PARTY_TAX_PROF_ID , SHIP_FROM_PARTY_TAX_PROF_ID, POA_PARTY_TAX_PROF_ID, POO_PARTY_TAX_PROF_ID, PAYING_PARTY_TAX_PROF_ID, OWN_HQ_PARTY_TAX_PROF_ID, TRADING_HQ_PARTY_TAX_PROF_ID, POI_PARTY_TAX_PROF_ID, POD_PARTY_TAX_PROF_ID, BILL_TO_PARTY_TAX_PROF_ID, BILL_FROM_PARTY_TAX_PROF_ID, TITLE_TRANS_PARTY_TAX_PROF_ID, SHIP_TO_SITE_TAX_PROF_ID, SHIP_FROM_SITE_TAX_PROF_ID, POA_SITE_TAX_PROF_ID, POO_SITE_TAX_PROF_ID, PAYING
_SITE_TAX_PROF_ID, OWN_HQ_SITE_TAX_PROF_ID, TRADING_HQ_SITE_TAX_PROF_ID, POI_SITE_TAX_PROF_ID, POD_SITE_TAX_PROF_ID, BILL_TO_SITE_TAX_PROF_ID, BILL_FROM_SITE_TAX_PROF_ID, TITLE_TRANS_SITE_TAX_PROF_ID, CTRL_HDR_TX_APPL_FLAG, CTRL_TOTAL_LINE_TX_AMT, CTRL_TOTAL_HDR_TX_AMT, REF_DOC_APPLICATION_ID, REF_DOC_ENTITY_CODE, REF_DOC_EVENT_CLASS_CODE, REF_DOC_TRX_ID, REF_DOC_LINE_ID, REF_DOC_LINE_QUANTITY, LINE_CLASS, TRX_LINE_DATE, INPUT_TAX_CLASSIFICATION_CODE, OUTPUT_TAX_CLASSIFICATION_CODE, INTERNAL_ORG_LOCATION_ID, PORT_OF_ENTRY_CODE, TAX_REPORTING_FLAG, TAX_AMT_INCLUDED_FLAG, COMPOUNDING_TAX_FLAG, SHIP_THIRD_PTY_ACCT_ID, BILL_THIRD_PTY_ACCT_ID, SHIP_THIRD_PTY_ACCT_SITE_ID, BILL_THIRD_PTY_ACCT_SITE_ID, SHIP_TO_CUST_ACCT_SITE_USE_ID, BILL_TO_CUST_ACCT_SITE_USE_ID, START_EXPENSE_DATE, TRX_BATCH_ID, APPLIED_TO_TRX_NUMBER, SOURCE_APPLICATION_ID, SOURCE_ENTITY_CODE, SOURCE_EVENT_CLASS_CODE, SOURCE_TRX_ID, SOURCE_LINE_ID, SOURCE_TRX_LEVEL_TYPE, SOURCE_TAX_LI
NE_ID, REF_DOC_TRX_LEVEL_TYPE, ADJUSTED_DOC_TRX_LEVEL_TYPE, APPLIED_TO_TRX_LEVEL_TYPE, APPLIED_FROM_TRX_LEVEL_TYPE, APPLICATION_DOC_STATUS, OBJECT_VERSION_NUMBER, TAX_PROCESSING_COMPLETED_FLAG, USER_UPD_DET_FACTORS_FLAG, RECORD_TYPE_CODE, HDR_TRX_USER_KEY1, HDR_TRX_USER_KEY2, HDR_TRX_USER_KEY3, HDR_TRX_USER_KEY4, HDR_TRX_USER_KEY5, HDR_TRX_USER_KEY6, LINE_TRX_USER_KEY1, LINE_TRX_USER_KEY2, LINE_TRX_USER_KEY3, LINE_TRX_USER_KEY4, LINE_TRX_USER_KEY5, LINE_TRX_USER_KEY6, TAX_CALCULATION_DONE_FLAG, REVERSED_APPLN_ID, REVERSED_ENTITY_CODE, REVERSED_EVNT_CLS_CODE, REVERSED_TRX_ID, REVERSED_TRX_LEVEL_TYPE, REVERSED_TRX_LINE_ID, EXEMPTION_CONTROL_FLAG, EXEMPT_REASON_CODE, INTERFACE_ENTITY_CODE, INTERFACE_LINE_ID, DEFAULTING_ATTRIBUTE1, DEFAULTING_ATTRIBUTE2, DEFAULTING_ATTRIBUTE3, DEFAULTING_ATTRIBUTE4, DEFAULTING_ATTRIBUTE5, DEFAULTING_ATTRIBUTE6, DEFAULTING_ATTRIBUTE7, DEFAULTING_ATTRIBUTE8, DEFAULTING_ATTRIBUTE9, DEFAULTING_ATTRIBUTE10, PROVNL_TAX_
DETERMINATION_DATE, HISTORICAL_TAX_CODE_ID, GLOBAL_ATTRIBUTE_CATEGORY, GLOBAL_ATTRIBUTE1, TOTAL_INC_TAX_AMT, ICX_SESSION_ID, CREATION_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN) SELECT :B298 , :B287 , :B286 , :B285 , :B284 , :B297 , :B283 , :B296 , :B282 , :B281 , :B280 , :B279 , :B278 , :B277 , :B276 , :B275 , :B274 , :B273 , :B272 , :B271 , :B270 , NVL(:B268 , :B269 ), NVL(:B266 , :B267 ), NVL(:B264 , :B265 ), NVL(:B262 , :B263 ), NVL(:B260 , :B261 ), NVL(:B258 , :B259 ), :B257 , :B256 , :B255 , :B254 , :B253 , :B252 , :B251 , :B250 , :B249 , :B248 , :B247 , :B246 , :B245 , :B244 , :B243 , :B242 , :B241 , :B240 , :B239 , :B238 , :B237 , :B236 , :B235 , :B234 , :B233 , :B232 , :B231 , :B230 , :B229 , :B228 , :B227 , :B226 , :B225 , :B224 , :B223 , :B222 , :B221 , :B220 , :B219 , :B218 , :B217 , :B216 , :B215 , :B214 , :B213 , :B212 , :B211 , :B210 , :B209 , :B208 , :B207
, :B206 , :B205 , :B204 , :B203 , :B202 , :B201 , :B200 , :B199 , :B198 , :B197 , :B196 , :B195 , :B194 , :B193 , :B192 , :B191 , :B190 , :B189 , :B188 , :B187 , :B186 , :B185 , :B184 , :B183 , :B182 , :B181 , :B180 , :B179 , :B178 , :B177 , :B176 , :B175 , :B174 , :B173 , :B172 , :B171 , :B170 , :B169 , :B168 , :B167 , :B166 , :B165 , :B164 , :B163 , :B162 , :B161 , :B160 , :B159 , :B158 , :B157 , :B156 , :B155 , :B154 , :B153 , :B152 , :B151 , :B150 , :B149 , :B148 , :B147 , :B146 , :B145 , :B144 , :B143 , :B142 , :B141 , :B140 , :B139 , :B138 , :B137 , :B136 , :B135 , :B134 , :B133 , :B132 , :B131 , :B130 , :B129 , :B128 , :B127 , :B126 , :B125 , :B124 , :B123 , :B122 , :B121 , :B120 , :B119 , :B118 , :B117 , :B116 , :B115 , :B114 , :B113 , :B112 , :B111 , :B110 , :B109 , :B108 , :B107 , :B106 , :B105 , :B104 , :B103 , :B102 , :B101 , :B100 , :B99 , :B98 , :B97 , :B96 , :B
95 , :B94 , :B93 , :B92 , :B91 , :B90 , :B89 , :B88 , :B87 , :B86 , :B85 , :B84 , :B83 , :B82 , :B81 , :B80 , :B79 , :B78 , :B77 , :B76 , :B75 , :B74 , :B73 , :B72 , :B71 , NVL(:B70 , :B295 ), :B69 , :B68 , :B67 , :B66 , :B65 , DECODE(:B63 , 'RECORD_WITH_NO_TAX', 'N', DECODE(:B294 , 'N', 'N', NVL(:B64 , :B293 ))), :B62 , :B61 , :B60 , :B59 , :B58 , :B57 , :B56 , :B55 , :B54 , :B53 , :B52 , :B51 , :B50 , :B49 , :B48 , :B47 , :B46 , :B45 , :B44 , :B43 , :B42 , :B41 , :B40 , 1, :B39 , :B38 , 'ETAX_CREATED', :B37 , :B36 , :B35 , :B34 , :B33 , :B32 , :B31 , :B30 , :B29 , :B28 , :B27 , :B26 , :B292 , :B25 , :B24 , :B23 , :B22 , :B21 , :B20 , :B19 , :B18 , :B17 , :B16 , :B15 , :B14 , :B13 , :B12 , :B11 , :B10 , :B9 , :B8 , :B7 , :B6 , :B5 , :B4 , :B3 , :B2 , NVL(:B1 , 0), DECODE(:B291 , 'CALCULATE_TAX', :B290 , NULL), SYSDATE SYSTEM_DATE_1, FND_GLOBAL.USER_ID USER_ID_1, SYSDATE SYSTEM_DATE
_2, FND_GLOBAL.USER_ID USER_ID_2, FND_GLOBAL.CONC_LOGIN_ID FROM DUAL WHERE :B289 IS NOT NULL AND :B288 IN ('CREATE', 'CREATE_TAX_ONLY', 'APPLY_FROM', 'INTERCOMPANY_CREATE', 'LINE_INFO_TAX_ONLY', 'CREATE_WITH_TAX', 'ALLOCATE_TAX_ONLY_ADJUSTMENT', 'COPY_AND_CREATE', 'RECORD_WITH_NO_TAX') |
479rc79k52ru1 | SELECT DISTINCT PO_HEADER_ID FROM AP_INVOICE_LINES WHERE INVOICE_ID = :B1 AND PO_HEADER_ID IS NOT NULL |
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 |
4xpxwj3mmpbj8 | SELECT COUNT(*) FROM PA_TASKS WHERE PROJECT_ID = :B2 AND TASK_ID = :B1 |
5a72wzs0hj755 | BEGIN DKA_SAPCREATE_BLOCAGES_PKG.MAIN(:errbuf, :rc); END; |
5f9spvysgkr1c |
INSERT INTO FND_CONCURRENT_REQUESTS ( REQUEST_ID, SECURITY_GROUP_ID, PHASE_CODE, STATUS_CODE, PRIORITY, PARENT_REQUEST_ID, PRIORITY_REQUEST_ID, DESCRIPTION, REQ_INFORMATION, IS_SUB_REQUEST, HAS_SUB_REQUEST, UPDATE_PROTECTED, HOLD_FLAG, ENFORCE_SERIALITY_FLAG, SINGLE_THREAD_FLAG, ARGUMENT_INPUT_METHOD_CODE, IMPLICIT_CODE, REQUEST_DATE, REQUESTED_START_DATE, REQUESTED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, ORACLE_ID, CONC_LOGIN_ID, RESPONSIBILITY_ID, RESPONSIBILITY_APPLICATION_ID, NLS_LANGUAGE, NLS_TERRITORY, NLS_NUMERIC_CHARACTERS, NLS_SORT, PROGRAM_APPLICATION_ID, CONCURRENT_PROGRAM_ID, QUEUE_METHOD_CODE, REQUEST_CLASS_APPLICATION_ID, CONCURRENT_REQUEST_CLASS_ID, PRINT_GROUP, PRINTER, PRINT_STYLE, NUMBER_OF_COPIES, SAVE_OUTPUT_FLAG, CRM_THRSHLD, RESUBMIT_TIME, RESUBMIT_INTERVAL, RESUBMIT_INTERVAL_UNIT_CODE, RESUBMIT_INTERVAL_TYPE_CODE, RESUBMIT_END_DATE, RESUBMITTED, CRITICAL, REQUEST_TYPE, RELEASE_CLASS_APP_ID, RELE
ASE_CLASS_ID, STALE_DATE, CANCEL_OR_HOLD, OUTPUT_FILE_TYPE, NLS_COMPLIANT, CD_ID, REQUEST_LIMIT, INCREMENT_DATES, ENABLE_TRACE, OPS_INSTANCE, ORG_ID, NODE_NAME1, CONNSTR1, RECALC_PARAMETERS, EDITION_NAME, ARGUMENT_TEXT, NUMBER_OF_ARGUMENTS, ARGUMENT1, ARGUMENT2, ARGUMENT3, ARGUMENT4, ARGUMENT5, ARGUMENT6, ARGUMENT7, ARGUMENT8, ARGUMENT9, ARGUMENT10, ARGUMENT11, ARGUMENT12, ARGUMENT13, ARGUMENT14, ARGUMENT15, ARGUMENT16, ARGUMENT17, ARGUMENT18, ARGUMENT19, ARGUMENT20, ARGUMENT21, ARGUMENT22, ARGUMENT23, ARGUMENT24, ARGUMENT25) SELECT :B79 , :B78 , :B77 , DECODE (:B76 , 'A', 'A', 'Z', 'Z', DECODE(FCP.QUEUE_METHOD_CODE, 'B', 'Q', DECODE (:B57 , 'Y', 'Q', DECODE(:B38 , 'Y', 'Q', 'I')))), DECODE (FCP.QUEUE_CONTROL_FLAG, 'Y', NVL(FCP.REQUEST_PRIORITY, 0), DECODE (:B75 , NULL, 50, :B75 )), DECODE (:B67 , 0, NULL, :B67 ), :B74 , :B73 , NULL, :B72 , 'N', :B71 , :B70 , 'Y', :B57 , 'S', :B69 , SYSDATE, DECODE (:B68
, '', (SYSDATE - :B66 ), GREATEST (:B68 , DECODE (:B67 , 0, (SYSDATE - :B66 ), FND_CONC_DATE.STRING_TO_DATE ( '01-01-0001')))), :B65 , SYSDATE, :B65 , :B64 , ORACLE_ID, :B64 , :B63 , :B62 , :B61 , :B60 , :B59 , :B58 , FA.APPLICATION_ID, FCP.CONCURRENT_PROGRAM_ID, DECODE(:B38 , 'Y', 'B', DECODE(:B57 , 'N', FCP.QUEUE_METHOD_CODE, 'B')), FCP.CLASS_APPLICATION_ID, FCP.CONCURRENT_CLASS_ID, :B56 , :B55 , :B54 , :B53 , :B52 , :B51 , DECODE (:B50 , '', NULL, TO_CHAR (FND_CONC_DATE.STRING_TO_DATE ( '01-01-0001' || :B50 ), 'HH24:MI:SS')), DECODE (:B49 , '', NULL, :B49 ), :B48 , :B47 , :B46 , 'N', :B45 , :B44 , :B43 , :B42 , :B41 , :B40 , FCP.OUTPUT_FILE_TYPE, FCP.NLS_COMPLIANT, :B39 , :B38 , :B37 , DECODE(:B36 , 'Y', 'Y', FCP.ENABLE_TRACE), :B35 , :B34 , :B33 , :B32 , :B31 , SYS_CONTEXT('userenv', 'current_edition_name'), :B30 , :B29 , :B28 , :B27 , :B26 , :B25 , :B24 , :B23 , :B22 , :B21 , :B20 , :B19 , :B18 ,
:B17 , :B16 , :B15 , :B14 , :B13 , :B12 , :B11 , :B10 , :B9 , :B8 , :B7 , :B6 , :B5 , :B4 FROM FND_APPLICATION FA, FND_CONCURRENT_PROGRAMS FCP, FND_ORACLE_USERID WHERE ORACLE_USERNAME = :B3 AND FCP.ENABLED_FLAG = 'Y' AND (FCP.APPLICATION_ID = FA.APPLICATION_ID AND CONCURRENT_PROGRAM_NAME = UPPER (:B2 )) AND FA.APPLICATION_SHORT_NAME = UPPER (:B1 ) |
5t39uchjqpyfm | BEGIN xla_accounting_pkg.unit_processor_batch(:errbuf, :rc, :A0, :A1, :A2, :A3, :A4, :A5, :A6, :A7, :A8, :A9, :A10, :A11, :A12, :A13, :A14); END; |
5u1d16qak7nrp |
INSERT INTO ZX_TRX_HEADERS_GT( INTERNAL_ORGANIZATION_ID, APPLICATION_ID, ENTITY_CODE, EVENT_CLASS_CODE, EVENT_TYPE_CODE, TRX_ID, TRX_DATE, LEDGER_ID, TRX_CURRENCY_CODE, CURRENCY_CONVERSION_DATE, CURRENCY_CONVERSION_RATE, CURRENCY_CONVERSION_TYPE, MINIMUM_ACCOUNTABLE_UNIT, PRECISION, LEGAL_ENTITY_ID, ROUNDING_SHIP_FROM_PARTY_ID, ROUNDING_BILL_FROM_PARTY_ID, RNDG_SHIP_FROM_PARTY_SITE_ID, RNDG_BILL_FROM_PARTY_SITE_ID, RELATED_DOC_APPLICATION_ID, RELATED_DOC_ENTITY_CODE, RELATED_DOC_EVENT_CLASS_CODE, RELATED_DOC_TRX_ID, RELATED_DOC_NUMBER, RELATED_DOC_DATE, DEFAULT_TAXATION_COUNTRY, QUOTE_FLAG, CTRL_TOTAL_HDR_TX_AMT, TRX_NUMBER, TRX_DESCRIPTION, DOC_SEQ_ID, DOC_SEQ_NAME, DOC_SEQ_VALUE, DOCUMENT_SUB_TYPE, SUPPLIER_TAX_INVOICE_NUMBER, SUPPLIER_TAX_INVOICE_DATE, SUPPLIER_EXCHANGE_RATE, TAX_INVOICE_DATE, TAX_INVOICE_NUMBER, BILL_THIRD_PTY_ACCT_ID, BILL_THIRD_PTY_ACCT_SITE_ID, SHIP_THIRD_PTY_ACCT_ID, SHIP_THIRD_PTY_ACCT_SITE_ID ) SELECT AI.ORG_ID, 200,
'AP_INVOICES', (CASE WHEN AI.INVOICE_TYPE_LOOKUP_CODE IN ('STANDARD', 'CREDIT', 'DEBIT', 'MIXED', 'ADJUSTMENT', 'PO PRICE ADJUST', 'INVOICE REQUEST', 'CREDIT MEMO REQUEST', 'RETAINAGE RELEASE', 'PAYMENT REQUEST') THEN 'STANDARD INVOICES' WHEN (AI.INVOICE_TYPE_LOOKUP_CODE = 'PREPAYMENT') OR (:B1 IN ('RECOUPMENT', 'DISTRIBUTE RECOUP')) THEN 'PREPAYMENT INVOICES' WHEN AI.INVOICE_TYPE_LOOKUP_CODE = 'EXPENSE REPORT' THEN 'EXPENSE REPORTS' END), (CASE WHEN AI.INVOICE_TYPE_LOOKUP_CODE IN ('STANDARD', 'CREDIT', 'DEBIT', 'MIXED', 'ADJUSTMENT', 'PO PRICE ADJUST', 'INVOICE REQUEST', 'CREDIT MEMO REQUEST', 'RETAINAGE RELEASE', 'PAYMENT REQUEST') THEN 'STANDARD ' WHEN (AI.INVOICE_TYPE_LOOKUP_CODE = 'PREPAYMENT') OR (:B1 IN ('RECOUPMENT', 'DISTRIBUTE RECOUP')) THEN 'PREPAYMENT ' WHEN AI.INVOICE_TYPE_LOOKUP_CODE = 'EXPENSE REPORT' THEN 'EXPENSE REPORT ' END)|| DECODE(:B1 , 'CALCULATE', (CASE ((SELECT 'Y' FROM AP_INVOICE_LINES_ALL WHERE INVOICE_ID = AI.INVOICE_ID AND LINE_TYP
E_LOOKUP_CODE <> 'AWT' AND (TAX_ALREADY_CALCULATED_FLAG = 'Y' OR SUMMARY_TAX_LINE_ID IS NOT NULL) AND ROWNUM = 1) UNION (SELECT 'Y' FROM ZX_LINES_DET_FACTORS WHERE APPLICATION_ID = 200 AND ENTITY_CODE = 'AP_INVOICES' AND TRX_ID = AI.INVOICE_ID AND EVENT_CLASS_CODE IN ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') AND ROWNUM=1)) WHEN 'Y' THEN 'UPDATED' ELSE 'CREATED' END), 'DISTRIBUTE', (CASE (SELECT 'Y' FROM AP_INVOICE_DISTRIBUTIONS_ALL WHERE INVOICE_ID = AI.INVOICE_ID AND LINE_TYPE_LOOKUP_CODE <> 'AWT' AND (TAX_ALREADY_DISTRIBUTED_FLAG = 'Y' OR DETAIL_TAX_DIST_ID IS NOT NULL) AND (RELATED_ID IS NULL OR RELATED_ID = INVOICE_DISTRIBUTION_ID) AND ROWNUM = 1) WHEN 'Y' THEN 'REDISTRIBUTE' ELSE 'DISTRIBUTE' END)), AI.INVOICE_ID, AI.INVOICE_DATE, AI.SET_OF_BOOKS_ID, AI.INVOICE_CURRENCY_CODE, AI.EXCHANGE_DATE, AI.EXCHANGE_RATE, AI.EXCHANGE_RATE_TYPE, NVL(CUR.MINIMUM_ACCOUNTABLE_UNIT, (1/POWER(10, CUR.PRECISION))), NVL(CUR.PRECISION, 0), AI.LEGAL_ENTIT
Y_ID, AI.PARTY_ID, AI.PARTY_ID, AI.PARTY_SITE_ID, AI.PARTY_SITE_ID, (CASE WHEN RELATED_AI.INVOICE_TYPE_LOOKUP_CODE IS NOT NULL THEN 200 ELSE NULL END), (CASE WHEN RELATED_AI.INVOICE_TYPE_LOOKUP_CODE IS NOT NULL THEN 'AP_INVOICES' ELSE NULL END), (CASE WHEN RELATED_AI.INVOICE_TYPE_LOOKUP_CODE IN ('STANDARD', 'CREDIT', 'DEBIT', 'MIXED', 'ADJUSTMENT', 'PO PRICE ADJUST', 'INVOICE REQUEST', 'CREDIT MEMO REQUEST', 'RETAINAGE RELEASE') THEN 'STANDARD INVOICES' WHEN AI.INVOICE_TYPE_LOOKUP_CODE = 'PREPAYMENT' THEN 'PREPAYMENT INVOICES' WHEN AI.INVOICE_TYPE_LOOKUP_CODE = 'EXPENSE REPORT' THEN 'EXPENSE REPORTS' END), AI.TAX_RELATED_INVOICE_ID, RELATED_AI.INVOICE_NUM, RELATED_AI.INVOICE_DATE, AI.TAXATION_COUNTRY, DECODE(:B1 , 'CALCULATE QUOTE', 'Y', 'N'), AI.CONTROL_AMOUNT, AI.INVOICE_NUM, AI.DESCRIPTION, AI.DOC_SEQUENCE_ID, DOC.NAME, NVL(TO_CHAR(AI.DOC_SEQUENCE_VALUE), AI.VOUCHER_NUM), AI.DOCUMENT_SUB_TYPE, AI.SUPPLIER_TAX_INVOICE_NUMBER, AI.SUPPLIER_TAX_INVOICE_D
ATE, AI.SUPPLIER_TAX_EXCHANGE_RATE, AI.TAX_INVOICE_RECORDING_DATE, AI.TAX_INVOICE_INTERNAL_SEQ, AI.VENDOR_ID, AI.VENDOR_SITE_ID, AI.VENDOR_ID, AI.VENDOR_SITE_ID FROM AP_INVOICES_ALL AI, FND_CURRENCIES CUR, FND_DOCUMENT_SEQUENCES DOC, AP_INVOICES_ALL RELATED_AI, AP_SYSTEM_PARAMETERS_ALL ASP WHERE AI.INVOICE_CURRENCY_CODE = CUR.CURRENCY_CODE AND AI.DOC_SEQUENCE_ID = DOC.DOC_SEQUENCE_ID (+) AND AI.TAX_RELATED_INVOICE_ID = RELATED_AI.INVOICE_ID (+) AND NVL(AI.QUICK_CREDIT, 'N') = 'N' AND AI.INVOICE_TYPE_LOOKUP_CODE NOT IN ('AWT', 'INTEREST') AND AI.VALIDATION_REQUEST_ID = :B2 AND ASP.ORG_ID = AI.ORG_ID AND ((ASP.BASE_CURRENCY_CODE = AI.INVOICE_CURRENCY_CODE) OR (:B1 IN ('CALCULATE')) OR (ASP.BASE_CURRENCY_CODE <> AI.INVOICE_CURRENCY_CODE AND AI.EXCHANGE_RATE IS NOT NULL AND :B1 IN ('DISTRIBUTE', 'DISTRIBUTE IMPORT') )) |
5z2y27mbm98zm | UPDATE AP_INVOICE_DISTRIBUTIONS_ALL D SET MATCH_STATUS_FLAG = 'T', LAST_UPDATE_DATE = SYSDATE, LAST_UPDATED_BY = :B2 , PROGRAM_APPLICATION_ID = DECODE(FND_GLOBAL.PROG_APPL_ID, -1, NULL, FND_GLOBAL.PROG_APPL_ID), REQUEST_ID = DECODE(FND_GLOBAL.CONC_REQUEST_ID, -1, NULL, FND_GLOBAL.CONC_REQUEST_ID), PROGRAM_ID = DECODE(FND_GLOBAL.CONC_PROGRAM_ID, -1, NULL, FND_GLOBAL.CONC_PROGRAM_ID), PROGRAM_UPDATE_DATE = DECODE(FND_GLOBAL.CONC_PROGRAM_ID, -1, NULL, SYSDATE) WHERE MATCH_STATUS_FLAG = 'S' AND D.INVOICE_ID = :B1 |
616m6uhpa2usu | select i.obj#, i.ts#, i.file#, i.block#, i.intcols, i.type#, i.flags, i.property, i.pctfree$, i.initrans, i.maxtrans, i.blevel, i.leafcnt, i.distkey, i.lblkkey, i.dblkkey, i.clufac, i.cols, i.analyzetime, i.samplesize, i.dataobj#, nvl(i.degree, 1), nvl(i.instances, 1), i.rowcnt, mod(i.pctthres$, 256), i.indmethod#, i.trunccnt, nvl(c.unicols, 0), nvl(c.deferrable#+c.valid#, 0), nvl(i.spare1, i.intcols), i.spare4, i.spare2, i.spare6, decode(i.pctthres$, null, null, mod(trunc(i.pctthres$/256), 256)), nvl(i.evaledition#, 1), nvl(i.unusablebefore#, 0), nvl(i.unusablebeginning#, 0), ist.cachedblk, ist.cachehit, ist.logicalread from ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols, min(to_number(bitand(defer, 1))) deferrable#, min(to_number(bitand(defer, 4))) valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj# |
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# |
656sk77p7a7qs | Declare
l_flag Boolean;
BEGIN
l_flag := XLA_CREATE_ACCT_RPT_PVT.BeforeReport ;
if (l_flag) then
:XDO_OUT_PARAMETER := 1;
end if;
end;
|
66xqc033rzyp5 |
SELECT /*+ dynamic_sampling(2) cardinality(ai, 10) */ invoice_id from AP_INVOICES AI -- 7461423
WHERE AI.VALIDATION_REQUEST_ID IS NULL
AND AI.APPROVAL_READY_FLAG <> 'S'
AND AI.INVOICE_TYPE_LOOKUP_CODE<>'INVOICE REQUEST' /*Bug 16263597*/
AND AI.CANCELLED_DATE IS NULL /* Bug 9777752 */
AND NOT ( NVL(AI.PAYMENT_STATUS_FLAG, 'N') = 'Y' AND
NVL(AI.HISTORICAL_FLAG, 'N') = 'Y' AND
NVL(AI.FORCE_REVALIDATION_FLAG, 'N') = 'N') /*Bug11934187*/
AND EXISTS (
SELECT /*+ PUSH_SUBQ */ 1
FROM DUAL
WHERE UPPER(NVL(AI.SOURCE, 'X')) <> 'RECURRING INVOICE'
UNION ALL
SELECT 1
FROM DUAL
WHERE UPPER(NVL(AI.SOURCE, 'X')) = 'RECURRING INVOICE'
AND NOT EXISTS
( SELECT NULL
FROM GL_PERIOD_STATUSES GLPS
WHERE GLPS.APPLICATION_ID = '200'
AND GLPS.SET_OF_BOOKS_ID = AI.SET_OF_BOOKS_ID
AND TRUNC(AI.GL_DATE) BETWEEN GLPS.START_DATE AND GLPS.END_DATE
AND NVL(GLPS.ADJUSTMENT_PERIOD_FLAG, 'N') = 'N'
AND GLPS.CLOSING_STATUS = 'N'
)
)
AND EXISTS (
SELECT 1
FROM DUAL
WHERE AI.FORCE_REVALIDATION_FLAG = 'Y'
UNION ALL
SELECT /*+ index(D AP_INVOICE_DISTRIBUTIONS_N32) cardinality(D 1) use_nl(fsp) */ 1
FROM AP_INVOICE_DISTRIBUTIONS_ALL D,
FINANCIALS_SYSTEM_PARAMS_ALL FSP
W
HERE D.INVOICE_ID = AI.INVOICE_ID
AND FSP.ORG_ID = D.ORG_ID
AND NVL(D.MATCH_STATUS_FLAG, 'N') <> 'A'
AND FSP.SET_OF_BOOKS_ID = D.SET_OF_BOOKS_ID
AND (NVL(FSP.PURCH_ENCUMBRANCE_FLAG, 'N') = 'Y'
OR
(NVL(FSP.PURCH_ENCUMBRANCE_FLAG, 'N') = 'N' AND NVL(D.MATCH_STATUS_FLAG, 'N') <> 'T'))
UNION ALL
SELECT /*+ index(D AP_SELF_ASSESSED_TAX_DIST_N31) use_nl(fsp) */ 1
FROM AP_SELF_ASSESSED_TAX_DIST_ALL D,
FINANCIALS_SYSTEM_PARAMS_ALL FSP
WHERE D.INVOICE_ID = AI.INVOICE_ID
AND NVL (D.MATCH_STATUS_FLAG, 'N') <> 'A'
AND FSP.ORG_ID = D.ORG_ID
AND FSP.SET_OF_BOOKS_ID = D.SET_OF_BOOKS_ID
AND (NVL(FSP.PURCH_ENCUMBRANCE_FLAG, 'N') = 'Y'
OR
(NVL(FSP.PURCH_ENCUMBRANCE_FLAG, 'N') = 'N' AND NVL(D.MATCH_STATUS_FLAG, 'N') <> 'T'))
AND NOT EXISTS
( SELECT /*+ index(D2 AP_SELF_ASSESSED_TAX_DIST_N30) */ 'Cancelled distributions'
FROM AP_SELF_ASSESSED_TAX_DIST_ALL D2
WHERE D2.INVOICE_ID = D.INVOICE_ID
AND D2.CANCELLATION_FLAG = 'Y'
)
UNION ALL
SELECT 1
FROM AP_HOLDS_ALL H
WHERE H.INVOICE_ID = AI.INVOICE_ID
AND ((H.HOLD_LOOKUP_CODE IN
('QTY ORD', 'QTY REC', 'AMT ORD', 'AMT REC', 'QUALITY',
'PRICE', 'TAX DIFFERENCE', 'CURRENCY DIFFERENCE',
'REC EXCEPTION', 'TAX VARIANCE', 'PO NOT APPROVED',
'PO REQUIRED', 'MAX SHIP AMOU
NT', 'MAX RATE AMOUNT',
'MAX TOTAL AMOUNT', 'TAX AMOUNT RANGE', 'MAX QTY ORD',
'MAX QTY REC', 'MAX AMT ORD', 'MAX AMT REC',
'CANT CLOSE PO', 'CANT TRY PO CLOSE', 'LINE VARIANCE',
'CANT FUNDS CHECK', 'Expired Registration', 'Amount Funded', 'Quantity Funded',
'GTAS Mandatory Fields', 'GTAS Data Validation', 'AWT ERROR')) OR /* Bug#13464635 */ /*Bug18411094: Added AWT error*/
(H.HOLD_LOOKUP_CODE IN (SELECT HOLD_LOOKUP_CODE
FROM AP_HOLD_CODES
WHERE POSTABLE_FLAG = 'N'
AND USER_RELEASEABLE_FLAG = 'N'))) /* Bug 14579876 */
AND H.RELEASE_LOOKUP_CODE IS NULL
AND EXISTS
( SELECT 'Lines'
FROM AP_INVOICE_LINES_ALL L2
WHERE L2.INVOICE_ID = H.INVOICE_ID ) --8580790, 9112369
UNION ALL
SELECT 1
FROM AP_INVOICE_LINES_ALL AIL
WHERE AIL.INVOICE_ID = AI.INVOICE_ID
/* Bug 9777752 AND AI.CANCELLED_DATE IS NULL */
AND NVL(AIL.DISCARDED_FLAG, 'N') <> 'Y'
AND NVL(AIL.CANCELLED_FLAG, 'N') <> 'Y'
AND (AIL.AMOUNT <> 0 OR
(AIL.AMOUNT = 0 AND AIL.GENERATE_DISTS = 'Y')) --8580790
AND NOT EXISTS
( SELECT /*+ NO_UNNEST */
'distributed line'
FROM AP_INVOICE_DISTRIBUTIONS_ALL
D5
WHERE D5.INVOICE_ID = AIL.INVOICE_ID
AND D5.INVOICE_LINE_NUMBER = AIL.LINE_NUMBER
)
)
AND NOT EXISTS
( SELECT /*+ push_subq no_unnest */ 'Cancelled distributions'
FROM AP_INVOICE_DISTRIBUTIONS_ALL D3
WHERE D3.INVOICE_ID = AI.INVOICE_ID
AND D3.CANCELLATION_FLAG = 'Y'
) AND AI.org_id = :b_org_id FOR UPDATE SKIP LOCKED |
67fx45mvnmbsz | SELECT CASE WHEN COUNT(1) > 0 THEN 'Y' ELSE 'N' END FROM FA_CATEGORY_BOOKS FCB JOIN GL_CODE_COMBINATIONS_KFV GCC ON FCB.ASSET_CLEARING_ACCOUNT_CCID = GCC.CODE_COMBINATION_ID WHERE GCC.SEGMENT3 = :B1 |
685yb2upzj6kf | SELECT I.INVOICE_ID, I.INVOICE_NUM, I.ORG_ID, I.INVOICE_AMOUNT, I.BASE_AMOUNT, I.EXCHANGE_RATE, I.INVOICE_CURRENCY_CODE, S.INVOICE_AMOUNT_LIMIT, NVL(S.HOLD_FUTURE_PAYMENTS_FLAG, 'N') HOLD_FUTURE_PAYMENTS_FLAG, I.INVOICE_TYPE_LOOKUP_CODE, I.EXCHANGE_DATE, I.EXCHANGE_RATE_TYPE, I.VENDOR_ID, I.INVOICE_DATE, NVL(I.DISC_IS_INV_LESS_TAX_FLAG, 'N') DISC_IS_INV_LESS_TAX_FLAG, NVL(I.EXCLUDE_FREIGHT_FROM_DISCOUNT, 'N') EXCLUDE_FREIGHT_FROM_DISCOUNT, NVL(S.TOLERANCE_ID, ASP.TOLERANCE_ID), NVL(S.SERVICES_TOLERANCE_ID, ASP.SERVICES_TOLERANCE_ID) FROM AP_INVOICES_ALL I, AP_SUPPLIER_SITES_ALL S, AP_SYSTEM_PARAMETERS_ALL ASP WHERE I.VENDOR_SITE_ID = S.VENDOR_SITE_ID (+) AND I.VALIDATION_REQUEST_ID = :B1 AND ASP.ORG_ID = I.ORG_ID ORDER BY I.ORG_ID |
6m3b4guk3yqzj | UPDATE DKA_IAPFACXGS_REPORTING_ALL XIRA SET STATUT_INTERFACE ='OK', DATE_TRAITEMENT = SYSDATE , ORG_ID = :B1 WHERE EXISTS ( SELECT 1 FROM DKA_IAPFACXGS_INTERFACE XII, HR_ALL_ORGANIZATION_UNITS HAOU WHERE XII.NUM_FACT = XIRA.NUM_FACT AND NVL(XIRA.SITE_FRS, '#VIDE#') = NVL(XII.SITE_FRS, '#VIDE#') AND XIRA.DATE_NUMERISATION = XII.DATE_NUMERISATION AND XIRA.TYPE_PIECE = XII.TYPE_PIECE AND XIRA.TYPE = XII.TYPE AND XIRA.BATCHNO = XII.BATCHNO AND XIRA.BATCHIDX = XII.BATCHIDX AND XIRA.MHT_DEVISE = XII.MHT_DEVISE AND XII.FLAG_TRT = 1 AND XII.CODE_REGION||XII.CODE_SOCIETE = HAOU.NAME AND HAOU.ORGANIZATION_ID = :B1 ) |
6t6z5yyv0b8ds | SELECT ZX_REC_NREC_DIST_S.NEXTVAL FROM DUAL |
7466ar05kub5f | SELECT COUNT(*) FROM AP_HOLDS_ALL WHERE INVOICE_ID = :B1 AND RELEASE_LOOKUP_CODE IS NULL |
7azcgh1zf1p03 |
SELECT /*+ INDEX(HEADER ZX_TRX_HEADERS_GT_U1) INDEX(TRXLINES ZX_TRANSACTION_LINES_GT_U1) */ HEADER.INTERNAL_ORGANIZATION_ID , HEADER.APPLICATION_ID , HEADER.ENTITY_CODE , HEADER.EVENT_CLASS_CODE , HEADER.EVENT_TYPE_CODE , HEADER.TRX_ID , TRXLINES.TRX_LEVEL_TYPE , TRXLINES.TRX_LINE_ID , TRXLINES.LINE_LEVEL_ACTION , DECODE(TRXLINES.SOURCE_EVENT_CLASS_CODE, 'INTERCOMPANY_TRX', TRXLINES.LINE_CLASS, NVL(TRXLINES.LINE_CLASS, :B3 )), HEADER.TRX_DATE , HEADER.TRX_DOC_REVISION , HEADER.LEDGER_ID , HEADER.TRX_CURRENCY_CODE , HEADER.CURRENCY_CONVERSION_DATE , HEADER.CURRENCY_CONVERSION_RATE , HEADER.CURRENCY_CONVERSION_TYPE , HEADER.MINIMUM_ACCOUNTABLE_UNIT , HEADER.PRECISION , TRXLINES.TRX_LINE_CURRENCY_CODE , TRXLINES.TRX_LINE_CURRENCY_CONV_DATE , TRXLINES.TRX_LINE_CURRENCY_CONV_RATE , TRXLINES.TRX_LINE_CURRENCY_CONV_TYPE , TRXLINES.TRX_LINE_MAU , TRXLINES.TRX_LINE_PRECISION , TRXLINES.TRX_SHIPPING_DATE , TRXLINES.TRX_RECEIPT_DATE , HEADER.LEGAL_ENTITY_ID , HEADER.
ROUNDING_SHIP_TO_PARTY_ID , HEADER.ROUNDING_SHIP_FROM_PARTY_ID , HEADER.ROUNDING_BILL_TO_PARTY_ID , HEADER.ROUNDING_BILL_FROM_PARTY_ID , HEADER.RNDG_SHIP_TO_PARTY_SITE_ID , HEADER.RNDG_SHIP_FROM_PARTY_SITE_ID , HEADER.RNDG_BILL_TO_PARTY_SITE_ID , HEADER.RNDG_BILL_FROM_PARTY_SITE_ID , HEADER.ESTABLISHMENT_ID , TRXLINES.TRX_LINE_TYPE , TRXLINES.TRX_LINE_DATE , TRXLINES.TRX_BUSINESS_CATEGORY , TRXLINES.LINE_INTENDED_USE , TRXLINES.USER_DEFINED_FISC_CLASS , TRXLINES.LINE_AMT , TRXLINES.TRX_LINE_QUANTITY , TRXLINES.UNIT_PRICE , TRXLINES.EXEMPT_CERTIFICATE_NUMBER , TRXLINES.EXEMPT_REASON , TRXLINES.CASH_DISCOUNT , TRXLINES.VOLUME_DISCOUNT , TRXLINES.TRADING_DISCOUNT , TRXLINES.TRANSFER_CHARGE , TRXLINES.TRANSPORTATION_CHARGE , TRXLINES.INSURANCE_CHARGE , TRXLINES.OTHER_CHARGE , TRXLINES.PRODUCT_ID , TRXLINES.PRODUCT_FISC_CLASSIFICATION , TRXLINES.PRODUCT_ORG_ID , TRXLINES.UOM_CODE , TRXLINES.PRODUCT_TYPE , TRXLINES.PRODUCT_CODE , TRXLINES.PRODUCT_CATEGORY , T
RXLINES.TRX_SIC_CODE , TRXLINES.FOB_POINT , TRXLINES.SHIP_TO_PARTY_ID , TRXLINES.SHIP_FROM_PARTY_ID , TRXLINES.POA_PARTY_ID , TRXLINES.POO_PARTY_ID , TRXLINES.BILL_TO_PARTY_ID , TRXLINES.BILL_FROM_PARTY_ID , TRXLINES.MERCHANT_PARTY_ID , TRXLINES.SHIP_TO_PARTY_SITE_ID , TRXLINES.SHIP_FROM_PARTY_SITE_ID , TRXLINES.POA_PARTY_SITE_ID , TRXLINES.POO_PARTY_SITE_ID , TRXLINES.BILL_TO_PARTY_SITE_ID , TRXLINES.BILL_FROM_PARTY_SITE_ID , TRXLINES.SHIP_TO_LOCATION_ID , TRXLINES.SHIP_FROM_LOCATION_ID , TRXLINES.POA_LOCATION_ID , TRXLINES.POO_LOCATION_ID , TRXLINES.BILL_TO_LOCATION_ID , TRXLINES.BILL_FROM_LOCATION_ID , TRXLINES.ACCOUNT_CCID , TRXLINES.ACCOUNT_STRING , TRXLINES.MERCHANT_PARTY_COUNTRY , HEADER.RECEIVABLES_TRX_TYPE_ID , TRXLINES.REF_DOC_APPLICATION_ID , TRXLINES.REF_DOC_ENTITY_CODE , TRXLINES.REF_DOC_EVENT_CLASS_CODE , TRXLINES.REF_DOC_TRX_ID , TRXLINES.REF_DOC_LINE_ID , TRXLINES.REF_DOC_LINE_QUANTITY , HEADER.RELATED_DOC_APPLICATION_ID , HEADER.RELATED_
DOC_ENTITY_CODE , HEADER.RELATED_DOC_EVENT_CLASS_CODE , HEADER.RELATED_DOC_TRX_ID , HEADER.RELATED_DOC_NUMBER , HEADER.RELATED_DOC_DATE , TRXLINES.APPLIED_FROM_APPLICATION_ID , TRXLINES.APPLIED_FROM_EVENT_CLASS_CODE , TRXLINES.APPLIED_FROM_ENTITY_CODE , TRXLINES.APPLIED_FROM_TRX_ID , TRXLINES.APPLIED_FROM_LINE_ID , TRXLINES.APPLIED_FROM_TRX_NUMBER , TRXLINES.ADJUSTED_DOC_APPLICATION_ID , TRXLINES.ADJUSTED_DOC_EVENT_CLASS_CODE , TRXLINES.ADJUSTED_DOC_ENTITY_CODE , TRXLINES.ADJUSTED_DOC_TRX_ID , TRXLINES.ADJUSTED_DOC_LINE_ID , TRXLINES.ADJUSTED_DOC_NUMBER , TRXLINES.ADJUSTED_DOC_DATE , TRXLINES.APPLIED_TO_APPLICATION_ID , TRXLINES.APPLIED_TO_ENTITY_CODE , TRXLINES.APPLIED_TO_EVENT_CLASS_CODE , TRXLINES.APPLIED_TO_TRX_ID , TRXLINES.APPLIED_TO_TRX_LINE_ID , TRXLINES.TRX_ID_LEVEL2 , TRXLINES.TRX_ID_LEVEL3 , TRXLINES.TRX_ID_LEVEL4 , TRXLINES.TRX_ID_LEVEL5 , TRXLINES.TRX_ID_LEVEL6 , HEADER.TRX_NUMBER , HEADER.TRX_DESCRIPTION , TRXLINES.TRX_LINE_NUMBER , TRXLINES
.TRX_LINE_DESCRIPTION , TRXLINES.PRODUCT_DESCRIPTION , TRXLINES.TRX_WAYBILL_NUMBER , HEADER.TRX_COMMUNICATED_DATE , TRXLINES.TRX_LINE_GL_DATE , HEADER.BATCH_SOURCE_ID , HEADER.BATCH_SOURCE_NAME , HEADER.DOC_SEQ_ID , HEADER.DOC_SEQ_NAME , HEADER.DOC_SEQ_VALUE , HEADER.TRX_DUE_DATE , HEADER.TRX_TYPE_DESCRIPTION , TRXLINES.MERCHANT_PARTY_NAME , TRXLINES.MERCHANT_PARTY_DOCUMENT_NUMBER , TRXLINES.MERCHANT_PARTY_REFERENCE , TRXLINES.MERCHANT_PARTY_TAXPAYER_ID , TRXLINES.MERCHANT_PARTY_TAX_REG_NUMBER , TRXLINES.PAYING_PARTY_ID , TRXLINES.OWN_HQ_PARTY_ID , TRXLINES.TRADING_HQ_PARTY_ID , TRXLINES.POI_PARTY_ID , TRXLINES.POD_PARTY_ID , TRXLINES.TITLE_TRANSFER_PARTY_ID , TRXLINES.PAYING_PARTY_SITE_ID , TRXLINES.OWN_HQ_PARTY_SITE_ID , TRXLINES.TRADING_HQ_PARTY_SITE_ID , TRXLINES.POI_PARTY_SITE_ID , TRXLINES.POD_PARTY_SITE_ID , TRXLINES.TITLE_TRANSFER_PARTY_SITE_ID , TRXLINES.PAYING_LOCATION_ID , TRXLINES.OWN_HQ_LOCATION_ID , TRXLINES.TRADING_HQ_LOCATION_ID , TRXLINE
S.POC_LOCATION_ID , TRXLINES.POI_LOCATION_ID , TRXLINES.POD_LOCATION_ID , TRXLINES.TITLE_TRANSFER_LOCATION_ID , TRXLINES.ASSESSABLE_VALUE , TRXLINES.ASSET_FLAG , TRXLINES.ASSET_NUMBER , TRXLINES.ASSET_ACCUM_DEPRECIATION , TRXLINES.ASSET_TYPE , TRXLINES.ASSET_COST , TRXLINES.NUMERIC1 , TRXLINES.NUMERIC2 , TRXLINES.NUMERIC3 , TRXLINES.NUMERIC4 , TRXLINES.NUMERIC5 , TRXLINES.NUMERIC6 , TRXLINES.NUMERIC7 , TRXLINES.NUMERIC8 , TRXLINES.NUMERIC9 , TRXLINES.NUMERIC10 , TRXLINES.CHAR1 , TRXLINES.CHAR2 , TRXLINES.CHAR3 , TRXLINES.CHAR4 , TRXLINES.CHAR5 , TRXLINES.CHAR6 , TRXLINES.CHAR7 , TRXLINES.CHAR8 , TRXLINES.CHAR9 , TRXLINES.CHAR10 , TRXLINES.DATE1 , TRXLINES.DATE2 , TRXLINES.DATE3 , TRXLINES.DATE4 , TRXLINES.DATE5 , TRXLINES.DATE6 , TRXLINES.DATE7 , TRXLINES.DATE8 , TRXLINES.DATE9 , TRXLINES.DATE10 , HEADER.FIRST_PTY_ORG_ID , HEADER.TAX_EVENT_CLASS_CODE , HEADER.TAX_EVENT_TYPE_CODE , HEADER.DOC_EVENT_STATUS , HEADER.RDNG_SHIP_TO_PTY_TX_PROF_ID ,
HEADER.RDNG_SHIP_FROM_PTY_TX_PROF_ID , HEADER.RDNG_BILL_TO_PTY_TX_PROF_ID , HEADER.RDNG_BILL_FROM_PTY_TX_PROF_ID , HEADER.RDNG_SHIP_TO_PTY_TX_P_ST_ID , HEADER.RDNG_SHIP_FROM_PTY_TX_P_ST_ID , HEADER.RDNG_BILL_TO_PTY_TX_P_ST_ID , HEADER.RDNG_BILL_FROM_PTY_TX_P_ST_ID , TRXLINES.SHIP_TO_PARTY_TAX_PROF_ID , TRXLINES.SHIP_FROM_PARTY_TAX_PROF_ID , TRXLINES.POA_PARTY_TAX_PROF_ID , TRXLINES.POO_PARTY_TAX_PROF_ID , TRXLINES.PAYING_PARTY_TAX_PROF_ID , TRXLINES.OWN_HQ_PARTY_TAX_PROF_ID , TRXLINES.TRADING_HQ_PARTY_TAX_PROF_ID , TRXLINES.POI_PARTY_TAX_PROF_ID , TRXLINES.POD_PARTY_TAX_PROF_ID , TRXLINES.BILL_TO_PARTY_TAX_PROF_ID , TRXLINES.BILL_FROM_PARTY_TAX_PROF_ID , TRXLINES.TITLE_TRANS_PARTY_TAX_PROF_ID , TRXLINES.SHIP_TO_SITE_TAX_PROF_ID , TRXLINES.SHIP_FROM_SITE_TAX_PROF_ID , TRXLINES.POA_SITE_TAX_PROF_ID , TRXLINES.POO_SITE_TAX_PROF_ID , TRXLINES.PAYING_SITE_TAX_PROF_ID , TRXLINES.OWN_HQ_SITE_TAX_PROF_ID , TRXLINES.TRADING_HQ_SITE_TAX_PROF_ID , TRXLINES.POI_SITE_TAX
_PROF_ID , TRXLINES.POD_SITE_TAX_PROF_ID , TRXLINES.BILL_TO_SITE_TAX_PROF_ID , TRXLINES.BILL_FROM_SITE_TAX_PROF_ID , TRXLINES.TITLE_TRANS_SITE_TAX_PROF_ID , TRXLINES.MERCHANT_PARTY_TAX_PROF_ID , TO_NUMBER(NULL) HQ_ESTB_PARTY_TAX_PROF_ID, HEADER.DOCUMENT_SUB_TYPE , HEADER.SUPPLIER_TAX_INVOICE_NUMBER , HEADER.SUPPLIER_TAX_INVOICE_DATE , HEADER.SUPPLIER_EXCHANGE_RATE , HEADER.TAX_INVOICE_DATE , HEADER.TAX_INVOICE_NUMBER , TRXLINES.LINE_AMT_INCLUDES_TAX_FLAG , HEADER.QUOTE_FLAG , HEADER.DEFAULT_TAXATION_COUNTRY , TRXLINES.HISTORICAL_FLAG , HEADER.INTERNAL_ORG_LOCATION_ID , TRXLINES.CTRL_HDR_TX_APPL_FLAG , HEADER.CTRL_TOTAL_HDR_TX_AMT , TRXLINES.CTRL_TOTAL_LINE_TX_AMT , NULL DIST_LEVEL_ACTION , TO_NUMBER(NULL) ADJUSTED_DOC_TASK_DIST_ID , TO_NUMBER(NULL) APPLIED_FROM_TAX_DIST_ID , TO_NUMBER(NULL) TASK_ID , TO_NUMBER(NULL) AWARD_ID , TO_NUMBER(NULL) PROJECT_ID , NULL EXPENDITURE_TYPE , TO_NUMBER(NULL) EXPENDITURE_ORGANIZATION_ID , NULL EXPENDITURE_ITEM_DATE , TO_
NUMBER(NULL) TRX_LINE_DIST_AMT , TO_NUMBER(NULL) TRX_LINE_DIST_QUANTITY , TO_NUMBER(NULL) REF_DOC_CURR_CONV_RATE , TO_NUMBER(NULL) ITEM_DIST_NUMBER , TO_NUMBER(NULL) REF_DOC_DIST_ID , TO_NUMBER(NULL) TRX_LINE_DIST_TAX_AMT , TO_NUMBER(NULL) TRX_LINE_DIST_ID , TO_NUMBER(NULL) APPLIED_FROM_DIST_ID , TO_NUMBER(NULL) ADJUSTED_DOC_DIST_ID , TO_NUMBER(NULL) OVERRIDING_RECOVERY_RATE , TRXLINES.INPUT_TAX_CLASSIFICATION_CODE , TRXLINES.OUTPUT_TAX_CLASSIFICATION_CODE , HEADER.PORT_OF_ENTRY_CODE , HEADER.TAX_REPORTING_FLAG , NULL TAX_AMT_INCLUDED_FLAG , NULL COMPOUNDING_TAX_FLAG , HEADER.SHIP_THIRD_PTY_ACCT_ID , HEADER.BILL_THIRD_PTY_ACCT_ID , HEADER.SHIP_THIRD_PTY_ACCT_SITE_ID , HEADER.BILL_THIRD_PTY_ACCT_SITE_ID , HEADER.SHIP_TO_CUST_ACCT_SITE_USE_ID , HEADER.BILL_TO_CUST_ACCT_SITE_USE_ID , HEADER.PROVNL_TAX_DETERMINATION_DATE , TRXLINES.START_EXPENSE_DATE , HEADER.TRX_BATCH_ID , HEADER.APPLIED_TO_TRX_NUMBER , TRXLINES.SOURCE_APPLICATION_ID , TRXLINES.SOURCE_ENTITY_COD
E , TRXLINES.SOURCE_EVENT_CLASS_CODE , TRXLINES.SOURCE_TRX_ID , TRXLINES.SOURCE_LINE_ID , TRXLINES.SOURCE_TRX_LEVEL_TYPE , TRXLINES.REF_DOC_TRX_LEVEL_TYPE , TRXLINES.APPLIED_TO_TRX_LEVEL_TYPE , TRXLINES.APPLIED_FROM_TRX_LEVEL_TYPE , TRXLINES.ADJUSTED_DOC_TRX_LEVEL_TYPE , HEADER.APPLICATION_DOC_STATUS , HEADER.HDR_TRX_USER_KEY1 , HEADER.HDR_TRX_USER_KEY2 , HEADER.HDR_TRX_USER_KEY3 , HEADER.HDR_TRX_USER_KEY4 , HEADER.HDR_TRX_USER_KEY5 , HEADER.HDR_TRX_USER_KEY6 , TRXLINES.LINE_TRX_USER_KEY1 , TRXLINES.LINE_TRX_USER_KEY2 , TRXLINES.LINE_TRX_USER_KEY3 , TRXLINES.LINE_TRX_USER_KEY4 , TRXLINES.LINE_TRX_USER_KEY5 , TRXLINES.LINE_TRX_USER_KEY6 , TRXLINES.SOURCE_TAX_LINE_ID , TRXLINES.EXEMPTION_CONTROL_FLAG , TO_NUMBER(NULL) REVERSED_APPLN_ID , NULL REVERSED_ENTITY_CODE , NULL REVERSED_EVNT_CLS_CODE , TO_NUMBER(NULL) REVERSED_TRX_ID , NULL REVERSED_TRX_LEVEL_TYPE , TO_NUMBER(NULL) REVERSED_TRX_LINE_ID , TRXLINES.EXEMPT_REASON_CODE , TRXLINES.INTERFACE_ENTITY_CODE
, TRXLINES.INTERFACE_LINE_ID , TRXLINES.DEFAULTING_ATTRIBUTE1 , TRXLINES.DEFAULTING_ATTRIBUTE2 , TRXLINES.DEFAULTING_ATTRIBUTE3 , TRXLINES.DEFAULTING_ATTRIBUTE4 , TRXLINES.DEFAULTING_ATTRIBUTE5 , TRXLINES.DEFAULTING_ATTRIBUTE6 , TRXLINES.DEFAULTING_ATTRIBUTE7 , TRXLINES.DEFAULTING_ATTRIBUTE8 , TRXLINES.DEFAULTING_ATTRIBUTE9 , TRXLINES.DEFAULTING_ATTRIBUTE10 , TRXLINES.HISTORICAL_TAX_CODE_ID , NVL(TRXLINES.SHIP_THIRD_PTY_ACCT_ID, HEADER.SHIP_THIRD_PTY_ACCT_ID), NVL(TRXLINES.BILL_THIRD_PTY_ACCT_ID, HEADER.BILL_THIRD_PTY_ACCT_ID), NVL(TRXLINES.SHIP_THIRD_PTY_ACCT_SITE_ID, HEADER.SHIP_THIRD_PTY_ACCT_SITE_ID), NVL(TRXLINES.BILL_THIRD_PTY_ACCT_SITE_ID, HEADER.BILL_THIRD_PTY_ACCT_SITE_ID), NVL(TRXLINES.SHIP_TO_CUST_ACCT_SITE_USE_ID, HEADER.SHIP_TO_CUST_ACCT_SITE_USE_ID), NVL(TRXLINES.BILL_TO_CUST_ACCT_SITE_USE_ID, HEADER.BILL_TO_CUST_ACCT_SITE_USE_ID), NVL(TRXLINES.RECEIVABLES_TRX_TYPE_ID, HEADER.RECEIVABLES_TRX_TYPE_ID), TRXLINES.GLOBAL_ATTRIBUTE_CATEGORY, TRXLINES.GLOBA
L_ATTRIBUTE1, TO_NUMBER(NULL) TOTAL_INC_TAX_AMT , TRXLINES.USER_UPD_DET_FACTORS_FLAG, DECODE(TRXLINES.LINE_LEVEL_ACTION, 'CREATE', 'I', 'CREATE_TAX_ONLY', 'I', 'APPLY_FROM', 'I', 'INTERCOMPANY_CREATE', 'I', 'UNAPPLY_FROM', 'U', 'LINE_INFO_TAX_ONLY', 'I', 'CREATE_WITH_TAX', 'I', 'ALLOCATE_TAX_ONLY_ADJUSTMENT', 'I', 'COPY_AND_CREATE', 'I', 'RECORD_WITH_NO_TAX', 'I', 'NO_CHANGE', 'U', 'UPDATE', 'U', 'DISCARD', 'U', 'CANCEL', 'U', 'SYNCHRONIZE', 'U', 'DELETE', 'U') INSERT_UPDATE_FLAG, NULL TAX_PROCESSING_COMPLETED_FLAG, NULL TAX_CALCULATION_DONE_FLAG FROM ZX_TRANSACTION_LINES_GT TRXLINES, ZX_TRX_HEADERS_GT HEADER WHERE TRXLINES.APPLICATION_ID = HEADER.APPLICATION_ID AND TRXLINES.ENTITY_CODE = HEADER.ENTITY_CODE AND TRXLINES.EVENT_CLASS_CODE = HEADER.EVENT_CLASS_CODE AND TRXLINES.TRX_ID = HEADER.TRX_ID AND HEADER.EVENT_CLASS_CODE = :B3 AND HEADER.ENTITY_CODE = :B2 AND HEADER.APPLICATION_ID = :B1 AND NVL(HEADER.VALIDATION_CHECK_FLAG, 'Y') = 'Y' AND NOT EXISTS( SELECT 1
FROM ZX_ERRORS_GT ERR WHERE ERR.APPLICATION_ID = HEADER.APPLICATION_ID AND ERR.ENTITY_CODE = HEADER.ENTITY_CODE AND ERR.EVENT_CLASS_CODE = HEADER.EVENT_CLASS_CODE AND ERR.TRX_ID = HEADER.TRX_ID) ORDER BY HEADER.RELATED_DOC_APPLICATION_ID ASC NULLS FIRST , HEADER.LEGAL_ENTITY_ID ASC, HEADER.TRX_DATE ASC, HEADER.TRX_ID ASC, INSERT_UPDATE_FLAG DESC |
7qwsx7rw0s3a5 | SELECT PROFILE_OPTION_VALUE FROM FND_PROFILE_VALUES_USER_V WHERE PROFILE_OPTION_ID = :B3 AND APPLICATION_ID = :B2 AND LEVEL_VALUE = :B1 AND PROFILE_OPTION_VALUE IS NOT NULL |
7umy6juhzw766 | select /*+ connect_by_filtering index(sysauth$ i_sysauth1) */ privilege#, bitand(nvl(option$, 0), 8), grantee#, level from sysauth$ connect by grantee#=prior privilege# and privilege#>0 start with grantee#=:1 and privilege#>0 |
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) ) |
90n1att0nq1u7 | UPDATE AP_INVOICES_ALL AI SET AI.VALIDATION_REQUEST_ID = :B4 WHERE AI.VALIDATION_REQUEST_ID = :B3 AND AI.VALIDATION_WORKER_ID = :B2 AND AI.INVOICE_ID = :B1 |
98j69vs3ymzjv | SELECT DECODE(:B2 , 'UTF8', FL.UTF8_DATE_LANGUAGE, 'AL32UTF8', FL.UTF8_DATE_LANGUAGE, FL.LOCAL_DATE_LANGUAGE ) DATA_RTN FROM FND_LANGUAGES FL WHERE FL.NLS_LANGUAGE = :B1 AND FL.INSTALLED_FLAG <>'D' |
9k7gd9pn661pj | SELECT PROFILE_OPTION_VALUE FROM FND_PROFILE_VALUES_RESP_V WHERE PROFILE_OPTION_ID = :B4 AND APPLICATION_ID = :B3 AND LEVEL_VALUE = :B2 AND LEVEL_VALUE_APPLICATION_ID = :B1 AND PROFILE_OPTION_VALUE IS NOT NULL |
9k7t8q4kfcb7y | begin GL.apps_ddl.apps_ddl(:ddl_text); end; |
9tqv6543vc09h | begin DKA_SAPWFAG_PKG.GET_AP_SEGMENT8_VALUE (:v1, :v2, :v3, :v4, :v5); end; |
9v2t9naa94y3v | SELECT TEXT FROM WF_RESOURCES WHERE TYPE = :B2 AND NAME = :B1 AND LANGUAGE = USERENV('LANG') |
a2g5ca6utfkv7 | SELECT USER_ID FROM FND_USER WHERE USER_NAME = :B1 |
a4gss3ajbyfzr | SELECT R.RESPONSIBILITY_NAME FROM FND_RESPONSIBILITY_VL R WHERE R.RESPONSIBILITY_ID = :B2 AND R.APPLICATION_ID = :B1 |
adj796q5rqv7m | BEGIN AP_APPROVAL_PKG.WORKER_APPROVAL(:errbuf, :rc, :A0, :A1, :A2, :A3, :A4, :A5, :A6, :A7, :A8, :A9, :A10, :A11, :A12, :A13, :A14); END; |
aj3d1mw1zaymg | SELECT event_status_code
FROM xla_events
WHERE entity_id = :1
AND application_id =:2
AND event_status_code =:3
AND event_type_code IN
(SELECT event_type_code FROM xla_event_types_b WHERE application_id =:4
AND entity_code =:5 ) |
amjk7qdaq37s0 | SELECT R.RESPONSIBILITY_KEY FROM FND_RESPONSIBILITY_VL R WHERE R.RESPONSIBILITY_ID = :B2 AND R.APPLICATION_ID = :B1 |
aqx0d1ra6a986 | BEGIN xla_balances_calc_pkg.massive_update_srs(:errbuf, :rc, :A0, :A1, :A2, :A3); END; |
au7f6hpnhxpkx | select ts# from ts$ where dflmaxext =:1 and bitand(flags, 1024) =1024 and online$=1 |
aw7fu9a9bdyus | SELECT * FROM PER_SECURITY_PROFILES WHERE SECURITY_PROFILE_ID = :B1 |
badzp9g6jzuz9 | SELECT AI.INVOICE_ID, AI.INVOICE_NUM FROM AP_INVOICES_ALL AI WHERE AI.WFAPPROVAL_STATUS <> 'NOT REQUIRED' AND AI.WFAPPROVAL_STATUS<>'WFAPPROVED' AND AI.SOURCE IN ('SCAN_XGS', 'ZCI') AND INSTR(AI.ATTRIBUTE1, '40')>0 AND AI.ORG_ID=:B1 AND NOT EXISTS (SELECT 1 FROM AP_HOLDS_ALL AHA WHERE HOLD_LOOKUP_CODE=:B2 AND AI.INVOICE_ID=AHA.INVOICE_ID ) AND EXISTS (SELECT 1 FROM DKA_STRANSCO_HEADERS DSH, DKA_STRANSCO_LINES DSL, GL_CODE_COMBINATIONS GCC, HR_ALL_ORGANIZATION_UNITS HOU WHERE AI.ACCTS_PAY_CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID AND DSL.PARAM2_VALUE = GCC.SEGMENT2 AND HOU.ORGANIZATION_ID = AI.ORG_ID AND DSL.PARAM1_VALUE = HOU.ATTRIBUTE10 AND DSH.SET_ID = DSL.SET_ID AND DSH.SET_NAME = 'CENTRE_SERVICE_PARTAGE' AND DSL.START_DATE <= TRUNC (SYSDATE) AND NVL (DSL.END_DATE, TRUNC (SYSDATE)) >= TRUNC (SYSDATE) ) |
bb4y6zxs3j061 | UPDATE AP_HOLDS_ALL AHA SET AHA.VALIDATION_REQUEST_ID = NULL WHERE AHA.VALIDATION_REQUEST_ID = :B1 OR (AHA.VALIDATION_REQUEST_ID IN (SELECT FCR.REQUEST_ID FROM FND_CONCURRENT_REQUESTS FCR WHERE FCR.PARENT_REQUEST_ID = :B1 )) |
bkaaqaa5aj3gf | SELECT MESSAGE_TEXT, MESSAGE_NUMBER, TYPE, FND_LOG_SEVERITY, CATEGORY, SEVERITY FROM FND_NEW_MESSAGES M, FND_APPLICATION A WHERE :B3 = M.MESSAGE_NAME AND :B2 = M.LANGUAGE_CODE AND :B1 = A.APPLICATION_SHORT_NAME AND M.APPLICATION_ID = A.APPLICATION_ID |
bn7jfdsf4zh36 | DELETE FROM ZX_JURISDICTIONS_GT |
bwm53fxa4ckra |
INSERT INTO xla_ctrl_bal_interim_gt (
application_id
, ledger_id
, code_combination_id
, party_type_code
, party_id
, party_site_id
, period_name
, effective_period_num
, period_balance_dr
, period_balance_cr
, period_year
)
SELECT /*+ use_nl(aeh) use_nl(ael) */
ael.application_id
, ael.ledger_id
, ael.code_combination_id
, ael.party_type_code
, ael.party_id
, nvl(ael.party_site_id, -999) -- bug11887321
, gps.period_name
, gps.effective_period_num
, SUM (NVL (ael.accounted_dr, 0)) period_balance_dr
, SUM (NVL (ael.accounted_cr, 0)) period_balance_cr
, SUBSTR (gps.effective_period_num, 1, 4) period_year
FROM xla_ae_headers aeh
, xla_ae_lines ael
, gl_period_statuses gps
, xla_ledger_options xlo
, xla_ledger_relationships_v xlr
, xla_bal_concurrency_control bcc
WHERE aeh.application_id = :1
AND aeh.accounting_entry_status_code = 'F'
AND aeh.balance_type_code = 'A'
AND ael.application_id = aeh.application_id
AND ael.ae_header_id = aeh.ae_header_id
AND ael.control_balance_flag = 'P'
AND ael.ledger_id = aeh.ledger_id
AND xlr.ledger_id = aeh.ledger_id
AND xlo.application_id = aeh.application_id
AND xlo.ledger_id = DECODE (xlr.ledger_category_code , 'ALC'
, xlr.primary_ledger_id , xlr.ledger_id )
AND gps.ledger_id = xlo.ledger_id
AND gps.application_id = 101
AND gps.closing_status IN ('O', 'C', 'P')
AND gps.effective_period_num <= xlo.effective_period_num
AND gps.adjustment_period_flag = 'N'
AND gps.period_name = aeh.period_name
AND bcc.request_id = :2
AND bcc.accounting_batch_id = aeh.accounting_batch_id
AND bcc.application_id = aeh.application_id
AND bcc.ledger_id = aeh.ledger_id
AND aeh.accounting_batch_id = :3 GROUP BY ael.application_id
, ael.ledger_id
, ael.code_combination_id
, ael.party_type_code
, ael.party_id
, ael.party_site_id
, gps.period_name
, gps.effective_period_num |
bwzqpznjgy3vu |
SELECT /*+ leading(evt) use_nl(ent) index(evt, XLA_EVENTS_N3) */ -- Bug 5529420 reverted bug6369888 modified hint bug9192859
DISTINCT evt.entity_id
FROM xla_events evt
, xla_transaction_entities ent
, xla_event_types_b xet
, xla_event_class_attrs eca
, xla_evt_class_orders_gt xpo
WHERE ent.application_id = :1
AND ent.ledger_id = :2
AND evt.application_id = :3
AND evt.entity_id = ent.entity_id
AND xet.application_id = evt.application_id
AND xet.event_type_code = evt.event_type_code
AND eca.application_id = xet.application_id
AND eca.entity_code = xet.entity_code
AND eca.event_class_code = xet.event_class_code
AND eca.event_class_group_code = NVL(:4, eca.e
vent_class_group_code)
AND evt.event_type_code NOT IN ('FULL_MERGE', 'PARTIAL_MERGE')
AND evt.process_status_code IN ('I', 'E', 'R', DECODE(:5, 'N', 'D', 'E')
, DECODE(:6, 'N', 'U', 'E')
)
AND evt.event_status_code IN ('U', DECODE(:7, 'F', 'N', 'U'))
AND evt.on_hold_flag = 'N'
AND evt.event_date <= :8
AND ent.entity_code <> :9
AND NVL(evt.budgetary_control_flag, 'N') = 'N'
AND xet.event_class_code = xpo.event_class_code
AND xpo.processing_order = :10 |
cav2j60adrvb9 | begin :con := "XLA_SECURITY_POLICY_PKG"."MO_POLICY"(:sn, :on); end; |
cb21bacyh3c7d | select metadata from kopm$ where name='DB_FDO' |
ctp9ravf5dxfr | UPDATE AP_HOLDS_ALL AHA SET AHA.VALIDATION_REQUEST_ID = NULL WHERE AHA.VALIDATION_REQUEST_ID IN ( SELECT FCR.REQUEST_ID FROM FND_CONCURRENT_REQUESTS FCR WHERE FCR.CONCURRENT_PROGRAM_ID IN ( SELECT FCP.CONCURRENT_PROGRAM_ID FROM FND_CONCURRENT_PROGRAMS FCP WHERE FCP.APPLICATION_ID = 200 AND FCP.CONCURRENT_PROGRAM_NAME IN ('APPRVL', 'WORKERAPPRVL') ) AND FCR.PHASE_CODE = 'C') |
d1vdbgj9yykhh | DELETE FROM ZX_REC_NREC_DIST_GT WHERE REC_NREC_TAX_DIST_ID IN :B1 |
dawf7hvg1ym94 | select V.PROFILE_OPTION_VALUE from FND_PROFILE_OPTIONS O, FND_PROFILE_OPTION_VALUES V where O.PROFILE_OPTION_NAME = :1 and V.LEVEL_ID = :2 and O.START_DATE_ACTIVE <= SYSDATE and nvl(O.END_DATE_ACTIVE, SYSDATE) >= SYSDATE and O.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID and O.APPLICATION_ID = V.APPLICATION_ID and V.LEVEL_VALUE = :3 |
ddudsfwj54f0g | select a.tablespace_name
, round(a.alloc_size/1024/1024/1024, 0)
, round(a.cur_size/1024/1024/1024, 0)
, round((u.used+a.file_count*65536)/1024/1024/1024, 0)
, round((a.alloc_size-(u.used+a.file_count*65536))/1024/1024/1024, 0)
, round(((u.used+a.file_count*65536)*100)/a.alloc_size, 0) as Pct_used
from dba_tablespaces t
, (select t1.tablespace_name
, nvl(sum(s.bytes), 0) used
from dba_segments s
, dba_tablespaces t1
where t1.tablespace_name=s.tablespace_name(+)
group by t1.tablespace_name) u
, (select d.tablespace_name
, sum(greatest(d.bytes, nvl(d.maxbytes, 0))) alloc_size
, sum(d.bytes) cur_size
, count(*) file_count
from dba_data_files d where AUTOEXTENSIBLE='YES'
group by d.tablespace_name) a
where t.tablespace_name=u.tablespace_name
and t.tablespace_name=a.tablespace_name
order by Pct_used asc
|
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 |
dg7rw6zr1wdaa | begin FND_FLEX_WORKFLOW_APIS.ASSIGN_TO_SEGMENT (:v1, :v2, :v3, :v4, :v5); end; |
dm5qmv0xq5qbn | select obj# from obj$ o where name=:1 and owner#=:2 |
dndn8zwusbhy7 | INSERT INTO AP_TEMP_APPROVAL_GT(HOLD_LOOKUP_CODE, NUMBER_HOLDS_PLACED, NUMBER_HOLDS_RELEASED, ORG_ID) SELECT HOLD_LOOKUP_CODE, COUNT(1) - COUNT(RELEASE_LOOKUP_CODE), COUNT(RELEASE_LOOKUP_CODE), ORG_ID FROM AP_HOLDS_ALL AHA WHERE (AHA.VALIDATION_REQUEST_ID IN (SELECT FCR.REQUEST_ID FROM FND_CONCURRENT_REQUESTS FCR WHERE FCR.PARENT_REQUEST_ID = :B1 )) OR AHA.VALIDATION_REQUEST_ID = :B1 GROUP BY ORG_ID, HOLD_LOOKUP_CODE |
dtt937fsj05m4 | SELECT AII.INVOICE_ID, AII.GL_DATE, AII.ATTRIBUTE9 ORIGINE, SUBSTR(AII.DOC_CATEGORY_CODE, 1, 4) SOCIETE, SUBSTR(AII.PAY_GROUP_LOOKUP_CODE, 8) TYPE_FOURNISSEUR, AII.VENDOR_ID, AII.STATUS, AII.GROUP_ID, AII.SOURCE, AII.ORG_ID ORGANIZATION, AII.INVOICE_NUM, AII.VENDOR_SITE_CODE, AII.VENDOR_SITE_ID, AII.INVOICE_DATE, AII.INVOICE_AMOUNT, AII.VENDOR_NUM, AII.ROWID RID FROM AP_INVOICES_INTERFACE AII WHERE AII.SOURCE = 'SCAN_XGS' AND (AII.STATUS != 'PROCESSED' OR AII.STATUS IS NULL) AND AII.ORG_ID = :B1 ORDER BY AII.ATTRIBUTE9, SUBSTR(AII.DOC_CATEGORY_CODE, 1, 4), SUBSTR(AII.PAY_GROUP_LOOKUP_CODE, 8) |
f55uyfv6306pt | SELECT LANGUAGE_CODE, NLS_LANGUAGE, NLS_TERRITORY, NLS_CODESET, DESCRIPTION, INSTALLED_FLAG FROM FND_LANGUAGES_VL WHERE NLS_LANGUAGE=:1 |
fhf8upax5cxsz | BEGIN sys.dbms_auto_report_internal.i_save_report (:rep_ref, :snap_id, :pr_class, :rep_id, :suc); END; |
fjqwt3zgytjdd | SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME = 'DEFAULT_EDITION' |
fnvxqb1ncbd56 | SELECT AII.* FROM AP_INVOICES_INTERFACE AII WHERE AII.SOURCE = 'SCAN_XGS' AND ATTRIBUTE13 IS NOT NULL AND EXISTS ( SELECT 'X' FROM AP_INVOICE_LINES_INTERFACE AILI WHERE AILI.INVOICE_ID = AII.INVOICE_ID AND AILI.LINE_TYPE_LOOKUP_CODE = 'ITEM' AND AILI.PO_HEADER_ID IS NOT NULL ) AND AII.ORG_ID = :B1 |
gmjbqkrskpkbt | SELECT SET_OF_BOOKS_ID FROM HR_OPERATING_UNITS WHERE ORGANIZATION_ID = :B1 |
grwydz59pu6mc | select text from view$ where rowid=:1 |
gtvyydjxda4kf | UPDATE AP_INVOICE_DISTRIBUTIONS_ALL ID1 SET (ID1.TOTAL_DIST_AMOUNT, ID1.TOTAL_DIST_BASE_AMOUNT) = (SELECT SUM(NVL(ID2.AMOUNT, 0)), SUM(NVL(ID2.BASE_AMOUNT, 0)) FROM AP_INVOICE_DISTRIBUTIONS_ALL ID2 WHERE ID2.INVOICE_DISTRIBUTION_ID = ID1.INVOICE_DISTRIBUTION_ID OR ID2.RELATED_ID = ID1.INVOICE_DISTRIBUTION_ID) WHERE ID1.INVOICE_ID = :B1 AND ID1.LINE_TYPE_LOOKUP_CODE NOT IN ('IPV', 'ERV', 'TIPV', 'TRV', 'TERV') |