Need to tune parameter from tkprof output.

Hi,
i want to tune my sql queries using tkprof output.
i want to know if the performance of my query not upto the mark then which parameter will i tune and how will i get this information from tkprof output.
regards

855516 wrote:
Hi,
i want to tune my sql queries using tkprof output.
i want to know if the performance of my query not upto the mark then which parameter will i tune and how will i get this information from tkprof output.It is upto you to define the expected level of performance (mark) from your system - of course, it goes without saying that you can expect a super computer performance from a desktop class machine.
TKProf does not provide information/advice regarding parameters to be tuned. It only gives detailed information about the query execution, its plan and the wait events (in case).

Similar Messages

  • Suggestions from tkprof output

    Hi All,
    I need to tune the following sql query. I have given the tkprof output of the sql, can you please suggest ways to improvise the query?
    Trace file: hsctst09_ora_1671386_10046.trc
    Sort options: prsela  fchela  exeela
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    error connecting to database using: rms12/rms12
    ORA-01017: invalid username/password; logon denied
    EXPLAIN PLAN option disabled.
    select distinct RPE.promo_event_display_id             Event_Number,
           RPE.description                                 Event_Description,
           RPE.start_date                                  Event_Start_Date,
           RPE.end_date                                    Event_End_Date,
           (CASE RPD.state  
                 WHEN 'pcd.active'                     THEN 'Active'
                 WHEN 'pcd.approved'                   THEN 'Approved'
                 WHEN 'pcd.cancelled'                  THEN 'Cancelled'
                 WHEN 'pcd.conflictCheckForApproved'   THEN 'Conflict Check'
                 WHEN 'pcd.submitted'                  THEN 'Submitted'
                 WHEN 'pcd.complete'                   THEN 'Complete'
                 WHEN 'pcd.substate.working.worksheet' THEN 'Worksheet'
                 ELSE 'Unknown'                      
           END)                                            Event_Status,
           RP.promo_display_id                             Promotion_ID,
           RP.description                                  Promotion_Description,
           RP.start_date                                   Promotion_Start_Date,
           RP.end_date                                     Promotion_End_Date,
           RPDT.dept                                       Valid_Section,
           RTH.threshold_display_id                        Threshold_Number,
           RTH.name                                        Threshold_Description,
           RPC.comp_display_id                             Component_ID,
           RPC.name                                        Component_Description,
           RPC.tsl_comp_level_desc                         Description_at_the_till,
           'Threshold'                                     Component_Type,
           RPC.tsl_ext_promo_id                            External_ID,
           decode(RPC.funding_percent,null,'No','Yes')     Funding_Indicator,
           (CASE RPD.apply_to_code
                 WHEN 0 THEN 'Regular Only'
                 WHEN 1 THEN 'Clearance Only'
                 WHEN 2 THEN 'Regular and Clearance'
                 ELSE NULL
           END)                                            Apply_to,
           RPD.start_date                                  Component_start_date,
           RPD.end_date                                    Component_End_Date,
           '="'||RPT.item||'"'                             Item,
           IM.item_desc                                    Item_Description,
           '="'||TRPCT.tpnd_id||'"'                        Pack,
           IM1.item_desc                                   Pack_Description,
           decode(TRPCT.primary_tpnd,1,'Yes','No')         Primary_Pack,
           RPC.funding_percent                             Corporate_Funding_Percent,
           DP.contribution_pct                             Supplier_Funding_Percent,
           RPCT.uptake_percent                             Uptake_Percent,
           RPT.tsl_uplift_perc                             Uplift_Percent,
           NULL                                            List_Type,
           NULL                                            Buy_Type,
           NULL                                            Buy_Value,
           (CASE RTI.threshold_type
                 WHEN 0 THEN 'Amount'
                 WHEN 1 THEN 'Quantity'
                 WHEN 2 THEN 'Weight'
                 ELSE NULL
           END)                                            Get_Type,
           RTI.threshold_amount                            Get_Value,
           (CASE RTI.change_type
                 WHEN 0 THEN 'Percent Off'
                 WHEN 1 THEN 'Amount Off'
                 WHEN 2 THEN 'Fixed Price'
                 WHEN 3 THEN 'No Change'
                 WHEN 4 THEN 'Exclude'
                 WHEN 5 THEN 'ClubCard Points'
                 WHEN 6 THEN 'Voucher'
                 WHEN 7 THEN 'Cheapest Free'
                 ELSE NULL
           END)                                            Change_Type,
           RTI.change_amount                               Change_Amount,
           RTI.tsl_voucher_number                          Voucher_Number,
           NULL                                            Get_Quantity,
           RZFR.selling_uom                                Selling_UOM,
           RPCT.tsl_coupon_number                          Coupon_Number,
           RPCT.tsl_coupon_desc                            Coupon_Description,
           RPT.zone_id                                     Zone,
           RPD.Ignore_Constraints                          Ignore_Constraints,
           RPT.tsl_feature_space_end_num                   Feature_Space
      from rpm_promo RP,
           rpm_promo_comp RPC,
           rpm_promo_comp_detail RPD,
           rpm_promo_event RPE,
           rpm_promo_dept RPDT,
           rpm_promo_comp_threshold RPT,
           rpm_threshold RTH,
           rpm_threshold_interval RTI,
           v_item_master IM,
           item_supplier SU,
           rpm_promo_comp_thresh_link RPCT,
           tsl_rpm_promo_comp_tpnd TRPCT,
           v_item_master IM1,
           rpm_zone_future_retail RZFR,
           ( select isu.supplier,
                    isu.item,
                    dh.deal_id,
                    dcp.promotion_id,
                    dcp.promo_comp_id,
                    dcp.contribution_pct
               from item_supplier isu inner join
                    deal_head dh on (isu.supplier = dh.supplier)
                    inner join deal_comp_prom dcp on (dcp.deal_id = dh.deal_id) ) dp
    where RP.promo_id = RPC.promo_id
       and RPD.promo_comp_id = RPC.promo_comp_id
       and RPE.promo_event_id = RP.promo_event_id
       and RP.promo_id = RPDT.promo_id
       and RPDT.dept = IM.dept
       and DP.promotion_id (+) = RP.promo_id
       and RPT.rpm_promo_comp_detail_id = RPD.rpm_promo_comp_detail_id
       and RPT.threshold_id = RTH.threshold_id
       and RPT.threshold_id = RTI.threshold_id
       and TRPCT.rpm_promo_comp_detail_id = RPD.rpm_promo_comp_detail_id
       and RPT.item = IM.item
       and IM.item = SU.item
       and RPD.promo_comp_id = RPCT.promo_comp_id
       and TRPCT.tpnb_id = RPT.item
       and TRPCT.tpnd_id = IM1.item
       and RZFR.item = IM.item
    UNION ALL
    -- Simple Query
    select distinct RPE.promo_event_display_id             Event_Number,
           RPE.description                                 Event_Description,
           RPE.start_date                                  Event_Start_Date,
           RPE.end_date                                    Event_End_Date,
           (CASE RPD.state  
                 WHEN 'pcd.active'                     THEN 'Active'
                 WHEN 'pcd.approved'                   THEN 'Approved'
                 WHEN 'pcd.cancelled'                  THEN 'Cancelled'
                 WHEN 'pcd.conflictCheckForApproved'   THEN 'Conflict Check'
                 WHEN 'pcd.submitted'                  THEN 'Submitted'
                 WHEN 'pcd.complete'                   THEN 'Complete'
                 WHEN 'pcd.substate.working.worksheet' THEN 'Worksheet'
                 ELSE 'Unknown'                      
           END)                                            Event_Status,
           RP.promo_display_id                             Promotion_ID,
           RP.description                                  Promotion_Description,
           RP.start_date                                   Promotion_Start_Date,
           RP.end_date                                     Promotion_End_Date,
           RPDT.dept                                       Valid_Section,
           NULL                                            Threshold_Number,
           NULL                                            Threshold_Description,
           RPC.comp_display_id                             Component_ID,
           RPC.name                                        Component_Description,
           RPC.tsl_comp_level_desc                         Description_at_the_till,
           'Simple'                                        Component_Type,
           RPC.tsl_ext_promo_id                            External_ID,
           decode(RPC.funding_percent,null,'No','Yes')     Funding_Indicator,
           (CASE RPD.apply_to_code
                 WHEN 0 THEN 'Regular Only'
                 WHEN 1 THEN 'Clearance Only'
                 WHEN 2 THEN 'Regular and Clearance'
                 ELSE NULL
           END)                                            Apply_to,
           RPD.start_date                                  Component_start_date,
           RPD.end_date                                    Component_End_Date,
           '="'||RPS.item||'"'                             Item,
           IM.item_desc                                    Item_Description,
           '="'||TRPCT.tpnd_id||'"'                        Pack,
           IM1.item_desc                                   Pack_Description,
           decode(TRPCT.primary_tpnd,1,'Yes','No')         Primary_Pack,
           RPC.funding_percent                             Corporate_Funding_Percent,
           DP.contribution_pct                             Supplier_Funding_Percent,
           RPS.tsl_simple_uptake_percent                   Uptake_Percent,
           RPS.tsl_uplift_perc                             Uplift_Percent,
           NULL                                            List_Type,
           NULL                                            Buy_Type,
           NULL                                            Buy_Value,
           NULL                                            Get_Type,
           NULL                                            Get_Value,
           (CASE RPS.change_type
                 WHEN 0 THEN 'Percent Off'
                 WHEN 1 THEN 'Amount Off'
                 WHEN 2 THEN 'Fixed Price'
                 WHEN 3 THEN 'No Change'
                 WHEN 4 THEN 'Exclude'
                 WHEN 5 THEN 'ClubCard Points'
                 WHEN 6 THEN 'Voucher'
                 WHEN 7 THEN 'Cheapest Free'
                 ELSE NULL
           END)                                            Change_Type,
           RPS.change_amount                               Change_Amount,
           RPS.tsl_voucher_number                          Voucher_Number,
           NULL                                            Get_Quantity,
           RZFR.selling_uom                                Selling_UOM,
           RPS.tsl_coupon_number                           Coupon_Number,
           RPS.tsl_coupon_desc                             Coupon_Description,
           RPS.zone_id                                     Zone,
           RPD.Ignore_Constraints                          Ignore_Constraints,
           RPS.tsl_feature_space_end_num                   Feature_Space
      from rpm_promo RP,
           rpm_promo_comp RPC,
           rpm_promo_comp_detail RPD,
           rpm_promo_event RPE,
           rpm_promo_dept RPDT,
           rpm_promo_comp_simple RPS,
           v_item_master IM,
           item_supplier SU,
           tsl_rpm_promo_comp_tpnd TRPCT,
           v_item_master IM1,
           rpm_zone_future_retail RZFR,
           ( select isu.supplier,
                    isu.item,
                    dh.deal_id,
                    dcp.promotion_id,
                    dcp.promo_comp_id,
                    dcp.contribution_pct
               from item_supplier isu inner join
                    deal_head dh on (isu.supplier = dh.supplier)
                    inner join deal_comp_prom dcp on (dcp.deal_id = dh.deal_id) ) dp
    where RP.promo_id = RPC.promo_id
       and RPD.promo_comp_id = RPC.promo_comp_id
       and RPE.promo_event_id = RP.promo_event_id
       and RP.promo_id = RPDT.promo_id
       and RPDT.dept = IM.dept
       and DP.promotion_id (+) = RP.promo_id
       and RPS.rpm_promo_comp_detail_id = RPD.rpm_promo_comp_detail_id
       and TRPCT.rpm_promo_comp_detail_id = RPD.rpm_promo_comp_detail_id
       and RPS.item = IM.item
       and IM.item = SU.item
       and RZFR.item = RPS.item
       and TRPCT.tpnb_id = RPS.item
       and TRPCT.tpnd_id = IM1.item
    UNION ALL
    -- Multi-Buy Query
    select distinct RPE.promo_event_display_id             Event_Number,
           RPE.description                                 Event_Description,
           RPE.start_date                                  Event_Start_Date,
           RPE.end_date                                    Event_End_Date,
           (CASE RPD.state  
                 WHEN 'pcd.active'                     THEN 'Active'
                 WHEN 'pcd.approved'                   THEN 'Approved'
                 WHEN 'pcd.cancelled'                  THEN 'Cancelled'
                 WHEN 'pcd.conflictCheckForApproved'   THEN 'Conflict Check'
                 WHEN 'pcd.submitted'                  THEN 'Submitted'
                 WHEN 'pcd.complete'                   THEN 'Complete'
                 WHEN 'pcd.substate.working.worksheet' THEN 'Worksheet'
                 ELSE 'Unknown'                      
           END)                                            Event_Status,
           RP.promo_display_id                             Promotion_ID,
           RP.description                                  Promotion_Description,
           RP.start_date                                   Promotion_Start_Date,
           RP.end_date                                     Promotion_End_Date,
           RPDT.dept                                       Valid_Section,
           NULL                                            Threshold_Number,
           NULL                                            Threshold_Description,
           RPC.comp_display_id                             Component_ID,
           RPC.name                                        Component_Description,
           RPC.tsl_comp_level_desc                         Description_at_the_till,
           'MultiBuy'                                      Component_Type,
           RPC.tsl_ext_promo_id                            External_ID,
           decode(RPC.funding_percent,null,'No','Yes')     Funding_Indicator,
           (CASE RPD.apply_to_code
                 WHEN 0 THEN 'Regular Only'
                 WHEN 1 THEN 'Clearance Only'
                 WHEN 2 THEN 'Regular and Clearance'
                 ELSE NULL
           END)                                            Apply_to,
           RPD.start_date                                  Component_start_date,
           RPD.end_date                                    Component_End_Date,
           '="'||RPG.item||'"'                             Item,
           IM.item_desc                                    Item_Description,
           '="'||TRPCT.tpnd_id||'"'                        Pack,
           IM1.item_desc                                   Pack_Description,
           decode(TRPCT.primary_tpnd,1,'Yes','No')         Primary_Pack,
           RPC.funding_percent                             Corporate_Funding_Percent,
           DP.contribution_pct                             Supplier_Funding_Percent,
           NULL                                            Uptake_Percent,
           TRPM.uplift_perc                                Uplift_Percent,
           decode(TBD.list_type,0,'Buy List',1,'Get List') List_Type,
           TBD.buy_item_type                               Buy_Type,
           TBD.buy_item_value                              Buy_Value,
           NULL                                            Get_Type,
           NULL                                            Get_Value,
           (CASE TBD.change_type
                 WHEN 0 THEN 'Percent Off'
                 WHEN 1 THEN 'Amount Off'
                 WHEN 2 THEN 'Fixed Price'
                 WHEN 3 THEN 'No Change'
                 WHEN 4 THEN 'Exclude'
                 WHEN 5 THEN 'ClubCard Points'
                 WHEN 6 THEN 'Voucher'
                 WHEN 7 THEN 'Cheapest Free'
                 ELSE NULL
           END)                                            Change_Type,
           TBD.change_amount                               Change_Amount,
           TBD.voucher_number                              Voucher_Number,
           TBD.get_quantity                                Get_Quantity,
           RZPR.selling_uom                                Selling_UOM,               
           TB.tsl_coupon_number                            Coupon_Number,
           TB.tsl_coupon_desc                              Coupon_Description,
           TBZ.zone_id                                     Zone,
           RPD.Ignore_Constraints                          Ignore_Constraints,
           NULL                                            Feature_Space
      from rpm_promo RP,
           rpm_promo_comp RPC,
           rpm_promo_comp_detail RPD,
           rpm_promo_event RPE,
           rpm_promo_dept RPDT,
           tsl_rpm_promo_comp_m_b TB,
           tsl_rpm_promo_comp_m_b_dtl TBD,
           tsl_rpm_promo_multi_buy_zone TBZ,
           tsl_rpm_promo_get_item RPG,
           v_item_master IM,
           item_supplier SU,
           tsl_rpm_promo_comp_tpnd TRPCT,
           v_item_master IM1,
           rpm_zone_future_retail RZPR,
           tsl_rpm_promo_mb_attr TRPM,
           ( select isu.supplier,
                    isu.item,
                    dh.deal_id,
                    dcp.promotion_id,
                    dcp.promo_comp_id,
                    dcp.contribution_pct
               from item_supplier isu inner join
                    deal_head dh on (isu.supplier = dh.supplier)
                    inner join deal_comp_prom dcp on (dcp.deal_id = dh.deal_id) ) dp
    where RP.promo_id = RPC.promo_id
       and RPD.promo_comp_id = RPC.promo_comp_id
       and RPE.promo_event_id = RP.promo_event_id
       and RP.promo_id = RPDT.promo_id
       and RPDT.dept = IM.dept
       and DP.promotion_id (+) = RP.promo_id
       and RPD.rpm_promo_comp_detail_id = TB.rpm_promo_comp_detail_id
       and TB.rpm_promo_comp_detail_id = TBD.rpm_promo_comp_detail_id
       and TBD.rpm_promo_comp_detail_id = TBZ.rpm_promo_comp_detail_id
       and RPG.item = IM.item
       and IM.item = SU.item
       and TRPM.item = RPG.item
       and TRPM.rpm_promo_comp_detail_id = RPD.rpm_promo_comp_detail_id
       and TRPM.zone_id = TBZ.zone_id
       and RZPR.item = RPG.item
       and TRPCT.tpnb_id = RPG.item
       and TRPCT.tpnd_id = IM1.item

    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      4.16       4.48          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        5     53.01     276.29      91547    1615664          9          48
    total        7     57.17     280.78      91547    1615664          9          48
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 191
    Rows     Row Source Operation
         48  UNION-ALL  (cr=17287 pr=3663 pw=1876 time=2033194 us)
         13   SORT UNIQUE (cr=11286 pr=1052 pw=0 time=2033182 us)
        364    NESTED LOOPS OUTER (cr=11286 pr=1052 pw=0 time=1861854 us)
        364     NESTED LOOPS  (cr=10922 pr=1051 pw=0 time=1857466 us)
         75      NESTED LOOPS  (cr=10770 pr=1041 pw=0 time=1855506 us)
         15       NESTED LOOPS  (cr=10723 pr=1029 pw=0 time=1857844 us)
         15        NESTED LOOPS  (cr=10691 pr=1021 pw=0 time=1857525 us)
         15         NESTED LOOPS  (cr=10689 pr=1021 pw=0 time=1857391 us)
         15          NESTED LOOPS  (cr=10657 pr=1017 pw=0 time=1856760 us)
         15           NESTED LOOPS  (cr=10655 pr=1017 pw=0 time=1856639 us)
         15            NESTED LOOPS  (cr=10623 pr=1006 pw=0 time=1855895 us)
         15             NESTED LOOPS  (cr=10606 pr=1003 pw=0 time=1846410 us)
       1208              NESTED LOOPS  (cr=8188 pr=989 pw=0 time=1846542 us)
       1208               NESTED LOOPS  (cr=5770 pr=978 pw=0 time=1834421 us)
       1208                NESTED LOOPS  (cr=4560 pr=971 pw=0 time=1821047 us)
       1208                 HASH JOIN  (cr=3350 pr=970 pw=0 time=1801632 us)
       1367                  HASH JOIN  (cr=2533 pr=157 pw=0 time=25928 us)
         96                   TABLE ACCESS FULL RPM_PROMO_COMP_THRESH_LINK (cr=9 pr=8 pw=0 time=435 us)
       1371                   HASH JOIN  (cr=2524 pr=149 pw=0 time=24005 us)
       1371                    TABLE ACCESS FULL RPM_PROMO_COMP_THRESHOLD (cr=47 pr=0 pw=0 time=33 us)
    190227                    TABLE ACCESS FULL RPM_PROMO_COMP_DETAIL (cr=2477 pr=149 pw=0 time=87 us)
    132392                  TABLE ACCESS FULL TSL_RPM_PROMO_COMP_TPND (cr=817 pr=813 pw=0 time=337 us)
       1208                 TABLE ACCESS BY INDEX ROWID RPM_THRESHOLD_INTERVAL (cr=1210 pr=1 pw=0 time=16962 us)
       1208                  INDEX RANGE SCAN RPM_THRESHOLD_INTERVAL_I1 (cr=2 pr=1 pw=0 time=4680 us)(object id 459922)
       1208                TABLE ACCESS BY INDEX ROWID RPM_THRESHOLD (cr=1210 pr=7 pw=0 time=8397 us)
       1208                 INDEX UNIQUE SCAN PK_RPM_THRESHOLD (cr=2 pr=1 pw=0 time=3405 us)(object id 459954)
       1208               TABLE ACCESS BY INDEX ROWID RPM_PROMO_COMP (cr=2418 pr=11 pw=0 time=37425 us)
       1208                INDEX UNIQUE SCAN PK_RPM_PROMO_COMP (cr=1210 pr=4 pw=0 time=4700 us)(object id 459902)
         15              TABLE ACCESS BY INDEX ROWID RPM_PROMO (cr=2418 pr=14 pw=0 time=69147 us)
       1208               INDEX UNIQUE SCAN PK_RPM_PROMO (cr=1210 pr=4 pw=0 time=4755 us)(object id 459849)
         15             TABLE ACCESS BY INDEX ROWID RPM_PROMO_EVENT (cr=17 pr=3 pw=0 time=9808 us)
         15              INDEX UNIQUE SCAN PK_RPM_PROMO_EVENT (cr=2 pr=0 pw=0 time=55 us)(object id 459871)
         15            TABLE ACCESS BY INDEX ROWID ITEM_MASTER (cr=32 pr=11 pw=0 time=638 us)
         15             INDEX UNIQUE SCAN PK_ITEM_MASTER (cr=17 pr=7 pw=0 time=398 us)(object id 460014)
         15           INDEX UNIQUE SCAN PK_DEPS (cr=2 pr=0 pw=0 time=55 us)(object id 460063)
         15          TABLE ACCESS BY INDEX ROWID ITEM_MASTER (cr=32 pr=4 pw=0 time=284 us)
         15           INDEX UNIQUE SCAN PK_ITEM_MASTER (cr=17 pr=3 pw=0 time=179 us)(object id 460014)
         15         INDEX UNIQUE SCAN PK_DEPS (cr=2 pr=0 pw=0 time=47 us)(object id 460063)
         15        INDEX UNIQUE SCAN PK_RPM_PROMO_DEPT (cr=32 pr=8 pw=0 time=423 us)(object id 461683)
         75       TABLE ACCESS BY INDEX ROWID RPM_ZONE_FUTURE_RETAIL (cr=47 pr=12 pw=0 time=846 us)
         75        INDEX RANGE SCAN RPM_ZONE_FUTURE_RETAIL_I1 (cr=32 pr=12 pw=0 time=536 us)(object id 459917)
        364      INDEX RANGE SCAN PK_ITEM_SUPPLIER (cr=152 pr=10 pw=0 time=915 us)(object id 461283)
          0     VIEW PUSHED PREDICATE  (cr=364 pr=1 pw=0 time=4468 us)
          0      NESTED LOOPS  (cr=364 pr=1 pw=0 time=4023 us)
          0       NESTED LOOPS  (cr=364 pr=1 pw=0 time=3596 us)
          0        TABLE ACCESS BY INDEX ROWID DEAL_COMP_PROM (cr=364 pr=1 pw=0 time=2839 us)
          0         INDEX SKIP SCAN PK_DEAL_COMP_PROM (cr=364 pr=1 pw=0 time=2252 us)(object id 460586)
          0        TABLE ACCESS BY INDEX ROWID DEAL_HEAD (cr=0 pr=0 pw=0 time=0 us)
          0         INDEX UNIQUE SCAN PK_DEAL_HEAD (cr=0 pr=0 pw=0 time=0 us)(object id 460002)
          0       INDEX RANGE SCAN ITEM_SUPPLIER_I1 (cr=0 pr=0 pw=0 time=0 us)(object id 461281)
         35   SORT UNIQUE (cr=6001 pr=2611 pw=1876 time=1787923 us)
        483    TABLE ACCESS BY INDEX ROWID RPM_ZONE_FUTURE_RETAIL (cr=6001 pr=2611 pw=1876 time=1781697 us)
        579     NESTED LOOPS  (cr=5969 pr=2609 pw=1876 time=205507332 us)
         95      NESTED LOOPS  (cr=5777 pr=2600 pw=1876 time=1777879 us)
         41       NESTED LOOPS  (cr=5693 pr=2592 pw=1876 time=1778919 us)
         41        HASH JOIN  (cr=5609 pr=2573 pw=1876 time=1778377 us)
        276         TABLE ACCESS FULL DEPS (cr=5 pr=0 pw=0 time=36 us)
         41         NESTED LOOPS  (cr=5604 pr=2573 pw=1876 time=1776404 us)
         41          HASH JOIN  (cr=5520 pr=2567 pw=1876 time=1776506 us)
         41           NESTED LOOPS  (cr=5515 pr=2567 pw=1876 time=1753418 us)
         41            HASH JOIN  (cr=5431 pr=2555 pw=1876 time=1752249 us)
    132392             TABLE ACCESS FULL TSL_RPM_PROMO_COMP_TPND (cr=817 pr=0 pw=0 time=44 us)
         57             HASH JOIN  (cr=4614 pr=1820 pw=1099 time=1200744 us)
    129467              TABLE ACCESS FULL RPM_PROMO_COMP_SIMPLE (cr=1693 pr=164 pw=0 time=186 us)
      45903              HASH JOIN  (cr=2921 pr=557 pw=0 time=81106 us)
        236               HASH JOIN  (cr=444 pr=28 pw=0 time=37993 us)
        373                NESTED LOOPS OUTER (cr=413 pr=23 pw=0 time=10806 us)
        373                 HASH JOIN  (cr=40 pr=23 pw=0 time=6301 us)
        277                  TABLE ACCESS FULL RPM_PROMO_EVENT (cr=6 pr=1 pw=0 time=79 us)
        373                  TABLE ACCESS FULL RPM_PROMO (cr=34 pr=22 pw=0 time=4177 us)
          0                 VIEW PUSHED PREDICATE  (cr=373 pr=0 pw=0 time=4164 us)
          0                  NESTED LOOPS  (cr=373 pr=0 pw=0 time=3634 us)
          0                   NESTED LOOPS  (cr=373 pr=0 pw=0 time=3221 us)
          0                    TABLE ACCESS BY INDEX ROWID DEAL_COMP_PROM (cr=373 pr=0 pw=0 time=2799 us)
          0                     INDEX SKIP SCAN PK_DEAL_COMP_PROM (cr=373 pr=0 pw=0 time=2244 us)(object id 460586)
          0                    TABLE ACCESS BY INDEX ROWID DEAL_HEAD (cr=0 pr=0 pw=0 time=0 us)
          0                     INDEX UNIQUE SCAN PK_DEAL_HEAD (cr=0 pr=0 pw=0 time=0 us)(object id 460002)
          0                   INDEX RANGE SCAN ITEM_SUPPLIER_I1 (cr=0 pr=0 pw=0 time=0 us)(object id 461281)
       1452                TABLE ACCESS FULL RPM_PROMO_COMP (cr=31 pr=5 pw=0 time=8984 us)
    190227               TABLE ACCESS FULL RPM_PROMO_COMP_DETAIL (cr=2477 pr=529 pw=0 time=1525455 us)
         41            TABLE ACCESS BY INDEX ROWID ITEM_MASTER (cr=84 pr=12 pw=0 time=21811 us)
         41             INDEX UNIQUE SCAN PK_ITEM_MASTER (cr=43 pr=2 pw=0 time=500 us)(object id 460014)
        276           TABLE ACCESS FULL DEPS (cr=5 pr=0 pw=0 time=39 us)
         41          TABLE ACCESS BY INDEX ROWID ITEM_MASTER (cr=84 pr=6 pw=0 time=750 us)
         41           INDEX UNIQUE SCAN PK_ITEM_MASTER (cr=43 pr=2 pw=0 time=360 us)(object id 460014)
         41        INDEX UNIQUE SCAN PK_RPM_PROMO_DEPT (cr=84 pr=19 pw=0 time=1025 us)(object id 461683)
         95       INDEX RANGE SCAN PK_ITEM_SUPPLIER (cr=84 pr=8 pw=0 time=717 us)(object id 461283)
        483      INDEX RANGE SCAN RPM_ZONE_FUTURE_RETAIL_I1 (cr=192 pr=9 pw=0 time=1661 us)(object id 459917)
          0   SORT UNIQUE (cr=0 pr=0 pw=0 time=34 us)
          0    HASH JOIN  (cr=0 pr=0 pw=0 time=8 us)
        276     TABLE ACCESS FULL DEPS (cr=5 pr=0 pw=0 time=175 us)
          0     HASH JOIN  (cr=0 pr=0 pw=0 time=4 us)
    110442      TABLE ACCESS FULL RPM_ZONE_FUTURE_RETAIL (cr=990 pr=101 pw=0 time=108 us)
          0      HASH JOIN  (cr=0 pr=0 pw=0 time=11 us)
    126852       TABLE ACCESS FULL ITEM_MASTER (cr=5389 pr=5268 pw=0 time=1522285 us)
    8076819       HASH JOIN  (cr=1591993 pr=82513 pw=128338 time=97917982 us)
    1611192        HASH JOIN  (cr=1591176 pr=80224 pw=78099 time=57413444 us)
    1611192         HASH JOIN  (cr=1590457 pr=28794 pw=27384 time=20659952 us)
    793008          HASH JOIN  (cr=1589595 pr=1843 pw=1267 time=12259546 us)
        276           TABLE ACCESS FULL DEPS (cr=5 pr=0 pw=0 time=383 us)
    793008           NESTED LOOPS  (cr=1589590 pr=1843 pw=1267 time=10672032 us)
    793008            HASH JOIN  (cr=3572 pr=1815 pw=1267 time=2741847 us)
      43362             HASH JOIN  (cr=3426 pr=493 pw=0 time=379252 us)
        985              TABLE ACCESS FULL TSL_RPM_PROMO_MULTI_BUY_ZONE (cr=5 pr=4 pw=0 time=207 us)
      43362              HASH JOIN  (cr=3421 pr=489 pw=0 time=288896 us)
        388               HASH JOIN  (cr=2934 pr=5 pw=0 time=22834 us)
       1624                TABLE ACCESS FULL TSL_RPM_PROMO_COMP_M_B_DTL (cr=9 pr=0 pw=0 time=34 us)
        194                HASH JOIN  (cr=2925 pr=5 pw=0 time=30088 us)
        795                 TABLE ACCESS FULL TSL_RPM_PROMO_COMP_M_B (cr=4 pr=2 pw=0 time=179 us)
      45903                 HASH JOIN  (cr=2921 pr=3 pw=0 time=109197 us)
        236                  HASH JOIN  (cr=444 pr=3 pw=0 time=16642 us)
        373                   NESTED LOOPS OUTER (cr=413 pr=0 pw=0 time=7419 us)
        373                    HASH JOIN  (cr=40 pr=0 pw=0 time=2166 us)
        277                     TABLE ACCESS FULL RPM_PROMO_EVENT (cr=6 pr=0 pw=0 time=48 us)
        373                     TABLE ACCESS FULL RPM_PROMO (cr=34 pr=0 pw=0 time=414 us)
          0                    VIEW PUSHED PREDICATE  (cr=373 pr=0 pw=0 time=4519 us)
          0                     NESTED LOOPS  (cr=373 pr=0 pw=0 time=4033 us)
          0                      NESTED LOOPS  (cr=373 pr=0 pw=0 time=3611 us)
          0                       TABLE ACCESS BY INDEX ROWID DEAL_COMP_PROM (cr=373 pr=0 pw=0 time=3166 us)
          0                        INDEX SKIP SCAN PK_DEAL_COMP_PROM (cr=373 pr=0 pw=0 time=2559 us)(object id 460586)
          0                       TABLE ACCESS BY INDEX ROWID DEAL_HEAD (cr=0 pr=0 pw=0 time=0 us)
          0                        INDEX UNIQUE SCAN PK_DEAL_HEAD (cr=0 pr=0 pw=0 time=0 us)(object id 460002)
          0                      INDEX RANGE SCAN ITEM_SUPPLIER_I1 (cr=0 pr=0 pw=0 time=0 us)(object id 461281)
       1452                   TABLE ACCESS FULL RPM_PROMO_COMP (cr=31 pr=3 pw=0 time=38 us)
    190227                  TABLE ACCESS FULL RPM_PROMO_COMP_DETAIL (cr=2477 pr=0 pw=0 time=36 us)
      69561               TABLE ACCESS FULL TSL_RPM_PROMO_MB_ATTR (cr=487 pr=484 pw=0 time=361 us)
      25271             TABLE ACCESS FULL TSL_RPM_PROMO_GET_ITEM (cr=146 pr=55 pw=0 time=53 us)
    793008            TABLE ACCESS BY INDEX ROWID ITEM_MASTER (cr=1586018 pr=28 pw=0 time=7006432 us)
    793008             INDEX UNIQUE SCAN PK_ITEM_MASTER (cr=793010 pr=19 pw=0 time=3817845 us)(object id 460014)
    211165          INDEX FAST FULL SCAN PK_ITEM_SUPPLIER (cr=862 pr=834 pw=0 time=341 us)(object id 461283)
    378625         TABLE ACCESS FULL RPM_PROMO_DEPT (cr=719 pr=715 pw=0 time=333 us)
    132392        TABLE ACCESS FULL TSL_RPM_PROMO_COMP_TPND (cr=817 pr=0 pw=0 time=80 us)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       5        0.00          0.00
      db file sequential read                       627        0.51          1.69
      db file scattered read                        699        0.08          0.68
      SQL*Net more data to client                     1        0.00          0.00
      SQL*Net message from client                     4       50.64        149.95
      direct path write temp                      56227        0.32        219.45
      direct path read temp                       11746        0.01          0.69
      control file sequential read                    7        0.00          0.00
      SQL*Net break/reset to client                   2        0.00          0.00
    SQL ID:
    Plan Hash: 1248216388
    SELECT NAME NAME_COL_PLUS_SHOW_PARAM,DECODE(TYPE,1,'boolean',2,'string',3,
      'integer',4,'file',5,'number',        6,'big integer', 'unknown') TYPE,
      DISPLAY_VALUE VALUE_COL_PLUS_SHOW_PARAM
    FROM
    V$PARAMETER WHERE UPPER(NAME) LIKE UPPER('%USER_DUMP_DEST%') ORDER BY
      NAME_COL_PLUS_SHOW_PARAM,ROWNUM
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.01       0.01          0          0          0           1
    total        4      0.01       0.02          0          0          0           1
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 191
    Rows     Row Source Operation
          1  SORT ORDER BY (cr=0 pr=0 pw=0 time=15029 us)
          1   COUNT  (cr=0 pr=0 pw=0 time=15015 us)
          1    MERGE JOIN  (cr=0 pr=0 pw=0 time=15004 us)
       1495     FIXED TABLE FULL X$KSPPCV (cr=0 pr=0 pw=0 time=3021 us)
          1     FILTER  (cr=0 pr=0 pw=0 time=10994 us)
          1      SORT JOIN (cr=0 pr=0 pw=0 time=9469 us)
          1       FIXED TABLE FULL X$KSPPI (cr=0 pr=0 pw=0 time=7735 us)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2     2763.24       2763.24
    SQL ID:
    Plan Hash: 643305917
    SELECT 'Y'
    FROM
    SEC_USER_GROUP SUG WHERE SUG.USER_ID = SYS_CONTEXT('USERENV', 'SESSION_USER')
       AND EXISTS(SELECT 'x' FROM FILTER_GROUP_MERCH FGM WHERE FGM.SEC_GROUP_ID =
      SUG.GROUP_ID AND ROWNUM = 1) AND ROWNUM = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.01          1          3          0           0
    total        3      0.01       0.02          1          3          0           0
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 191     (recursive depth: 2)
    Rows     Row Source Operation
          0  COUNT STOPKEY (cr=3 pr=1 pw=0 time=12073 us)
          0   INDEX FULL SCAN PK_SEC_USER_GROUP (cr=3 pr=1 pw=0 time=12070 us)(object id 460226)
          0    COUNT STOPKEY (cr=2 pr=1 pw=0 time=12026 us)
          0     INDEX RANGE SCAN UK_FILTER_GROUP_MERCH (cr=2 pr=1 pw=0 time=12023 us)(object id 461052)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         1        0.01          0.01
    SQL ID:
    Plan Hash: 643277548
    SELECT 'Y'
    FROM
    SEC_USER_GROUP SUG WHERE SUG.USER_ID = SYS_CONTEXT('USERENV', 'SESSION_USER')
       AND (EXISTS(SELECT 'x' FROM FILTER_GROUP_ORG FGO WHERE FGO.SEC_GROUP_ID =
      SUG.GROUP_ID AND ROWNUM = 1) OR EXISTS(SELECT 'x' FROM SEC_GROUP_LOC_MATRIX
      SGLM WHERE SGLM.GROUP_ID = SUG.GROUP_ID AND ROWNUM = 1)) AND ROWNUM = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.01          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.02       0.00          2          3          0           0
    total        3      0.03       0.02          2          3          0           0
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 191     (recursive depth: 2)
    Rows     Row Source Operation
          0  COUNT STOPKEY (cr=3 pr=2 pw=0 time=8617 us)
          0   FILTER  (cr=3 pr=2 pw=0 time=8614 us)
          1    INDEX FULL SCAN PK_SEC_USER_GROUP (cr=1 pr=0 pw=0 time=39 us)(object id 460226)
          0    COUNT STOPKEY (cr=1 pr=1 pw=0 time=5403 us)
          0     INDEX RANGE SCAN PK_FILTER_GROUP_ORG (cr=1 pr=1 pw=0 time=5400 us)(object id 461061)
          0    COUNT STOPKEY (cr=1 pr=1 pw=0 time=3127 us)
          0     INDEX SKIP SCAN UK_SEC_GROUP_LOC_MATRIX (cr=1 pr=1 pw=0 time=3125 us)(object id 460888)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         2        0.00          0.00
    SQL ID:
    Plan Hash: 4011473558
    SELECT NAME NAME_COL_PLUS_SHOW_PARAM,DECODE(TYPE,1,'boolean',2,'string',3,
      'integer',4,'file',5,'number',        6,'big integer', 'unknown') TYPE,
      DISPLAY_VALUE VALUE_COL_PLUS_SHOW_PARAM
    FROM
    V$PARAMETER WHERE UPPER(NAME) LIKE UPPER('%USER_DUMP_DEST%') ORDER BY
      NAME_COL_PLUS_SHOW_PARAM,ROWNUM
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.01       0.01          0          0          0           1
    total        4      0.01       0.01          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: 191
    Rows     Row Source Operation
          1  SORT ORDER BY (cr=0 pr=0 pw=0 time=15250 us)
          1   COUNT  (cr=0 pr=0 pw=0 time=15226 us)
          1    MERGE JOIN  (cr=0 pr=0 pw=0 time=15207 us)
       1495     FIXED TABLE FULL X$KSPPCV (cr=0 pr=0 pw=0 time=3166 us)
          1     FILTER  (cr=0 pr=0 pw=0 time=11059 us)
          1      SORT JOIN (cr=0 pr=0 pw=0 time=9512 us)
          1       FIXED TABLE FULL X$KSPPI (cr=0 pr=0 pw=0 time=7741 us)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2     3143.23       3143.23
    SQL ID:
    Plan Hash: 643140929
    SELECT 'Y'
    FROM
    SEC_USER_GROUP SUG WHERE SUG.USER_ID = SYS_CONTEXT('USERENV', 'SESSION_USER')
       AND ROWNUM = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          1          1          0           1
    total        3      0.00       0.01          1          1          0           1
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 191     (recursive depth: 2)
    Rows     Row Source Operation
          1  COUNT STOPKEY (cr=1 pr=1 pw=0 time=6617 us)
          1   INDEX RANGE SCAN SEC_USER_GROUP_I1 (cr=1 pr=1 pw=0 time=6614 us)(object id 460225)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         1        0.00          0.00
    SQL ID:
    Plan Hash: 642786159
    SELECT DATA_LEVEL_SECURITY_IND, DIFF_GROUP_ORG_LEVEL_CODE,
      LOC_LIST_ORG_LEVEL_CODE, LOC_TRAIT_ORG_LEVEL_CODE, SEASON_ORG_LEVEL_CODE,
      SKULIST_ORG_LEVEL_CODE, TICKET_TYPE_ORG_LEVEL_CODE, UDA_ORG_LEVEL_CODE,
      DIFF_GROUP_MERCH_LEVEL_CODE, SEASON_MERCH_LEVEL_CODE,
      TICKET_TYPE_MERCH_LEVEL_CODE, UDA_MERCH_LEVEL_CODE, TSL_LOC_SEC_IND
    FROM
    SYSTEM_OPTIONS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          1          4          0           1
    total        3      0.01       0.01          1          4          0           1
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 191     (recursive depth: 2)
    Rows     Row Source Operation
          1  TABLE ACCESS FULL SYSTEM_OPTIONS (cr=4 pr=1 pw=0 time=6518 us)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         1        0.00          0.00
    SQL ID:
    Plan Hash: 643306006
    begin :con := FILTER_POLICY_SQL.V_ITEM_MASTER_S(:sn, :on); end;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: 191     (recursive depth: 1)
    SQL ID:
    Plan Hash: 647750573
    begin :con := FILTER_POLICY_SQL.V_ITEM_MASTER_S(:sn, :on); end;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          0           1
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: 191     (recursive depth: 1)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      4.16       4.49          0          0          0           0
    Execute      3      0.00       0.00          0          0          0           0
    Fetch        9     53.03     276.32      91547    1615664          9          50
    total       15     57.19     280.82      91547    1615664          9          50
    Misses in library cache during parse: 2
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                      10        0.00          0.00
      SQL*Net message from client                     9     3143.23       6091.69
      SQL*Net more data from client                   8        0.00          0.00
      db file sequential read                       627        0.51          1.69
      db file scattered read                        699        0.08          0.68
      SQL*Net more data to client                     1        0.00          0.00
      direct path write temp                      56227        0.32        219.45
      direct path read temp                       11746        0.01          0.69
      control file sequential read                    7        0.00          0.00
      SQL*Net break/reset to client                   2        0.00          0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       93      0.08       0.07          0          0          0           0
    Execute    579      0.12       0.14          0          0          0           2
    Fetch      930      0.06       0.51         63       2154          0        3254
    total     1602      0.26       0.73         63       2154          0        3256
    Misses in library cache during parse: 25
    Misses in library cache during execute: 21
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                        63        0.14          0.47
        9  user  SQL statements in session.
      573  internal SQL statements in session.
      582  SQL statements in session.
        0  statements EXPLAINed in this session.
    Trace file: hsctst09_ora_1671386_10046.trc
    Trace file compatibility: 11.1.0.7
    Sort options: prsela  fchela  exeela
           1  session in tracefile.
           9  user  SQL statements in trace file.
         573  internal SQL statements in trace file.
         582  SQL statements in trace file.
          36  unique SQL statements in trace file.
       81769  lines in trace file.
    17819535  elapsed seconds in trace file.Thanks in advance.

  • How to reduce the query fetch from TKPROF output?

    Hi,
    Below is my query contains the TKPROF output.Here fetch is too high. How to reduce the fetch from here. And please check the explain plan is good or not?
    SELECT  czci.config_hdr_id,
            czci.config_rev_nbr,
            asoqla.quantity,
             (SELECT
                    node_desc.LOCALIZED_STR
                 FROM   CZ_LOCALIZED_TEXTS node_desc,
                        CZ_PS_NODES ps_nodes,
                        CZ_CONFIG_ITEMS czci1
                WHERE   czci1.config_hdr_id = asoqld.config_header_id
                AND     czci1.config_rev_nbr = asoqld.config_revision_num
                AND    node_desc.INTL_TEXT_ID = ps_nodes.INTL_TEXT_ID
                AND     NVL(node_desc.LANGUAGE,userenv('LANG')) = userenv('LANG')
                AND     czci1.PS_NODE_ID = ps_nodes.PERSISTENT_NODE_ID
                 AND    ps_nodes.DEVL_PROJECT_ID = (SELECT MAX(DEVL_PROJECT_ID) FROM CZ_DEVL_PROJECTS WHERE NAME LIKE 'Control Model')
                AND czci1.PARENT_CONFIG_ITEM_ID IN (SELECT sub_sub.CONFIG_ITEM_ID FROM CZ_CONFIG_ITEMS sub_sub
                                                        WHERE sub_sub.CONFIG_HDR_ID = asoqld.config_header_id
                                                        AND sub_sub.CONFIG_REV_NBR = asoqld.config_revision_num
                                                        AND      sub_sub.PS_NODE_NAME = 'fittings')) fitting_material,
             (SELECT
                    node_desc.LOCALIZED_STR
                 FROM   CZ_LOCALIZED_TEXTS node_desc,
                        CZ_PS_NODES ps_nodes,
                        CZ_CONFIG_ITEMS czci
                WHERE   czci.config_hdr_id = asoqld.config_header_id
                AND     czci.config_rev_nbr = asoqld.config_revision_num
                AND    node_desc.INTL_TEXT_ID = ps_nodes.INTL_TEXT_ID
                AND NVL(node_desc.LANGUAGE,userenv('LANG')) = userenv('LANG')
                AND     czci.PS_NODE_ID = ps_nodes.PERSISTENT_NODE_ID
                 AND    ps_nodes.DEVL_PROJECT_ID = (SELECT MAX(DEVL_PROJECT_ID) FROM CZ_DEVL_PROJECTS WHERE NAME LIKE 'Control Model')
                AND czci.PARENT_CONFIG_ITEM_ID IN (SELECT sub_sub.CONFIG_ITEM_ID FROM CZ_CONFIG_ITEMS sub_sub
                                                        WHERE sub_sub.CONFIG_HDR_ID = czci.CONFIG_HDR_ID
                                                        AND sub_sub.CONFIG_REV_NBR = czci.CONFIG_REV_NBR
                                                        AND      sub_sub.PS_NODE_NAME = 'tubing')) tubing_material
    FROM    aso_quote_lines_all asoqla,
            aso_quote_line_details asoqld,
            cz_config_items czci
    WHERE   asoqla.quote_header_id = 55774
    AND     asoqla.item_type_code = 'MDL'
    --AND     asoqla.org_id = 2763
    AND     asoqla.quote_line_id = asoqld.quote_line_id
    AND     asoqld.config_header_id = czci.config_hdr_id
    AND     asoqld.config_revision_num = czci.config_rev_nbr
    AND     czci.ps_node_name = 'CONTROL MASTER ASLY'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.04       0.03          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        3      0.09       0.08          0       5100          0          19
    total        5      0.13       0.12          0       5100          0          19
    Misses in library cache during parse: 1
    Optimizer goal: ALL_ROWS
    Parsing user id: 173  (APPS)
    Rows     Row Source Operation
          3  TABLE ACCESS BY INDEX ROWID CZ_LOCALIZED_TEXTS (cr=2161 pr=0 pw=0 time=32425 us)
         40   NESTED LOOPS  (cr=2158 pr=0 pw=0 time=32276 us)
          3    NESTED LOOPS  (cr=2147 pr=0 pw=0 time=32156 us)
          3     NESTED LOOPS  (cr=925 pr=0 pw=0 time=15885 us)
          3      TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=665 pr=0 pw=0 time=13456 us)
       5490       INDEX RANGE SCAN CZ_CONFIG_ITEMS_PK (cr=96 pr=0 pw=0 time=1237 us)(object id 3049621)
          3      TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=260 pr=0 pw=0 time=2401 us)
       1094       INDEX RANGE SCAN CZ_CONFIG_ITEMS_PK (cr=19 pr=0 pw=0 time=250 us)(object id 3049621)
          3     TABLE ACCESS BY INDEX ROWID CZ_PS_NODES (cr=1222 pr=0 pw=0 time=16249 us)
          3      INDEX RANGE SCAN CZ_PS_NODES_N12 (cr=1219 pr=0 pw=0 time=16211 us)(object id 750095)
          1       SORT AGGREGATE (cr=1211 pr=0 pw=0 time=16125 us)
        209        TABLE ACCESS FULL CZ_DEVL_PROJECTS (cr=1211 pr=0 pw=0 time=15883 us)
         18    INDEX RANGE SCAN CZ_LOCALIZED_TEXTS_N1 (cr=11 pr=0 pw=0 time=68 us)(object id 31504)
          3  TABLE ACCESS BY INDEX ROWID CZ_LOCALIZED_TEXTS (cr=2161 pr=0 pw=0 time=31499 us)
         40   NESTED LOOPS  (cr=2158 pr=0 pw=0 time=31351 us)
          3    NESTED LOOPS  (cr=2147 pr=0 pw=0 time=31215 us)
          3     NESTED LOOPS  (cr=925 pr=0 pw=0 time=15271 us)
          3      TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=665 pr=0 pw=0 time=12441 us)
       5490       INDEX RANGE SCAN CZ_CONFIG_ITEMS_PK (cr=96 pr=0 pw=0 time=1230 us)(object id 3049621)
          3      TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=260 pr=0 pw=0 time=2795 us)
       1094       INDEX RANGE SCAN CZ_CONFIG_ITEMS_PK (cr=19 pr=0 pw=0 time=264 us)(object id 3049621)
          3     TABLE ACCESS BY INDEX ROWID CZ_PS_NODES (cr=1222 pr=0 pw=0 time=15920 us)
          3      INDEX RANGE SCAN CZ_PS_NODES_N12 (cr=1219 pr=0 pw=0 time=15863 us)(object id 750095)
          1       SORT AGGREGATE (cr=1211 pr=0 pw=0 time=15753 us)
        209        TABLE ACCESS FULL CZ_DEVL_PROJECTS (cr=1211 pr=0 pw=0 time=15452 us)
         18    INDEX RANGE SCAN CZ_LOCALIZED_TEXTS_N1 (cr=11 pr=0 pw=0 time=79 us)(object id 31504)
         19  TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=778 pr=0 pw=0 time=20571 us)
       5816   NESTED LOOPS  (cr=202 pr=0 pw=0 time=8497 us)
         21    NESTED LOOPS  (cr=96 pr=0 pw=0 time=2037 us)
         23     TABLE ACCESS BY INDEX ROWID ASO_QUOTE_LINES_ALL (cr=47 pr=0 pw=0 time=1427 us)
       1058      INDEX RANGE SCAN ASO_QUOTE_LINES_ALL_N1 (cr=9 pr=0 pw=0 time=51 us)(object id 81688)
         21     TABLE ACCESS BY INDEX ROWID ASO_QUOTE_LINE_DETAILS (cr=49 pr=0 pw=0 time=596 us)
         21      INDEX RANGE SCAN ASO_QUOTE_LINE_DETAILS_N1 (cr=28 pr=0 pw=0 time=323 us)(object id 81706)
       5794    INDEX RANGE SCAN CZ_CONFIG_ITEMS_PK (cr=106 pr=0 pw=0 time=1424 us)(object id 3049621)

    Hi
    After affed the exist operator i got below output. But it is more than that the previous one.
    SELECT czci.config_hdr_id, czci.config_rev_nbr, asoqla.quantity,
           (SELECT node_desc.localized_str
              FROM cz_localized_texts node_desc,
                   cz_ps_nodes ps_nodes,
                   cz_config_items czci1
             WHERE czci1.config_hdr_id = asoqld.config_header_id
               AND czci1.config_rev_nbr = asoqld.config_revision_num
               AND node_desc.intl_text_id = ps_nodes.intl_text_id
               AND NVL (node_desc.LANGUAGE, USERENV ('LANG')) = USERENV ('LANG')
               AND czci1.ps_node_id = ps_nodes.persistent_node_id
               AND ps_nodes.devl_project_id = (SELECT MAX (devl_project_id)
                                                 FROM cz_devl_projects
                                                WHERE NAME = 'Control Model')
               AND EXISTS (
                      SELECT NULL
                        FROM cz_config_items sub_sub
                       WHERE sub_sub.config_hdr_id = asoqld.config_header_id
                         AND sub_sub.config_rev_nbr = asoqld.config_revision_num
                         AND sub_sub.ps_node_name = 'fittings'
                         AND czci1.parent_config_item_id = sub_sub.config_item_id))
                                                                 fitting_material,
           (SELECT node_desc.localized_str
              FROM cz_localized_texts node_desc,
                   cz_ps_nodes ps_nodes,
                   cz_config_items czci1
             WHERE czci1.config_hdr_id = asoqld.config_header_id
               AND czci1.config_rev_nbr = asoqld.config_revision_num
               AND node_desc.intl_text_id = ps_nodes.intl_text_id
               AND node_desc.LANGUAGE = USERENV ('LANG')
               AND czci1.ps_node_id = ps_nodes.persistent_node_id
               AND ps_nodes.devl_project_id = (SELECT MAX (devl_project_id)
                                                 FROM cz_devl_projects
                                                WHERE NAME = 'Control Model')
               AND EXISTS (
                      SELECT NULL
                        FROM cz_config_items sub_sub
                       WHERE sub_sub.config_hdr_id = czci.config_hdr_id
                         AND sub_sub.config_rev_nbr = czci.config_rev_nbr
                         AND sub_sub.ps_node_name = 'tubing'
                         AND czci1.parent_config_item_id = sub_sub.config_item_id))
                                                                  tubing_material
      FROM aso_quote_lines_all asoqla,
           aso_quote_line_details asoqld,
           cz_config_items czci
    WHERE asoqla.quote_header_id = 55774
       AND asoqla.item_type_code = 'MDL'
    --AND     asoqla.org_id = 2763
       AND asoqla.quote_line_id = asoqld.quote_line_id
       AND asoqld.config_header_id = czci.config_hdr_id
       AND asoqld.config_revision_num = czci.config_rev_nbr
       AND czci.ps_node_name = 'CONTROL MASTER ASLY'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.02       0.03          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        3      0.16       0.14          0      16526          0          19
    total        5      0.18       0.17          0      16526          0          19
    Misses in library cache during parse: 1
    Optimizer goal: ALL_ROWS
    Parsing user id: 173  (APPS)
    Rows     Row Source Operation
          3  TABLE ACCESS BY INDEX ROWID CZ_LOCALIZED_TEXTS (cr=7874 pr=0 pw=0 time=51192 us)
         40   NESTED LOOPS  (cr=7871 pr=0 pw=0 time=50953 us)
          3    NESTED LOOPS  (cr=7860 pr=0 pw=0 time=50729 us)
          3     TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=6638 pr=0 pw=0 time=33183 us)
          3      INDEX RANGE SCAN CZ_CONFIG_ITEMS_N1 (cr=6635 pr=0 pw=0 time=33060 us)(object id 31734)
          3       TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=6536 pr=0 pw=0 time=22873 us)
       1292        INDEX UNIQUE SCAN CZ_CONFIG_ITEMS_PK (cr=5244 pr=0 pw=0 time=15326 us)(object id 3049621)
          3     TABLE ACCESS BY INDEX ROWID CZ_PS_NODES (cr=1222 pr=0 pw=0 time=17483 us)
          3      INDEX RANGE SCAN CZ_PS_NODES_N12 (cr=1219 pr=0 pw=0 time=17411 us)(object id 750095)
          1       SORT AGGREGATE (cr=1211 pr=0 pw=0 time=17266 us)
        209        TABLE ACCESS FULL CZ_DEVL_PROJECTS (cr=1211 pr=0 pw=0 time=16844 us)
         18    INDEX RANGE SCAN CZ_LOCALIZED_TEXTS_N1 (cr=11 pr=0 pw=0 time=122 us)(object id 31504)
          3  NESTED LOOPS  (cr=7874 pr=0 pw=0 time=48203 us)
          3   NESTED LOOPS  (cr=7860 pr=0 pw=0 time=47973 us)
          3    TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=6638 pr=0 pw=0 time=30352 us)
          3     INDEX RANGE SCAN CZ_CONFIG_ITEMS_N1 (cr=6635 pr=0 pw=0 time=30218 us)(object id 31734)
          3      TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=6536 pr=0 pw=0 time=20960 us)
       1292       INDEX UNIQUE SCAN CZ_CONFIG_ITEMS_PK (cr=5244 pr=0 pw=0 time=14224 us)(object id 3049621)
          3    TABLE ACCESS BY INDEX ROWID CZ_PS_NODES (cr=1222 pr=0 pw=0 time=17570 us)
          3     INDEX RANGE SCAN CZ_PS_NODES_N12 (cr=1219 pr=0 pw=0 time=17510 us)(object id 750095)
          1      SORT AGGREGATE (cr=1211 pr=0 pw=0 time=17395 us)
        209       TABLE ACCESS FULL CZ_DEVL_PROJECTS (cr=1211 pr=0 pw=0 time=16937 us)
          3   TABLE ACCESS BY INDEX ROWID CZ_LOCALIZED_TEXTS (cr=14 pr=0 pw=0 time=165 us)
          3    INDEX UNIQUE SCAN CZ_LOCALIZED_TEXTS_PK (cr=11 pr=0 pw=0 time=132 us)(object id 3050530)
         19  TABLE ACCESS BY INDEX ROWID CZ_CONFIG_ITEMS (cr=778 pr=0 pw=0 time=41677 us)
       5816   NESTED LOOPS  (cr=202 pr=0 pw=0 time=16173 us)
         21    NESTED LOOPS  (cr=96 pr=0 pw=0 time=3617 us)
         23     TABLE ACCESS BY INDEX ROWID ASO_QUOTE_LINES_ALL (cr=47 pr=0 pw=0 time=2528 us)
       1058      INDEX RANGE SCAN ASO_QUOTE_LINES_ALL_N1 (cr=9 pr=0 pw=0 time=83 us)(object id 81688)
         21     TABLE ACCESS BY INDEX ROWID ASO_QUOTE_LINE_DETAILS (cr=49 pr=0 pw=0 time=1053 us)
         21      INDEX RANGE SCAN ASO_QUOTE_LINE_DETAILS_N1 (cr=28 pr=0 pw=0 time=598 us)(object id 81706)
       5794    INDEX RANGE SCAN CZ_CONFIG_ITEMS_PK (cr=106 pr=0 pw=0 time=8245 us)(object id 3049621)

  • How to use Oracle refcursor dataset output parameter from SP

    Can I request for help on how to use Oracle Output parameter from a stored procedure as a source. I need the output tobe stored in a flat file
    Thanks
    Abhijit
    Message was edited by:
    Abhijit77

    yes I would like to use it for ODI.. I would like the ouput of the refcursor to be fed to a text file using ODI. How to handle the records returned by the refcursor and map with txt file.

  • Pass output parameter from mapping to external process in a Process Flow

    In Process flow, how do we pass an Output parameter from a mapping (generated by a post mapping operator) into an external process (shell script)?
    I have a mapping that generates an output parameter and I would like to pass this parameter to an external process (a shell script) with a process flow. Is this possible?

    Hi Norman,
    Unfortunately in the current release, you cannot do this. What you can do, is store the value into a table and read it in the external process, or write it into a file and read it from there. The next release will support passing output parameters from one activity to the next.
    Thanks,
    Mark.

  • Abnormal high "query" count in customer tkprof output

    We have a performance problem with one of our customer.
    A query is made on a 12K rows table, and there is no full scan, the index is used.
    If we run the query on our test database, which is identical, and examine the tkprof output, things appears normal:
    Fetch=80, cpu=0.0, disk=0, query=15738,rows=782
    But the same query, on and identical table, same index at our customer:
    Fetch=831, cpu=4.75, disk=141, query=550564, rows=830
    I dont unerstand what is the "query" parameter, the number of cache buffers read in memory ?
    It is unbeleivebly high, further more, hard to understand high number of rows in the execution plan:
    Ours
    1570 TABLE ACCESS BY INDEX ROWID MY_SECRET_TABLE_NAME
    1570 INDEX RANGE SCAN MY_PRIMARY_KEY_INDEX
    Customers:
    88413 TABLE ACCESS BY INDEX ROWID MY_SECRET_TABLE_NAME
    92917 INDEX RANGE SCAN MY_PRIMARY_KEY_INDEX
    We dont understand such high numbers. On theory, from our former DBA, was that our indexes where not create properly. A unique key index was create, then a primary constraint with the same name, was added to the table. Apparently we should have created only the constraint, and not the second index.
    Any help appreciated.

    Hi Guy,
    Query = db block gets + consistent gets.
    Consistent gets are the block reads you need to reconstruct a read-consistent image of the data.
    If you can't fetch all records at a time, you will get multiple fetches. At each fetch Oracle will issue consistent gets, as it needs to provide to you the data in the state when you started the query.
    Looking at your statistics, it is quite clear what happened.
    Fetch=80, cpu=0.0, disk=0, query=15738,rows=782
    782 rows in 80 fetches. Roughly 10 rows per fetch.
    But the same query, on an identical table, same index at our customer:
    Fetch=831, cpu=4.75, disk=141, query=550564, rows=830
    830 rows in 830 fetches (the last fetch is to check there is no more data), which means 1 row per fetch.
    In both cases: consistent gets at every fetch.
    Somehow your client has made sure, by means of a setting, he will fetch only 1 row at a time. And that is killing him.
    Nothing wrong with any index.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • ABAP program to take input parameter from variant, execute KSB1 and export

    Hi Friends,
    My client asking  change request in CO
    The Change request is "ABAP program to take input parameter from variant, execute KSB1 and export the output into an excel sheet and park the document in a designated location"
    Pls let me know  actually i am a FICO consultant what i can do in this change request
    Thanks,
    Santi

    Hi
    First I dont you would need to create a ABAP to generate the report in Excel.
    You can look at this option. Execute the report Go to->Change Layout, Click on the view option, On the Preferred View Select Microsoft Excel, Save the layout, provide a layout name with /XYZ.
    Now when you want to execute KSB1 with excel, just execute KSB1 with /XYZ layout, it would open in Excel, export to which ever location you want.
    Or just simply save the report as Excel using the Excel button on the tool bar.
    Regards,
    Suraj

  • Ellapsed time too much in tkprof output

    Hi All,
    I don't know exactly how to interprete Tkprof output file but i have a problem of performance inserting data to my one table, it takes around 1min but before it was 10 secs. i trace the program and analyze the output from tkprof and i get the following portion:
    insert /*+ APPEND +*/ into T_NAME(COL1,  COL2, COL3, .....)
    values
    (:s1 ,:s2 ,:s3 ,:s4 ,:s5 ,:s6 ,:s7 ,:s8 ,:s9 ,:s10 ,:s11 ,:s12 ,:s13 ,:s14 ,
    :s15 ,:s16 ,:s17 ,:s18 ,:s19 ,:s20 ,:s21 ,:s22 ,:s23 ,:s24 ,:s25 ,:s26 ,
    :s27 ,:s28 ,:s29 ,:s30 ,:s31 ,:s32 ,:s33 ,:s34 ,:s35 ,:s36 ,:s37 ,:s38 ,
    :s39 ,:s40 ,:s41 ,:s42 ,:s43 ,:s44 ,:s45 ,:s46 ,:s47 ,:s48 ,:s49 ,:s50 ,
    :s51 ,:s52 ,:s53 ,:s54 ,:s55 ,:s56 ,:s57 ,:s58 ,:s59 ,:s60 ,:s61 ,:s62 ,
    :s63 ,:s64 ,:s65 ,:s66 ,:s67 ,:s68 )
    call count cpu elapsed disk query current rows
    Parse 2 0.00 0.00 0 0 0 0
    Execute 3 2.94 292.24 12144 1501 57125 4728
    Fetch 0 0.00 0.00 0 0 0 0
    total 5 2.94 292.24 12144 1501 57125 4728
    Misses in library cache during parse: 2
    Misses in library cache during execute: 3
    Optimizer mode: ALL_ROWS
    Parsing user id: 103 (USERNAME)
    Rows Execution Plan
    0 INSERT STATEMENT MODE: ALL_ROWS
    When interpreting this, i got huge value on Ellapsed, disk column during execution:
    The command was exectued 3 times and it was taking 292 secs means 97 secs per execution. I thought it was making my insert problem slow.
    So if i'm not wrong how to avaoid this insertion problem, how to reduce this time of ellapsed.
    What is the problem causing table insertion slow.
    Please help because it is affecting our business
    Thanks for your help
    Raitsarevo

    raitsarevo wrote:
    Hi,
    Gathering statistics will affect performance or not. I mean when i gather statistics of my table now, will this affect operation in this table during execution, the table will be locked or not, indexes will be also or not. Can users work in the table during stat gathering.
    Can anybody give me script to gather stats for partitionned table please.
    Gathering statistics is a good idea in general but it's very unlikely that will help in your particular case. The data needs to be inserted into the table and indexes need to be maintained, this in independent from any statistics. Still it's a good idea in general to refresh statistics if e.g. bulk inserts increased the size and number of rows significantly.
    Have you followed up the advices already given so far regarding further checks and running your statement with tracing enabled at a higher level?
    You can enable this using the following instead of using sql_trace = true:
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';and switch it off like that:
    ALTER SESSION SET EVENTS '10046 trace name context off';For more information regarding this, e.g. enabling trace in another session, see e.g. here:
    http://www.juliandyke.com/Diagnostics/Trace/EnablingTrace.html
    raitsarevo wrote:
    Hi guys,
    Reading an output fromENterprise manager, i found that this insert statement is consuming to much "db file sequential read ". I know that is causing wait event. So my question is how to reduce this consumption.
    Thanks
    Raitsarevo.That's very likely caused by the required index maintenance and there is not much you can do about it apart from dropping the indexes. As already mentioned by Jonathan you might hits bugs of the ASSM space management, therefore it would also be good to know if the tablespace the object resides in uses ASSM or not (check the columns EXTENT_MANAGEMENT, ALLOCATION_TYPE, SEGMENT_SPACE_MANAGEMENT of DBA_TABLESPACES).
    Try to generate the extended trace as advised and post the tkprof output here.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Explain Plan from TKPROF trace file.

    Hello,
    My procedure is taking time for that i have trace on in procedure fo find explain plan of particular query.
    Using below statement Trace is on.
       EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE = TRUE';
       EXECUTE IMMEDIATE 'ALTER SESSION SET TIMED_STATISTICS = TRUE';Now for getting expalin plan from TKPROF i have used below statement but for some query i have found explain paln and some case i cant found explain plan.
    tkprof mf_ora_23773.trc mf_ora_23773.txt explain =abc/abc
    can u please help me to analyze where i m wrong?
    Thanks.

    First of all, you should best avoid using the explain= clause on the tkprof command line.
    This will run explain plan on the statement in the trace file, and that explain plan can even be wrong, as there is no information on datatypes in the trace file.
    The real explain plan data is flushed to the trace file, when the program issues commit or rollback. Oracle always issues an implicit commit when the program disconnects, so when you run the program to completion you should have explain plan output in your trace files.
    You won't get explain plan output if you don't have access to the objects in the SQL statement. Also recursive SQL won't produce explain plan result.
    One would need to see part of your trace file to verify your assertion the explain clause doesn't always work.
    Sybrand Bakker
    Senior Oracle DBA

  • How to fetch the data into one out parameter from two different queries

    Hi,
    I have an a problem how to implement condition in above procedure,and scenario is
    i have to get the output into one out parameter from two queries.i.e if one query data is null
    then i have to pick out data from another query into same out parameter.
    CREATE OR REPLACE PROCEDURE GET_POLICIESMAP_BASEDON_GHPLID(I_COMPANYID IN NUMBER,
    I_CARDID IN VARCHAR2,
    PR_RESULTSET OUT SYS_REFCURSOR) IS
    /* LOC_INSUREDID VARCHAR2(200);
    LOC_RELATIONCODE VARCHAR2(200);
    LOC_CURRENTPOLICYID VARCHAR2(4000);*/
    BEGIN
    OPEN PR_RESULTSET FOR
    WITH A AS
    (SELECT DISTINCT PM.MAINPOLICYID MAINPOLICYID,
    id INSUREDID,
    RELATIONCODE,
    CURRENTPOLICYID
    from INSUREDPERSONS IP
    LEFT OUTER JOIN POLICIES_RULES_MAPPING PM
    ON PM.POLICYID = IP.Currentpolicyid
    where EIN IN (SELECT EIN
    FROM INSUREDPERSONS ipp
    JOIN VW_INSUREDINFO vw
    ON IPP.ID = vw.insuredid
    and vw.cardid = I_CARDID)
    AND IP.CURRENTPOLICYID in
    (SELECT ID
    from policies
    where companyid = I_COMPANYID
    and dead = 0
    AND POLICYTO > SYSDATE - 1))
    SELECT INSUREDID, RELATIONCODE, CURRENTPOLICYID
    FROM A
    WHERE RELATIONCODE = 0
    AND (A.MAINPOLICYID is null or
    RELATIONCODE = 0 AND CURRENTPOLICYID = MAINPOLICYID)
    UNION
    SELECT INSUREDID, RELATIONCODE, CURRENTPOLICYID
    FROM A
    WHERE RELATIONCODE > 0;
    /* HERE I NEED TO GET THE DATA FROM THIS BELOW QUERY INTO SAME OUT PARAMETER
    WHEN ABOVE QUERY DATA CONTAINS NULLS */
    /* IF PR_RESULTSET IS NULL THEN*/
    OPEN PR_RESULTSET FOR
    WITH A AS
    (SELECT DISTINCT PM.MAINPOLICYID MAINPOLICYID,
    id INSUREDID,
    RELATIONCODE,
    CURRENTPOLICYID
    from INSUREDPERSONS IP
    LEFT OUTER JOIN POLICIES_RULES_MAPPING PM
    ON PM.POLICYID = IP.Currentpolicyid
    where FAMILYID IN (SELECT FAMILYID
    FROM INSUREDPERSONS ipp
    JOIN VW_INSUREDINFO vw
    ON IPP.ID = vw.insuredid
    and vw.cardid = I_CARDID)
    AND IP.CURRENTPOLICYID in
    (SELECT ID
    from policies
    where companyid = I_COMPANYID
    and dead = 0
    AND POLICYTO > SYSDATE - 1))
    SELECT INSUREDID, RELATIONCODE, CURRENTPOLICYID
    FROM A
    WHERE RELATIONCODE = 0
    AND (A.MAINPOLICYID is null or
    RELATIONCODE = 0 AND CURRENTPOLICYID = MAINPOLICYID)
    UNION
    SELECT INSUREDID, RELATIONCODE, CURRENTPOLICYID
    FROM A
    WHERE RELATIONCODE > 0;
    /* END IF;*/
    END GET_POLICIESMAP_BASEDON_GHPLID;
    Thanks in Advance,
    vvr.

    SELECT DISTINCT PM.MAINPOLICYID MAINPOLICYID,
                           id              INSUREDID,
                           RELATIONCODE,
                           CURRENTPOLICYID
             from INSUREDPERSONS IP
             LEFT OUTER JOIN POLICIES_RULES_MAPPING PM
               ON PM.POLICYID = IP.Currentpolicyid
            where EIN IN (SELECT EIN
                            FROM INSUREDPERSONS ipp
                            JOIN VW_INSUREDINFO vw
                              ON IPP.ID = vw.insuredid
                             and vw.cardid = I_CARDID)In this code
    where EINEIN is a column in INSUREDPERSONS?
    and in the sub query below
    (SELECT EIN
                            FROM INSUREDPERSONS ipp
                            JOIN VW_INSUREDINFO vw
                              ON IPP.ID = vw.insuredid
                             and vw.cardid = I_CARDID)EIN belongs to INSUREDPERSONS or VW_INSUREDINFO?
    Please use Alias as we dont know your table structure.

  • Display tag: how to get pagesize parameter from TableDecorator?

    Hi all,
    I'm designing�org.displaytag.decorator.TableDecorator wrapper for our project, but I need to get pagesizeparameter from TableDecorator and I don't know - how to do it :(
    Any ideas?
    ps. http://www.displaytag.org used

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • Can you fix your help project (via coding) after importing a topic from an output file by mistake?

    Yes - I admit it - I imported html topic files from an output folder of another RH project into the help project I am currently working on (the source files were lost and I needed to bring over a lot of legacy content in a hurry). However, I completely forget that the RH output html file contains unique Java scripting that is used to render the topic properly in a browser, but that same Java Script causes havoc when you open it up in as a source file in another RH Project. Needless to say, it has caused numerous weird things when I went to publish and view my files (but, surprisingly, you don’t really see or notice them in the RH Design WYSIWYG view or preview mode).
    The bad news is that it took about 2 weeks for me to notice the issue (the help output is viewed on a special console running Linux with a QT browser that I only view occasionally). The good news is that is that I figured out what the problem was (that took some hours) and I can restore my help project back to a time before I did the "naughty deed".
    I am now at a crossroads - do I:
    Try to re-enter all of my content from the last two weeks? (Actually, to avoid repeating the same mistake twice, I will need to re-enter the text manually and NOT cut and paste from the RH output files!)
    Or locate and find the offending HTML coding in my topic files (if that is even possible)? Has anybody documented what the RH output file JavaScript code injects into your files, and what files they affect?

    OK - here is the documentation of this weird issue (hopefully, you can read the htlm code in the screen images):
    1. In this topic, I cut and pasted some text into the table you see at the bottom of the screen. I had to reapply the “TableBody” style to this text. After doing this, I moved my cursor to the “Keyboard" text on top. Notice that it is displaying the "TABLEBODY" style, although visually, it is displaying the correct style on screen (“Heading 1”).  
    2.     In HTML view, notice the addition of the class= “TableBody”> code for this “Keyboard” text.
    3.   I then reselected Heading 1 for this “Keyboard” text.
    4.   Notice that the class= “TableBody”> code is now removed for this “Keyboard” text and has just the proper <h1> tagged assigned.

  • Passing a parameter from one class to another class in the same package

    Hi.
    I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
    i. BugWatcherAction.java
    ii.BugWatcherRefreshAction.Java.
    We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
    So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
    ==============================================================
    public Object loadContent() throws Exception {
    Hashtable htStore = new Hashtable();
    JetspeedRunData rundata = this.getInputData();
    String pId = this.getPorletId();
    PortalLogger.logDebug(" in the portlet content: "+pId);
    pId1=pId;//done by sraha
    htStore.put("PortletId", pId);
    htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
    htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
    HttpServletRequest request = rundata.getRequest();
    PortalLogger.logDebug(
    "BugWatcherPortletContent:: build normal context");
    HttpSession session = null;
    int bugProfileId = 0;
    Hashtable bugProfiles = null;
    Hashtable bugData = null;
    boolean fetchProfiles = false;
    try {
    session = request.getSession(true);
    // Attempting to get the profiles from the session.
    //If the profiles are not present in the session, then they would have to be
    // obtained from the database.
    bugProfiles = (Hashtable) session.getAttribute("Profiles");
    //Getting the selected bug profile id.
    String bugProfileIdObj = request.getParameter("bugProfile" + pId);
    // Getting the logged in user
    String userId = request.getRemoteUser();
    if (bugProfiles == null) {
    fetchProfiles = true;
    if (bugProfileIdObj == null) {
    // setting the bugprofile id as -1 indicates "all profiles" is selected
    bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
    if (bugProfileIdObj == null) {
    bugProfileId = -1;
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    session.setAttribute(
    ("bugProfileId" + pId),
    Integer.toString(bugProfileId));
    //fetching the bug list
    bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
    PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
    if (bugData != null) {
    Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
    } else {
    htStore.put("NoProfiles", "Y");
    } catch (CodedPortalException e) {
    htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    PortalLogger.logException
    ("BugWatcherPortletContent:: CodedPortalException!!",e);
    } catch (Exception e) {
    PortalLogger.logException(
    "BugWatcherPortletContent::Generic Exception!!",e);
    htStore.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
    if (fetchProfiles) {
    bugProfiles = (Hashtable) bugData.get("Profiles");
    session.setAttribute("Profiles", bugProfiles);
    // putting the stuff in the context
    htStore.put("Profiles", bugProfiles);
    htStore.put("SelectedProfile", new Integer(bugProfileId));
    htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
    return htStore;
    =============================================================
    And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
    In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
    =============================================================
    public void doPerform(RunData rundata, Context context,String str) throws Exception {
    JetspeedRunData data = (JetspeedRunData) rundata;
    HttpServletRequest request = null;
    //PortletConfig pc = portlet.getPortletConfig();
    //String userId = request.getRemoteUser();
    /*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
    String pId = request.getParameter("PortletId");
    PortalLogger.logDebug("just after pId " +pId);  */
    //Calling the variable holding the value of portlet id from BugWatcherAction.java
    //We are getting the portlet id here , through a variable from BugWatcherAction.java
    /*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
    String portletID = bgAct.pId1;
    PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
    // updating the bug groups
    Hashtable result = new Hashtable();
    try {
    request = data.getRequest();
    String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
    //String pId = (String)request.getParameter("portletId");
    //String pId = pc.getPorletId();
    PortalLogger.logDebug("just after pId " +pId);
    PortalLogger.logDebug("after getting the pId-----sraha");
    result =BugWatcherAPI.getbugList(profileId, userId);
    PortalLogger.logDebug("select the new bug groups:: select is done ");
    context.put("SelectedbugGroups", profileId);
    //start clearing the cache
    ContentCacheContext cacheContext = getCacheContext(rundata);
    PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
    // remove the markup content from cache.
    PortletContentCache.removeContent(cacheContext);
    PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
    //remove the backend content from cache
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
    PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
    PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
    if (pdata != null)
    // User's data found in cache!
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
    pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
    PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
    //end clearing the cache
    // after clearing the caching calling the data from the database taking a fn from the portletContent.java
    PortalLogger.logDebug("after clearing cache---sraha");
    BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
    Hashtable httable= new Hashtable();
    httable=(Hashtable)bugwatchportcont.loadContent();
    PortalLogger.logDebug("after making the type casting-----sraha");
    Set storeKeySet = httable.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, httable.get(paramName));
    PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
    } catch (CodedPortalException e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    catch (Exception e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
    try {
    ((JetspeedRunData) data).setCustomized(null);
    if (((JetspeedRunData) data).getCustomized() == null)
    ActionLoader.getInstance().exec(data,"controls.EndCustomize");
    catch (Exception e)
    PortalLogger.logException("bugwatcherRefreshAction", e);
    ===============================================================
    In the bugwatcher Action there is another function called PostLoadContent.java
    here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
    ================================================
    // Get the PortletData object from intermediate store.
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
    //rundata.getRequest().getRemoteUser()));
    ((JetspeedUser)rundata.getUser()).getUserName()));
    pId1 = (String)portlet.getID();
    PortalLogger.logDebug("in the bugwatcher action:"+pId1);
    try {
    Hashtable htStore = null;
    // if PortletData is available in store, get current portlet's data from it.
    if (pdata != null) {
    htStore =(Hashtable) pdata.getObject(     PortletCacheHelper.getUserPortletHandle(
    ((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
    //Loop through the hashtable and put its elements in context
    Set storeKeySet = htStore.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, htStore.get(paramName));
    bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
    bRefAc.doPerform(pdata,context,pId1);
    =============================================================
    So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
    I am unable to implement that thing.
    If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
    Please let me know as early as possible.
    Thanks and regards,
    Santanu Raha.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • How to pass a parameter from one action1 in block1 to action2 in block2.

    Dear Experts,
    How to pass a parameter from one action1 in block1 to action2 in block2.
    My Process Structure is as follows..
           Process
                Sequential Block
                     Action 1
                     Parallel Dynamic Block
                             Sequential Sub Block
                             Action 2.
    while i am  trying to execute the action1 the following error is shown below:
    Cannot complete action: The activity could not be read.
    Please suggest me how to do?
    Regards,
    Rajesh N

    Hello Rajesh!
    I think you are talk about the mapping parameters of your process.
    This case in design time of your workflow, you have the vision of your blocks and actions, you have on action 1 the output parameter and you have the action 2 an input parameter.
    So you have that make a group mapping on your process, map in this group the action1 outpu parameter with the action2 input parameter.
    Regards, Ronaldo Rampelotti

  • HT3775 I NEED I TUNES FOR A 64 BIT PC. OPERATING SYSTEM IS WINDOWS 8, NON TOUCH SCREEN. WHICH IS THE ABSOLUTELY BEST WAY TO GET ITUNES OPERATING CORRECTLY ON MY PC????//I HAVE TRIED SEVERAL THINGS, NONE OF WHICH ARE WORKING. IS ITUNES DELIBERATELY EXCLUDI

    I cannot get itunes to work/install on myPC. I am running windows 8 in a 64 bit machine. I also want to purchase books via itunes for my Nook. Are you deliberately excluding PC owners so we cannot use ituens on our computers???? I have selected a community but have no idea what community I should be working with. Can somone explai these communities to me? Also. you don't allow much time to go thru the sign up process. I had to start over SEVERAL times as you kept timing me out. Jesus...when people are signing up for the first time, we have no idea of the questions that will be asked. Give us a break and give us time to sign up. Not everone is disability free and able to go thru your process quickly...you are NOT user friendly. You should be for people who are wanting to join your community. I used to want an Apple product but now that  I have had first hand experience with your web page, I think I will probably stay away from Apple products. VERY DISAPPOINTING

    Jan 11, 2014 10:26 AM  Re: I NEED I TUNES FOR A 64 BIT PC. OPERATING SYSTEM IS WINDOWS 8, NON TOUCH SCREEN. WHICH IS THE ABSOLUTELY BEST WAY TO GET ITUNES OPERATING CORRECTLY ON MY PC????//I HAVE TRIED SEVERAL THINGS, NONE OF WHICH ARE WORKING. IS ITUNES DELIBERATELY EXCLUDING
      Re: I NEED I TUNES FOR A 64 BIT PC. OPERATING SYSTEM IS WINDOWS 8, NON TOUCH SCREEN. WHICH IS THE ABSOLUTELY BEST WAY TO GET ITUNES OPERATING CORRECTLY ON MY PC????//I HAVE TRIED SEVERAL THINGS, NONE OF WHICH ARE WORKING. IS ITUNES DELIBERATELY EXCLUDING PC'S  in response to Birdlover1      
    Post over in the iTunes for Windows forum, here:
    https://discussions.apple.com/community/itunes/itunes_for_windows
    sebastian

Maybe you are looking for

  • How to reload sound modules?

    I'm using alsa + pulse sound system. I also have Openbox as a stand-alone WM and lightDM,  but the same thing occurs on my debian testing + gnome. I've been trying to solve this issue for several days but with no success. Below is the output from als

  • Exporting DVCPRO HD 720p60 Quality Problems with P2 footage.

    I have ingested several clips from P2 cards some shot at 24 and some at 60 using fcp 5.1.4. When I go to export out a QT file I choose file>export>using quick time conversion. Under format options I select DVCPRO HD 720p60 for compression type, but I

  • OVD mapping issue.

    We are using OVD 10g having OID and AD adapter. We are getting operation error popup when trying to extend the tree from the client view. Able to validate the OID and AD server without any issue. The logs are in DUMP level and I am seeing these error

  • Condition Type becoming inactive in IPC

    Hi All, Could someone please explain why a pricing condition using a custom condition formula causes the pricing condition to be inactive when viewed through the IPC. Thanks, AYeung Edited by: AYeung on Mar 16, 2011 8:31 PM

  • ICloud and keychains

    Hi, So i was attempting to get my mac and my ipad calendars to sync up but having no such luck when after a lot of research i found it was becuase of my icloud and i needed to verify my apple id password. however when I attempted to do that i get a m