plsql - output of dbms_xplan.display_awr() is coming blank -
i want see plan output of below query.
explain plan select /*ajay*/ main_query.circle_name, main_query.operator_id, main_query.operator_name, (decode(main_query.billing_type,'1','energy','2','ipf','3','ipf-opex',main_query.billing_type)) billing_type, (decode( main_query.billing_cycle,1,'monthly',2,'monthly advance', 4,'quarterly advance',main_query.billing_cycle)) billing_cycle, (decode(main_query.billing_cycle,4,to_char(to_date(main_query.bill_month,'yyyymm'),'mon-yyyy')||'-'||to_char(add_months(to_date(main_query.bill_month,'yyyymm'),2),'mon-yyyy'),to_char(to_date(main_query.bill_month,'yyyymm'),'mon-yyyy')))bill_month, main_query.bill_cycle_no, main_query.external_invoice_id invoice_no, (case when 1= 0 '0' else decode(main_query.current_level,null,'level 1','0','0','-999','closed',(select level_name mst_level level_id = main_query.current_level)) end) current_level, --1.3 --main_query.total_sites, main_query.sites_not_billed, main_query.sites_billed, main_query.invoice_amt, main_query.total_sites, ( select /*+ index(t1,idx_bill_month) */ count(1) txn_ebs_details t1 t1.bill_month = main_query.bill_month , t1.billing_cycle = main_query.billing_cycle , t1.operator_id = main_query.operator_id , t1.billing_type = 1 , t1.consumption_flag = '00002') sites_not_billed, --1.7 main_query.sites_billed, --main_query.invoice_amt, round(main_query.invoice_amt,2) invoice_amt, --2.2 main_query.col_aprvd_nm, main_query.col_aprvd_cnt, --main_query.col_aprvd_ttl_amt, round(main_query.col_aprvd_ttl_amt,2) col_aprvd_ttl_amt, --2.2 round(main_query.col_aprvd_avg_amt,2) col_aprvd_avg_amt, --2.1,2.4 --(case when main_query.col_aprvd_cnt <> 0 round(main_query.col_aprvd_ttl_amt/main_query.col_aprvd_cnt,2) else 0 end ) col_aprvd_avg_amt, --2.1 --round((case when main_query.col_aprvd_cnt <> 0 round(main_query.col_aprvd_ttl_amt/main_query.col_aprvd_cnt,2) else 0 end ),2) col_aprvd_avg_amt, --2.1, 2.2, 2.4 main_query.col_rej_nm, main_query.col_rej_cnt, --main_query.col_rej_ttl_amt, round(main_query.col_rej_ttl_amt,2) col_rej_ttl_amt, --2.2 round(main_query.col_rej_avg_amt,2) col_rej_avg_amt, --2.1, 2.4 --(case when main_query.col_rej_cnt <> 0 round(main_query.col_rej_ttl_amt/main_query.col_rej_cnt,2) else 0 end ) col_rej_avg_amt, --2.1 --round((case when main_query.col_rej_cnt <> 0 round(main_query.col_rej_ttl_amt/main_query.col_rej_cnt,2) else 0 end ),2) col_rej_avg_amt, --2.1, 2.2, 2.4 main_query.col_disp_nm, main_query.col_disp_cnt, --main_query.col_disp_ttl_amt, round(main_query.col_disp_ttl_amt,2) col_disp_ttl_amt, --2.2 round(main_query.col_disp_avg_amt,2) col_disp_avg_amt, --2.1, 2.4 --(case when main_query.col_disp_cnt <> 0 round(main_query.col_disp_ttl_amt/main_query.col_disp_cnt,2) else 0 end ) col_disp_avg_amt, --2.1 --round((case when main_query.col_disp_cnt <> 0 round(main_query.col_disp_ttl_amt/main_query.col_disp_cnt,2) else 0 end ),2) col_disp_avg_amt, --2.1, 2.2, 2.4 main_query.col_pen_nm, main_query.col_pen_cnt, --main_query.col_pen_ttl_amt, round(main_query.col_pen_ttl_amt,2) col_pen_ttl_amt, --2.2 round(main_query.col_pen_avg_amt,2)col_pen_avg_amt, --2.1,2.4 --(case when main_query.col_pen_cnt <> 0 round(main_query.col_pen_ttl_amt/main_query.col_pen_cnt,2) else 0 end ) col_pen_avg_amt, --2.1 --round((case when main_query.col_pen_cnt <> 0 round(main_query.col_pen_ttl_amt/main_query.col_pen_cnt,2) else 0 end ),2) col_pen_avg_amt, --2.1, 2.2, 2.4 nvl(col_disp_er_nm,'disputed earlier') col_disp_er_nm, nvl(col_disp_er_cnt,0) col_disp_er_cnt, --nvl(col_disp_er_ttl_amt,0) col_disp_er_ttl_amt, round(nvl(col_disp_er_ttl_amt,0),2) col_disp_er_ttl_amt, --2.2 nvl(col_disp_er_avg_amt,0) col_disp_er_avg_amt, --2.1, 2.4 --(case when nvl(col_disp_er_cnt,0) <> 0 round(nvl(col_disp_er_ttl_amt,0)/nvl(col_disp_er_cnt,0),2)else 0 end ) col_disp_er_avg_amt, --2.1 --round((case when nvl(col_disp_er_cnt,0) <> 0 round(nvl(col_disp_er_ttl_amt,0)/nvl(col_disp_er_cnt,0),2)else 0 end ),2) col_disp_er_avg_amt, --2.1, 2.2, 2.4 round(main_query.avg_billamt_per_site,2) avg_billamt_per_site, --2.1, 2.4 --round(main_query.invoice_amt/main_query.sites_billed,2) avg_billamt_per_site, --2.1 --round(main_query.invoice_amt/main_query.sites_billed,2) avg_billamt_per_site, --2.1 , 2.2, 2.4 output_file_path,file_ext, (select listagg(mr.role_name,', ') within group (order mr.role_id) mst_role mr, mst_role_level mrl mr.role_id = mrl.role_id , mrl.level_id = main_query.current_level ) role_listing, --decode(main_query.backbill_flag,'1','back bill',null) backbill_flag, --1.4 to_number(decode(main_query.backbill_flag,'1',(select count(1) txn_ibill_customer_back_bill t1 t1.bill_month = main_query.bill_month , t1.billing_cycle = main_query.billing_cycle , t1.operator_id = main_query.operator_id , t1.billing_type = 1 , t1.backbill_flag = 1),null)) backbill_flag, --2.3 decode(main_query.backbill_flag,'2','back bill','regular bill') backbill_type --1.4 (select circle_name, --1.5 operator_id,sf_ibil_get_customer_name(operator_id) operator_name, billing_type,billing_cycle,max(bill_month)bill_month, '' bill_cycle_no, external_invoice_id,current_level,nvl(max(total_sites),0) total_sites, nvl(max(sites_not_billed),0) sites_not_billed, nvl(max(sites_billed),0) sites_billed, nvl(max(invoice_amt),0) invoice_amt, nvl(max(backbill_flag),0) backbill_flag, --1.4 -- 1.6 nvl(max(avg_billamt_per_site),0) avg_billamt_per_site, --2.1, 2.4 nvl(max(col_aprvd_nm),'approved') col_aprvd_nm, nvl(max(col_aprvd_cnt),0) col_aprvd_cnt, nvl(max(col_aprvd_ttl_amt),0) col_aprvd_ttl_amt, nvl(max(col_aprvd_avg_amt),0) col_aprvd_avg_amt, nvl(max(col_rej_nm),'rejected') col_rej_nm, nvl(max(col_rej_cnt),0) col_rej_cnt, nvl(max(col_rej_ttl_amt),0) col_rej_ttl_amt, nvl(max(col_rej_avg_amt),0) col_rej_avg_amt, nvl(max(col_disp_nm),'disputed') col_disp_nm, nvl(max(col_disp_cnt),0) col_disp_cnt, nvl(max(col_disp_ttl_amt),0) col_disp_ttl_amt, nvl(max(col_disp_avg_amt),0) col_disp_avg_amt, nvl(max(col_pen_nm),'pending') col_pen_nm, nvl(max(col_pen_cnt),0) col_pen_cnt, nvl(max(col_pen_ttl_amt),0) col_pen_ttl_amt, nvl(max(col_pen_avg_amt),0) col_pen_avg_amt (select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, external_invoice_id,current_level,backbill_flag, --1.4 count(1) on (partition operator_id,billing_type,billing_cycle,bill_month) total_sites, null sites_not_billed,null sites_billed,null invoice_amt, null avg_billamt_per_site, --2.1, 2.4 null col_aprvd_nm,null col_aprvd_cnt,null col_aprvd_ttl_amt,null col_aprvd_avg_amt, null col_rej_nm,null col_rej_cnt,null col_rej_ttl_amt,null col_rej_avg_amt, null col_disp_nm,null col_disp_cnt,null col_disp_ttl_amt,null col_disp_avg_amt, null col_pen_nm,null col_pen_cnt,null col_pen_ttl_amt,null col_pen_avg_amt txn_ebs_details --total_sites reprocess_flag=0 --1.8 union select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, null external_invoice_id,current_level,backbill_flag, --1.4 null total_sites, count(1) on (partition operator_id,billing_type,billing_cycle,bill_month) sites_not_billed, null sites_billed,null invoice_amt, null avg_billamt_per_site, --2.1, 2.4 null col_aprvd_nm,null col_aprvd_cnt,null col_aprvd_ttl_amt,null col_aprvd_avg_amt, null col_rej_nm,null col_rej_cnt,null col_rej_ttl_amt,null col_rej_avg_amt, null col_disp_nm,null col_disp_cnt,null col_disp_ttl_amt,null col_disp_avg_amt, null col_pen_nm,null col_pen_cnt,null col_pen_ttl_amt,null col_pen_avg_amt txn_ebs_details ted ted.consumption_flag = '00002' --sites_not_billed union select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, external_invoice_id,current_level,backbill_flag, --1.4 null total_sites,null sites_not_billed, count(1) on (partition external_invoice_id) sites_billed, sum(total_amount) on (partition external_invoice_id) invoice_amt, round(avg(total_amount) on (partition external_invoice_id) ,2) avg_billamt_per_site, --2.1, 2.4 null col_aprvd_nm,null col_aprvd_cnt,null col_aprvd_ttl_amt,null col_aprvd_avg_amt, null col_rej_nm,null col_rej_cnt,null col_rej_ttl_amt,null col_rej_avg_amt, null col_disp_nm,null col_disp_cnt,null col_disp_ttl_amt,null col_disp_avg_amt, null col_pen_nm,null col_pen_cnt,null col_pen_ttl_amt,null col_pen_avg_amt txn_ebs_details external_invoice_id not null --sites_billed union select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, external_invoice_id,current_level,backbill_flag, --1.4 null total_sites,null sites_not_billed, null sites_billed,null invoice_amt, null avg_billamt_per_site, --2.1, 2.4 'approved' col_aprvd_nm, count(1) on (partition external_invoice_id) col_aprvd_cnt, sum(total_amount) on (partition external_invoice_id) col_aprvd_ttl_amt, round(avg(total_amount) on (partition external_invoice_id) ,2) col_aprvd_avg_amt, null col_rej_nm,null col_rej_cnt,null col_rej_ttl_amt,null col_rej_avg_amt, null col_disp_nm,null col_disp_cnt,null col_disp_ttl_amt,null col_disp_avg_amt, null col_pen_nm,null col_pen_cnt,null col_pen_ttl_amt,null col_pen_avg_amt txn_ebs_details approval_flag not in (0,-100) , bill_approval_flag = '0' , external_invoice_id not null --approved union select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, external_invoice_id,current_level,backbill_flag, --1.4 null total_sites,null sites_not_billed, null sites_billed,null invoice_amt, null avg_billamt_per_site, --2.1, 2.4 null col_aprvd_nm,null col_aprvd_cnt,null col_aprvd_ttl_amt,null col_aprvd_avg_amt, 'rejected' col_rej_nm, count(1) on (partition external_invoice_id) col_rej_cnt, sum(total_amount) on (partition external_invoice_id) col_rej_ttl_amt, round(avg(total_amount) on (partition external_invoice_id) ,2) col_rej_avg_amt, null col_disp_nm,null col_disp_cnt,null col_disp_ttl_amt,null col_disp_avg_amt, null col_pen_nm,null col_pen_cnt,null col_pen_ttl_amt,null col_pen_avg_amt txn_ebs_details approval_flag = 0 , bill_approval_flag = '1' , external_invoice_id not null --rejected union select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, external_invoice_id,current_level,backbill_flag, --1.4 null total_sites,null sites_not_billed, null sites_billed,null invoice_amt, null avg_billamt_per_site, --2.1, 2.4 null col_aprvd_nm,null col_aprvd_cnt,null col_aprvd_ttl_amt,null col_aprvd_avg_amt, null col_rej_nm,null col_rej_cnt,null col_rej_ttl_amt,null col_rej_avg_amt, 'disputed' col_disp_nm, count(1) on (partition external_invoice_id) col_disp_cnt, sum(total_amount) on (partition external_invoice_id) col_disp_ttl_amt, round(avg(total_amount) on (partition external_invoice_id) ,2) col_disp_avg_amt, null col_pen_nm,null col_pen_cnt,null col_pen_ttl_amt,null col_pen_avg_amt txn_ebs_details approval_flag = -100 , external_invoice_id not null --disputed union select circle_name, --1.5 operator_id,billing_type,billing_cycle,bill_month, external_invoice_id,current_level,backbill_flag, --1.4 null total_sites,null sites_not_billed, null sites_billed,null invoice_amt, null avg_billamt_per_site, --2.1, 2.4 null col_aprvd_nm,null col_aprvd_cnt,null col_aprvd_ttl_amt,null col_aprvd_avg_amt, null col_rej_nm,null col_rej_cnt,null col_rej_ttl_amt,null col_rej_avg_amt, null col_disp_nm,null col_disp_cnt,null col_disp_ttl_amt,null col_disp_avg_amt, 'pending' col_pen_nm, count(1) on (partition external_invoice_id) col_pen_cnt, sum(total_amount) on (partition external_invoice_id) col_pen_ttl_amt, round(avg(total_amount) on (partition external_invoice_id) ,2) col_pen_avg_amt txn_ebs_details approval_flag = 0 , bill_approval_flag = '0' , external_invoice_id not null --pending ) group circle_name, --1.5 operator_id,billing_type,billing_cycle, --1.4 -- 1.6 backbill_flag, --bill_month, external_invoice_id,current_level having max(external_invoice_id) not null order bill_month desc, operator_name, external_invoice_id desc --1.6 ) main_query, (select operator_id,billing_type,billing_cycle,bill_month, 'disputed earlier' col_disp_er_nm, col_disp_er_cnt,col_disp_er_ttl_amt, round(col_disp_er_ttl_amt/col_disp_er_cnt,2) col_disp_er_avg_amt (select operator_id,billing_type,billing_cycle,bill_month, sum(col_disp_er_cnt) col_disp_er_cnt, sum(col_disp_er_ttl_amt) col_disp_er_ttl_amt (select operator_id,bill_month,billing_type,billing_cycle, count(1) col_disp_er_cnt, sum(total_amount) col_disp_er_ttl_amt txn_ebs_details external_invoice_id null , (approval_flag = -100 or (approval_flag = 0 , bill_approval_flag = '2')) group operator_id,bill_month,billing_cycle,billing_type,current_level union select y.operator_id,y.bill_month,y.billing_type,y.billing_cycle, count(1) col_disp_er_cnt, sum(total_amount) col_disp_er_ttl_amt txn_ebs_details y, (select t.external_invoice_id,t.bill_month,t.operator_id,t.billing_cycle, t.billing_type,t.l1 (select external_invoice_id,bill_month,operator_id, billing_cycle,billing_type, lead(external_invoice_id) over(partition operator_id,bill_month,billing_cycle order external_invoice_id) l1 txn_ebs_details external_invoice_id not null) t t.external_invoice_id <> t.l1) f f.l1 = y.external_invoice_id , f.operator_id = y.operator_id , f.bill_month = y.bill_month , f.billing_cycle = y.billing_cycle , f.billing_type = y.billing_type , y.rfb_flag = '1' --1.9 group y.operator_id,y.bill_month,y.billing_type, y.billing_cycle,y.external_invoice_id ) group operator_id,bill_month,billing_cycle,billing_type) ) disp_er_query, mst_cust_template mct, mst_report_template mrt main_query.operator_id = disp_er_query.operator_id(+) , main_query.bill_month = disp_er_query.bill_month(+) , main_query.billing_cycle = disp_er_query.billing_cycle(+) , main_query.billing_type = disp_er_query.billing_type(+) --and main_query.backbill_flag = disp_er_query.backbill_flag(+) --1.9 , main_query.operator_id = mct.customer_id(+) , mct.temp_id = mrt.temp_id(+) , exists (select 1 txn_ebs_details ted ted.external_invoice_id = main_query.external_invoice_id , ted.starting_date between to_date('01-jan-2014','dd-mon-yyyy') , to_date('31-jan-2017','dd-mon-yyyy') , rownum < 2);
when running query on sqldeveloper, giving me correct output (with n no. of rows).
but when doing select * table(dbms_xplan.display_awr() );
(sql-id of query v$sql).
plan_output_table column showing no record/output.
can help? missing step in using proc dbms_xplan.display_awr(). query correct since giving output
Comments
Post a Comment