Doubts in tuning Hint - ORDERED & APPEND

Hi,
Can you clear my doubts regarding ORDERED and APPEND hints usage in query for tuning?
Give some sample sql scripts if at all possible
Thanks in advance.

HI,
the hints have very different scopes.
The APPEND hint is used to write a table in "direct mode", bypassing any check over the object freelists and writing directly after the high water mark. This, in an uncontrolled environement, may leave te object to groove unless fullfills the tablespace.
The ORDERED hint is instead used to "drive" the optimizer and tell it to join the the object in the same ordered as the appears in the FROM clause. The most important thing to check, using that hint, is that the "logical" join order is respected 'cause if not MERGE JOIN CARTESIAN operation may be choosen as access paths.
Hope this helps
Max

Similar Messages

  • Performance tuning - Hints

    Hi Experts,
    I am new to oracle database  developer. currently i am leraning the performance tuning.
    I have a question that is it a good practice to use hint as having using oracle database version 10g.
    some where i have read and also some Senior members from suggest me that before 9i the optimizer was rule based , hence there was nesecarry to use hint.
    after 9i onwards the optimeser is cost based hence there is no need to provide the hints.
    but i have seen some queries from the expert where they have used hints.(  even in db version 10g).
    so can you please tell me that if we wants to use hints then when to use them>\
    thanks in advance
    Prashant Mhatre

    > Senior members from suggest me that before 9i the optimizer was rule based
    No, the CBO was introduced in Oracle 7.
    > so can you please tell me that if we wants to use hints then when to use them>
    Hints can be handy during development for tuning and tweaking (but not twerking).
    In production code, hints can be poison.  Some of the worst performance problems I've seen were *caused* by inappropriate hints.
    Keep in mind I'm talking about "tuning hints".  There are some other hints (like insert /*+ append */) that fall into a totally different category.

  • Hint ordered and cartesian product

    I have a query which needs to be tuned.
    The initial Query does not show cartesian product in the plan , when I change the order of the tables in the from clause ( I have placed the least # of rows first and the most rows tables in the last) and I get MERGE JOIN CARTESIAN product the where clause remaining the same and the cost escalates from 7180 to 454M .
    This happens with ordered hint.

    ranjus wrote:
    I have a query which needs to be tuned.
    The initial Query does not show cartesian product in the plan , when I change the order of the tables in the from clause ( I have placed the least # of rows first and the most rows tables in the last) and I get MERGE JOIN CARTESIAN product the where clause remaining the same and the cost escalates from 7180 to 454M .
    This happens with ordered hint.Let's take a look at this with a simple test case. Assume that:
    * Table T1 contains 10,000 rows
    * Table T2 contains 100 rows
    * Table T3 contains 100,000 rows
    * Table T4 contains 10 rows
    You have the following query:
    SELECT
      T1.C1,
      T2.C2,
      T3.C3,
      T4.C4
    FROM
      T1,
      T2,
      T3,
      T4
    WHERE
      T1.C1=T2.C2
      AND T2.C2=T3.C2
      AND T3.C3=T4.C3;In the above, you can see that in the WHERE clause:
    * Table T1 is joined to table T2
    * Table T2 is joined to tables T1 and T3
    * Table T3 is joined to tables T2 and T4
    * Table T4 is joined to table T3
    What it sounds like you are trying to do is something like this based on the number of rows in the tables:
    SELECT /*+ ORDERED */
      T1.C1,
      T2.C2,
      T3.C3,
      T4.C4
    FROM
      T4,
      T2,
      T1,
      T3
    WHERE
      T1.C1=T2.C2
      AND T2.C2=T3.C2
      AND T3.C3=T4.C3;In the above, we are forcing Oracle's optimizer to join tables T4 and T2 - but there is no direct relationship between the two tables described in the WHERE clause. In such a case, Oracle's optimizer will be forced to perform a Cartesian join between tables T4 and T2. Next, table T1 has a relationship defined in the WHERE clause with table T2, so that join would not result in a Cartesian product. Finally, table T3 has a relationship between tables T2 and T4, so that would not result in a Cartesian product.
    Going back to this example, assume that table T4 contained a single row. The execution plan will still show a Cartesian join, but that Cartesian join is no worse than a nested loops join because there is a single row in one of the row sources.
    In short, think about what you are attempting to force the optimizer to do. You cannot always join in the order of increasing row cardinality estimates - it simply does not make sense to try in some cases.
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Tuning hints for this scenario?

    Every year, one customer has an opening for ticket sales on
    our machine. the machine is Dual Xeon 3 GHz with 2 GB RAM. It runs
    Win2k3, Apache 2.0.59, CF 7.02 Standard and Sybase ASA9 and a
    Mailserver, and of course our cf application which is the ordering
    and reservation system. Our internet provider gives us almost 10
    Mbps.
    As said, at some november's midnight, our customer opens his
    sale which draws a huge interest from the public. i.e. hundreds of
    even thousands of clients wait for that midnight to enter the
    reservation.
    and in any of those nights, our system seems to be very slow
    if not even behaving like a DOSed system. However, I can use remote
    control to see windows task maanger and I don't see an exhausting
    cpu load.
    Therefore my questions to the cracks: What could/should I
    change in the Request Tuning Section in CFAdmin?
    What about "Maximum number of simultaneous Template requests"
    ... currently I have 20. Default were 8. Does anyone have
    experiences regarding this value's range?
    Any other hints for our scenario are greatly welcome ...
    Thank you
    Martin

    Thanks for your reply. Iam sorry, if my earlier question was not clear.
    We are using parallel hints extensively. My question was
    Does Oracle has any in-built methodology or technique like any specific hits for this case scenario.
    Case1:
    select * from A,B
    where A.c1=B.c1
    Assuming A is driving table and B is lookup table, The size of B is very huge.
    Case2:
    select * from A,B
    where A.c1=B.c1
    Assuming A is driving table and B is lookup table, The size of B is very small.
    The ETL tools like IBM Datastage have specific stages to deal with the above scenarios.
    Anyways thank you.

  • Urgent :Doubt on open Purchase orders

    Hi friends,
    i will be more help full if anybody can help me on below issue how to find open PO and partially open PO.
    Only “open” purchase orders will be extracted for conversion into Destination Server. An “open” purchase order is defined as any unshipped, non-cancelled with “open quantities”. In regards to, partially “open” purchase orders, we will only convert “open” units (i.e. Original ordered qty was 300; 70 have shipped, 230 remain open…Target Server sales order will have an original order qty of 230).
    also where to find that Sub Contracting orders and Sample orders.
    • Orders not considered for migration because they will have either shipped in full or deleted prior to data migration as a part of data clean-up: ALL subcontracting orders; sample orders
    please help me on the above two issues.
    thanks and Regards,
    Gokul.

    Hi
    First take the ALL Po's from EKKO and EKPO tables and check for the different GR's and GI's qty's from MKPF and MSEG tables and you have to compare the PO qty with the total GR/GI qty's and to find the OPEN po's
    see the sample report
    *& Report  ZMM_PO_REPORT
    REPORT  ZMM_PO_REPORT message-Id yb
           NO STANDARD PAGE HEADING
           LINE-COUNT 60(1)
           LINE-SIZE 230.
           D A T A B A S E  T A B L E S   D E C L A R A T I O N
    TABLES: lfa1,           " Vendor Master
            t161,           " PO Doc Types
            t024,           " Purchase Groups
            ekko.           " PO Header
                   T Y P E S  D E C L A R A T I O N S
    Purchase Orders Main Structure
    TYPES: BEGIN OF s_po,
            ebeln TYPE ebeln,           " PO No.
            ebelp TYPE ebelp,           " PO Item
            bstyp TYPE bstyp,           " PO Category
            bukrs TYPE bukrs,           " Company Code
            bsart TYPE bbsrt,           " PO Type
            lifnr TYPE lifnr,           " Vendor No
            ekgrp TYPE bkgrp,           " Purchase Group
            waers TYPE waers,           " Currency
            bedat TYPE etbdt,           " PO Date
            txz01 TYPE txz01,           " Material Text
            werks TYPE ewerk,           " Plant
            lgort TYPE lgort_d,         " Storage Location
            matkl TYPE matkl,           " Material Group
            menge TYPE bamng,           " PR Quantity
            meins TYPE bamei,           " UOM
            bprme TYPE bbprm,           " Price Unit
            netpr TYPE netpr,           " Net price
            peinh TYPE peinh,           " Price Unit UOM
            pstyp TYPE pstyp,           " Item Category
            knttp TYPE knttp,           " Account Assignment Category
           END OF s_po.
    Purchase Orders History Structure
    TYPES: BEGIN OF s_account,
            ebeln TYPE ebeln,           " PO No.
            ebelp TYPE ebelp,           " PO Item
            gjahr TYPE mjahr,           " Fiscal Year
            belnr TYPE mblnr,           " PO Invoice No
            menge TYPE menge_d,         " PR Quantity
            wrbtr TYPE wrbtr,           " Price in Local Currency
            dmbtr TYPE dmbtr,           " Price in Foreign Currency
            waers TYPE waers,           " Currency
            shkzg TYPE shkzg,           " Dr/Cr Indicator
           END OF s_account.
    Purchase Orders History Structure(Item Sum)
    TYPES: BEGIN OF s_inv_sum,
            ebeln TYPE ebeln,           " PO No.
            ebelp TYPE ebelp,           " PO Item
            menge TYPE menge_d,         " PR Quantity
            wrbtr TYPE wrbtr,           " Price in Foreign Currency
            waers TYPE waers,           " Currency
           END OF s_inv_sum.
    Purchase Orders Main Structure
    TYPES: BEGIN OF s_rep,
            lifnr TYPE lifnr,           " Vendor No
            ebeln TYPE ebeln,           " PO No.
            ebelp TYPE ebelp,           " PO Item
            bstyp TYPE bstyp,           " PO Category
            bsart TYPE bbsrt,           " PO Type
            ekgrp TYPE bkgrp,           " Purchase Group
            waers TYPE waers,           " Currency
            bedat TYPE etbdt,           " PO Date
            txz01 TYPE txz01,           " Material Text
            werks TYPE ewerk,           " Plant
            lgort TYPE lgort_d,         " Storage Location
            matkl TYPE matkl,           " Material Group
            menge TYPE bamng,           " PR Quantity
            meins TYPE bamei,           " UOM
            bprme TYPE bbprm,           " Price Unit
            netpr TYPE netpr,           " Net price
            peinh TYPE peinh,           " Price Unit UOM
            pstyp TYPE pstyp,           " Item Category
            knttp TYPE knttp,           " Account Assignment Category
            name1 TYPE name1,           " Plant
            orewr TYPE netpr,           " To be Invoiced Price
            curr  TYPE waers,           " Inv Doc Currency
           END OF s_rep.
               D A T A  D E C L A R A T I O N S
    DATA: gv_title1 TYPE sylisel,            " Report title
          gv_dial.                           " Color flag
                C O N S T A N T S  D E C L A R A T I O N S
    CONSTANTS: c_x                VALUE 'X',   " Flag X
               c_h                VALUE 'H',   " Debit
               c_vgabe TYPE vgabe VALUE '2'.   " Transaction Type
         I N T E R N A L  T A B L E S  D E C L A R A T I O N S
    DATA: i_po    TYPE STANDARD TABLE OF s_po WITH HEADER LINE,
                                 " Purchase Order
          i_inv   TYPE STANDARD TABLE OF s_inv_sum WITH HEADER LINE,
                                         " PO Invoice Values
          i_rep   TYPE STANDARD TABLE OF s_rep WITH HEADER LINE,
                                     " PO Invoice Values
          i_ekbe  TYPE STANDARD TABLE OF s_account WITH HEADER LINE.
                               " PO Invoice Values
                     S E L E C T I O N  S C R E E N                      *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr MATCHCODE OBJECT kred,
                    s_ebeln FOR ekko-ebeln MATCHCODE OBJECT mekk,
                    s_bsart FOR t161-bsart,
                    s_ekgrp FOR t024-ekgrp,
                    s_bedat FOR ekko-bedat.
    SELECTION-SCREEN END OF BLOCK b1.
                      I N I T I A L I Z A T I O N                        *
    INITIALIZATION.
                  A T  S E L E C T I O N - S C R E E N                   *
    AT SELECTION-SCREEN.
    Validate the screen fields
      PERFORM validate_screen.
                   S T A R T - O F - S E L E C T I O N                   *
    START-OF-SELECTION.
    Fetch main data
      PERFORM fetch_data.
                   T O P - O F - P A G E                                 *
    TOP-OF-PAGE.
    Header of the List
      PERFORM header.
                   E N D - O F - P A G E                                 *
    Footer
    END-OF-PAGE.
      ULINE.
                   E N D - O F - S E L E C T I O N                       *
    END-OF-SELECTION.
    Display the Report Output data
      PERFORM display_data.
    At Line-Selection
    AT LINE-SELECTION.
    When double clicked on EBELN display the details of Purchase Doc
      PERFORM line_sel.
    *&      Form  validate_screen
    Validation of Selection Screen fields
    FORM validate_screen .
    Validation of Vendor Number
      CLEAR lfa1-lifnr.
      IF NOT s_lifnr[] IS INITIAL.
        SELECT lifnr UP TO 1 ROWS
            INTO lfa1-lifnr
            FROM lfa1
            WHERE lifnr IN s_lifnr.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Invalid Vendor'(002).
        ENDIF.
      ENDIF.
    Validation of PO Number
      CLEAR ekko-ebeln.
      IF NOT s_ebeln[] IS INITIAL.
        SELECT ebeln UP TO 1 ROWS
            INTO ekko-ebeln
            FROM ekko
            WHERE ebeln IN s_ebeln.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Invalid Document Number'(003).
        ENDIF.
      ENDIF.
    Validation of PO Document Type
      CLEAR t161-bsart.
      IF NOT s_bsart[] IS INITIAL.
        SELECT bsart UP TO 1 ROWS
            INTO t161-bsart
            FROM t161
            WHERE bsart IN s_bsart.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Invalid Purchase Document Type'(004).
        ENDIF.
      ENDIF.
    Validation of Purchasing Group
      CLEAR t024-ekgrp.
      IF NOT s_ekgrp[] IS INITIAL.
        SELECT ekgrp UP TO 1 ROWS
            INTO t024-ekgrp
            FROM t024
            WHERE ekgrp IN s_ekgrp.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Invalid Purchasing Group'(005).
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_screen
    *&      Form  fetch_data
    Fetching the PO related data from Database Tables
    FORM fetch_data .
      CLEAR i_po.
      REFRESH i_po.
      SELECT a~ebeln            " PO No.
             b~ebelp            " PO Item
             a~bstyp            " PO Category
             a~bukrs            " Company Code
             a~bsart            " PO Type
             a~lifnr            " Vendor No
             a~ekgrp            " Purchase Group
             a~waers            " Currency
             a~bedat            " PO Date
             b~txz01            " Material Text
             b~werks            " Plant
             b~lgort            " Storage Location
             b~matkl            " Material Group
             b~menge            " PR Quantity
             b~meins            " UOM
             b~bprme            " Price Unit
             b~netpr            " Net price
             b~peinh            " Price Unit UOM
             b~pstyp            " Item Category
             b~knttp            " Account Assignment Category
        INTO TABLE i_po
        FROM ekko AS a JOIN ekpo AS b
        ON a~ebeln = b~ebeln
        WHERE a~ebeln IN s_ebeln AND
              a~lifnr IN s_lifnr AND
              a~ekgrp IN s_ekgrp AND
              a~bsart IN s_bsart AND
              a~bedat IN s_bedat.
      SORT i_po BY ebeln ebelp.
      break-point.
      IF NOT i_po[] IS INITIAL.
    Fetch the PO History/Invoice Details from EKBE Table
        CLEAR i_ekbe.
        REFRESH i_ekbe.
        SELECT ebeln           " PO No.
               ebelp           " PO Item
               gjahr           " Fiscal Year
               belnr           " PO Invoice No
               menge           " PR Quantity
               wrbtr           " Price in Local Currency
               dmbtr           " Price in Foreign Currency
               waers           " Currency
               shkzg           " Dr/Cr Indicator
         INTO TABLE i_ekbe
         FROM ekbe
         FOR ALL ENTRIES IN i_po
         WHERE ebeln = i_po-ebeln AND
               ebelp = i_po-ebelp AND
               vgabe = c_vgabe.
      break-point.
        IF sy-subrc = 0.
          SORT i_ekbe BY ebeln ebelp.
          LOOP AT i_ekbe.
            IF i_ekbe-shkzg = c_h.
              i_ekbe-wrbtr = i_ekbe-wrbtr * -1.
            ENDIF.
            MODIFY i_ekbe.
          ENDLOOP.
      break-point.
    Sum up the Item wise Invoice totals
          LOOP AT i_ekbe.
            AT END OF ebelp.
              READ TABLE i_ekbe INDEX sy-tabix.
              SUM.
              MOVE-CORRESPONDING i_ekbe TO i_inv.
              APPEND i_inv.
            ENDAT.
            CLEAR i_inv.
          ENDLOOP.
          SORT i_inv BY ebeln ebelp.
            break-point.
        ENDIF.
      ENDIF.
    Move the Vendor Name and Invoice Values to I_rep Internal Table
      LOOP AT i_po.
        MOVE-CORRESPONDING i_po TO i_rep.
        CLEAR i_inv.
        READ TABLE i_inv WITH KEY ebeln = i_po-ebeln
                                  ebelp = i_po-ebelp.
        IF sy-subrc = 0.
          i_rep-orewr = ( i_po-menge - i_inv-menge ) * i_po-netpr.
          i_rep-curr  = i_inv-waers.
        ELSE.
          i_rep-orewr = i_po-menge * i_po-netpr.
          i_rep-curr  = i_po-waers.
        ENDIF.
      break-point.
    Get the Vendor Name
        CLEAR lfa1-name1.
        SELECT SINGLE name1 FROM lfa1 INTO lfa1-name1
          WHERE lifnr = i_po-lifnr.
        IF sy-subrc = 0.
          i_rep-name1  = lfa1-name1.
        ENDIF.
        APPEND i_rep.
        CLEAR  i_rep.
          break-point.
      ENDLOOP.
      SORT i_rep BY lifnr ebeln ebelp.
      DELETE i_rep WHERE orewr LE 0.
      break-point.
    ENDFORM.                    " fetch_data
    *&      Form  display_data
    Display the Report Output data
    FORM display_data .
      DATA: lv_flag,               " New Flag
            lv_rec TYPE i.         " No of Records
      CLEAR lv_rec.
      IF i_rep[] IS INITIAL.
        MESSAGE e000 WITH 'No Data found'(022).
      ELSE.
        LOOP AT i_rep.
    Toggle Color
          PERFORM toggle_color.
          IF lv_flag <> space.
            NEW-LINE.
          ENDIF.
    At New Purchase Document
          AT NEW ebeln.
            WRITE:/1 sy-vline, 2(10) i_rep-ebeln INTENSIFIED OFF.
            lv_flag = c_x.
            lv_rec = lv_rec + 1.
          ENDAT.
          WRITE: 1 sy-vline,
                12 sy-vline,13(4)   i_rep-bsart,
                17 sy-vline,18(10)  i_rep-lifnr,
                28 sy-vline,29(35)  i_rep-name1,
                64 sy-vline,65(4)   i_rep-ekgrp,
                69 sy-vline,70(10)  i_rep-bedat,
                80 sy-vline,81(5)   i_rep-ebelp,
                86 sy-vline,87(40)  i_rep-txz01,
               127 sy-vline,128(9)  i_rep-matkl,
               137 sy-vline,138(1)  i_rep-pstyp,
               139 sy-vline,140(1)  i_rep-knttp,
               141 sy-vline,142(4)  i_rep-werks,
               146 sy-vline,147(4)  i_rep-lgort,
               151 sy-vline,152(13) i_rep-menge UNIT i_rep-meins,
               165 sy-vline,166(3)  i_rep-meins,
               169 sy-vline,170(15) i_rep-netpr CURRENCY i_rep-waers,
               185 sy-vline,186(4)  i_rep-waers,
               190 sy-vline,191(5)  i_rep-peinh,
               196 sy-vline,197(4)  i_rep-bprme,
               201 sy-vline,202(15) i_rep-orewr CURRENCY i_rep-curr,
               217 sy-vline,218(4)  i_rep-curr,
               222 sy-vline,223(7)  i_rep-bstyp centered,
               230 sy-vline.
          NEW-LINE.
          hide: i_rep-ebeln.
        ENDLOOP.
        ULINE.
        FORMAT COLOR OFF.
        WRITE : /2 'Total Number of Purchasing Documents:'(025) COLOR 3,
                    lv_rec COLOR 3.
      ENDIF.
    ENDFORM.                    " display_data
    *&      Form  header
    Write the Report Header
    FORM header .
      FORMAT RESET.
    header
      WRITE:/1(230) 'LIST OF PURCHASE DOCUMENTS PER VENDOR'(006) CENTERED.
      SKIP.
      FORMAT COLOR COL_HEADING.
      ULINE.
      WRITE:/1 sy-vline,2(10)   'Pur.Doc.No'(006) CENTERED,
            12 sy-vline,13(4)   'Type'(007),
            17 sy-vline,18(10)  'Vendor'(008) CENTERED,
            28 sy-vline,29(35)  'Name'(009) CENTERED,
            64 sy-vline,65(4)   'PGrp'(010) CENTERED,
            69 sy-vline,70(10)  'Doc.Date'(012) CENTERED,
            80 sy-vline,81(5)   'Item'(011),
            86 sy-vline,87(40)  'Material Short Text'(024) CENTERED,
           127 sy-vline,128(9)  'Mat.Group'(013),
           137 sy-vline,138(1)  'I',
           139 sy-vline,140(1)  'A',
           141 sy-vline,142(4)  'Plnt'(014),
           146 sy-vline,147(4)  'SLoc'(015),
           151 sy-vline,152(13) 'Quantity'(016) CENTERED,
           165 sy-vline,166(3)  'UoM'(017),
           169 sy-vline,170(15) 'Net Value'(018) CENTERED,
           185 sy-vline,186(4)  'Curr'(019),
           190 sy-vline,191(5)  'Per'(020),
           196 sy-vline,197(4)  'Unit'(021),
           201 sy-vline,202(15) 'To be Invoiced'(023) CENTERED,
           217 sy-vline,218(4)  'Curr'(019),
           222 sy-vline,223(7)  'Doc.Cat'(026),
           230 sy-vline.
      ULINE.
    ENDFORM.                    " header
    *&      Form  toggle_color
    This routine alters the color of the records in the list
    FORM toggle_color.
      IF gv_dial = space.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
        gv_dial = c_x.
      ELSE.
        FORMAT COLOR 1 INTENSIFIED OFF.
        CLEAR gv_dial.
      ENDIF.
    ENDFORM.                    " toggle_color
    *&      Form  LINE_SEL
    *When double clicked on EBELN field display the details of Purchase Doc
    FORM line_sel.
      CASE sy-lsind.
        WHEN '1'.
          DATA: lv_field(20),
                lv_value(10),
                lv_bstyp like i_rep-bstyp.
          clear: lv_bstyp,lv_value, lv_field.
          GET CURSOR FIELD lv_field VALUE lv_value.
          IF lv_field = 'I_REP-EBELN'.
            IF NOT lv_value IS INITIAL.
              READ LINE sy-index FIELD VALUE i_rep-bstyp
                                       INTO  lv_bstyp.
             READ CURRENT LINE FIELD VALUE i_rep-bstyp INTO lv_bstyp.
              if lv_bstyp = 'F'.
                SET PARAMETER ID 'BES' FIELD lv_value.
                CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
              elseif ( lv_bstyp = 'K' or lv_bstyp = 'L' ).
                SET PARAMETER ID 'VRT' FIELD lv_value.
                CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
              elseif lv_bstyp = 'A'.
                SET PARAMETER ID 'ANF' FIELD lv_value.
                CALL TRANSACTION 'ME43' AND SKIP FIRST SCREEN.
              endif.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDFORM.                    " line_sel
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Doubt in the sales order form - Technical

    Hi Frenz,
    i have a small doubt in custom.pll.
    we have a requirement to give a pop up message, wenever we do scheduling action in the sales order form (Oracle 11i).
    i have written the code like below
    if
    ((block_name = 'LINE') AND ( event_name = 'SPECIAL14'))
    then the pop up message.
    the problem im facing is, the pop up is working fine, when we schedule action is done by(Tools--> scheduling)
    but it is not working whenever i right click on the sales order line and do scheduling.
    what code do i need to include for the right click scheduling?
    please advice.
    thanks,
    Lp

    Hi All,
    Does any1 have any suggestion for my question...
    Thanks,
    Lp

  • Doubt with index hint

    I have a doubt with applying the index hint to fire for multiple coulmns in a query.
    For a single column, it is ok like:-
    select /*+ index( ppbS_inv_sim_serial iss_status) */ item_type_id, status, city from
    ppbS_inv_sim_serial where status='IT';
    there is a problem with indexes firing in our database so this way, using hint, the
    indexes fire.
    But, what, if i want all 3 indexes in the query to fire like
    select count(1) from
    ppbS_inv_sim_serial where status='IT' and item_type_id='A2' and city='USA';
    I hope, my question is clear. Please, help i solving my doubt as it is urgent.
    regards.

    Fix the problem. Not the symptom.
    Using hints in SQL, especially production SQL, is a very poor way to address the problem and only fix the symptom for a period. Until the problem rears its head again and bite you in the butt - a lot more painful this time around.
    Solving performance problems start with Rule #1.
    RULE 1#. IDENTIFY THE PERFORMANCE PROBLEM
    Saying that something is slow, is not identifying the problem. The only way a problem can be solved is if you have at least some idea what the actual problem is.
    Identifying the problem will point to issues like:
    - database schema(s) not being analysed or analysed correctly
    - poorly designed and written SQL (often the case)
    - poorly configured Oracle instance
    - problem/bug(?) with the Oracle CBO
    And depending on the problem analysis, the problem can be CORRECTLY and COMPREHENSIVELY and PROPERLY addressed.
    Fixing symptoms? That is only moving the brick wall a bit further away. Allowing you to run even faster into it the next time around.

  • Performance doubt: Manual tuning or Oracle tuning features?

    Hi all,
    I'm reading some docs regarding performance, and most of then mention and recommend the use of the Oracle tuning features, as SQL Access Advisor, SQL Performance Analyzer, SQL Tuning Sets and so on. What i want to know from the most experienced dbas here is if you use these performance features from Oracle, or if you prefer to perform tuning tasks "by hand"?. By hand i mean checking the explain plan, checking statistics, index seletivity, histograms and so on.
    Thanks in advance.

    Fabricio_Jorge wrote:
    Another simple doubt/question: What would be your tuning strategy? For example, what a commonly do is:
    1) Check the object statistics.Yes, make sure statistics are current. The tricky part is that I have heard enough stories (not seen this myself) about new stats messing up performance that I prefer to save off the old stats before generating new ones - just in case
    2) Check if the columns used in the predicates are indexed, and if not, i check the seletivity of then to see if an index creation would be efficient.This is probably my most effective tuning technique. I check the selectivity but create the index anyway to see what happens with it in place. Sometimes even though a new index is created the optimizer won't use it, and in other cases the index does not help performance even when the optimizer uses it. Any changes must be carefully checked.
    3) If it is possible, create a materialized view with the query rewrite feature.I use MVs, but as a later resort. I prefer instead to recode SQL if possible to get better results to avoid having yet another database object to keep track of. With luck the optimizer can use the automated query rewrite capability to avoid changing the original SQL.
    >
    4) If it is a RAC env, i try to increase the CACHE value of the sequencesI have not worked on many RAC environments and when I have did not have much to do with sequences. I did learn that select list inline views often perform poorly compared to equivalent queries using table joins (not specifically a RAC issue)
    >
    5) Check the Memory and Segment Advisors and hit ratios, taking the necessary procedures, if the advisors indicate so.I am not usually given privileges to use these tools. I have gotten good results from the SQL tuning advisor when I can use it but have seen it miss things so I prefer to manually analyze SQL.
    >
    6) After all of this, i would try to tune the query by rewriting it. I leave this as a last option because generally you must know the data/env of the company that you are allocated. If you don't know the env very well, you can make bad recommendations about a specific
    query.Doing the rewrite is something I do earlier in the process due to the fact that I rarely get DBA privilege on my projects and don't get access to some of the tools you mentioned. I can (hopefully) control SQL so I focus on it. Sometimes I cannot control SQL and have to rely on materailzed views, indexes, and other environmental factors to help SQL run faster.
    >
    OBS: All of this is done in parallel with the Statspack/AWR report "on hand"AWR is a great tool to use for tuning. OEM (which I rarely get access to) is another.

  • Doubt in uploading purchase order data using BDC

    Hi friends,
    how to upload purchase order data.
    1) In both BDC and BAPI which one is preferable?
    2) for suppose if it is through BDC,  how to use? what are the transactions that we can use(SHDB, ME21N,ME21)?
    3) To execute the job in background, is it possible for both call transaction and session method.
    Thanks in advance
    Sreenivas k

    It really depends on the number of records you have. Still for a set of 5,000 records my answer to your questions will be:
    1) In both BDC and BAPI which one is preferable?  - <b>Go with BDC</b>
    2) for suppose if it is through BDC, how to use? what are the transactions that we can use(SHDB, ME21N,ME21)? - <b>Yes, its SHDB for recording, SE38 for abap program and ME21 for PO. Avoid SAP Enjoy transactions for recording as you may end up having problems wiht it.</b>
    3) To execute the job in background, is it possible for both call transaction and session method. - <b>If you use call transaction method then you have to schedule the job to run in background or simply run it through F9 instead of F8. In case of session method you can chose to process the session in background. However  I would suggest you go with BDC Session method for this.</b>
    - Guru
    Reward points for helpful answers

  • Doubt abt "Fixing the Orders"

    Hi,
       I know an order can be fixed within therange of  Planned Delivery Time + GR Processing Time ( Procurement Type : F).
    My question is:
    1. I need to fix an order which lies outside the range of Planned Delivery Time + GR Processing Time.I have an custom report for fixing an report.
    2. I know available time of the order is compared with the Planned Delivery Time + GR Processing Time for fixing. When I debugged I saw there was a time stamp with the Planned Delivery Time + GR Processing Time.
    So please let me know how the stamp time is calculated.
    Thanks in advance.
    Best Regards,
    Siva.

    The time stamp is calculated based on PPDS logic. While using time stamp in your development object, use the one that shows up in Product View as a reference. I am not sure the context you are referring to has PPDS implemented. If not them the standard PP strategies are probably used to calculate those time stamps.

  • Doubt in CRM sales order Cube and ODS

    Hell Friends,
    We have a standard cube '0CSAL_C03' and ODS '0CRM_SALO' for CRM sales order.
    ODS is attached with infosurce(datasource) -0CRM_SALES_ORDER_I and 80CRM_SAL2(this is update rules-another sales order items(lean extraction) ODS - 0CRM_SAL2).
    we have another ods(lean extraction)- 0CRM_SAL2 and again it is attached with 0CRM_SALES_ORDER_I.
    Could anybody explain me why two ods ar coming for sales order- crm.
    Can we use two ods or only one ods-0CRM_SALO?
    Could you pls. check it the system under- crm  application component and let me know what is the best way for going impls.
    Thanks,
    Mahantesh

    Hi!
    actually they definatly use Bdocs because messages bdocs are the main communication elements in CRM.  you will definatly find them in SBDM.  Bdoc are simmilar idoc's  they used to send information between CRM transactions and ERP systems, mobile clients or to BW.  there are 2 types of Bdocs message bdocs(M Bdocs) and synchronization Bdocs (S Bdocs). Sbdocs are used for sycronizing between moblie clients and  CRM online. M bdocs are used for communication within CRM and also for exachange information between R/3 and CRM as well.
      So for sales we normally configure our standard Bdocs or we can modell our own bdocs.  lean Bdocs are message bdocs but have only subset of all the fields in a transaction and used for updating only those fields. usage of them can be verified only CRM specialists. it depends on how your organizational sales process is configured in CRM.
    in SALES we normally use bdoc  BUS_TRANSACTION_MESSAGE this is used for most of the transactions in CRM. so you got to confirm from your team if they are using any other bdocs for slaes additional to the above mentioned.
    with regards
    ashwin

  • Ordered hint question

    Hi all, I have query, in ap_payselect app engine, which is taking a lot of time to execute. so i used ordered hint (/*+ ORDERED */).
    My question is, will that ordered hint change the result? will we get same result with ordered hint as it was with out ordered hint.
    Please help me.
    Thank you.

    The ORDERED hint won't change the result, that will remain the same. Only the explain plan (it is how Oracle will process the query behind the scene) and maybe the execution time could change (faster or slower).
    Find out more:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#sthref659
    Nicolas.

  • Append hint generating huge redo

    Hi all,
    Sorry if this question was already asked here.
    We have few [partitioned] tables created with no logging option. Java code [which inserts data in these tables] has /*+ Append */ hint.
    DB is 10.2.0.5 version, DB is in archive.
    When we query "sys.v_$sqlarea" and "dba_users", we do see append hint for the insert statements. But when we do log mining we don’t see append hint there, all the insert statements [huge] are making into redo log[which we don’t want], Any idea why…?
    Thanks,
    AJ

    Thanks for your replies -
    Here is my insert hint -
    INSERT /*+ Append */ INTO tab_1(SUBTYPE........
    Let me know if hint is wrong?
    Question –
    sys.v_$sqlarea shows above hint but mined redo log [archived log as well] doesn’t show hint i.e. insert statement is shown like - INSERT INTO tab_1(SUBTYPE........
    Does that mean oracle is ignoring hint [because hint is wrong, what would be the correct hint]…?
    FYI – we have cursor_sharing set to similar – will that cause an issue?
    Thanks,
    AJ.

  • ORDER BY clause with expression

    Considering that all the column names and table name is valid, what happens internally when the following query is run?
    SQL> SELECT STU_ID, STU_NAME FROM STUDENT ORDER BY 2+3, STU_ID;
    What i found out was the rows get ordered in ascending order of STU_ID. It's quite clear that it is ignoring the expressing 2+3, so my doubts are:
    (a) Is it appending any pseudo-column to the table with 2+3 getting evaluated to 5?
    (b) If there exist a 5th column in the table student and we specify it in the select statement's select list (5 column names) then why its not considering it as 5 and sorting the data according that?
    (c) Is it true that, any expression we write is getting evaluated to NULL? Then is it that ORDER BY NULL evaluates to no ordering and the parser searches for next column-name or position (if specified) ?
    (d) if neither then, what's the reason of the ignorance?

    Hi,
    Welcome to the forum!
    987236 wrote:
    Considering that all the column names and table name is valid, what happens internally when the following query is run?
    SQL> SELECT STU_ID, STU_NAME FROM STUDENT ORDER BY 2+3, STU_ID;
    What i found out was the rows get ordered in ascending order of STU_ID. It's quite clear that it is ignoring the expressing 2+3, so my doubts are:
    (a) Is it appending any pseudo-column to the table with 2+3 getting evaluated to 5There's no pseduo-column involved. (Pseudo-columns are something that Oracle provides for you, without you having to spell out what you want. ROWID and LEVEL are examples of pseudo-columns. In this example, 2+3 is an Expression . Like pseudo-columns, expressions can usually appear in the ORDER BY clause, even though they are not actually stored in the table.)
    It's sorting first by the NUMBER 5 (= 2 + 3), not the 5th column. Since the NUMBER 5 has the same value on every row, every row ties for first place. The result of sorting by any constant is the same; the results are the same as not including that exrpression in the ORDER BY clause. That is the ORDER BY clause you posted is equivalent to
    ORDER BY  2 + 3
    ,         'foo'
    ,         SYSDATE
    ,         NULL
    ,         stu_idand it's also equivalent to
    ORDER BY  stu_idNone of the expressions except stu_id vary from row to row, so none of them affect the sorting.
    (b) If there exist a 5th column in the table student and we specify it in the select statement's select list (5 column names) then why its not considering it as 5 and sorting the data according that?As Solomon said, only number literals are taken to mean a column. 5 is a number literal, so
    ORDER BY  5means "sort by the 5th column", but 2 + 3 is not a literal (it's an expression that happens to include a couple of literals), so
    ORDER BY  2 + 3does not refer to the 5th colunmn.
    (c) Is it true that, any expression we write is getting evaluated to NULL? Then is it that ORDER BY NULL evaluates to no ordering and the parser searches for next column-name or position (if specified) ?No, when you way "ORDER BY x", the rows with lower values of x come first, followed by rows with higher values of x. Rows with the same value of x will be together, in no particular order with respect to each other (unless there is a tie-breaker expression later in the ORDER BY clause.
    That's exactly what happens when you say "ORDER BY NULL". NULL has the same value (actually, the same lack of any value) on all rows, so all the rows have the same value of x, and they will appear in no particular order.
    (d) if neither then, what's the reason of the ignorance?

  • How to add Hints in the Metadata(RPD).

    Hi Friends,
    Need to use the Hints in the rpd.So please if anything pointers are there share with me.
    Am using the Hints ORDERED on the object in the physical layer. My confusion here is this hint will visible in the Physical sql or not.
    Should i need to use this /*+ORDERED*/ hint in this format in the physical layer.
    Please share your thoughts on this.
    Thanks,
    Govardhana

    Hi,
    Refer below:
    http://gerardnico.com/wiki/dat/obiee/hint
    http://gerardnico.com/wiki/database/oracle/hints
    http://docs.oracle.com/cd/B19306_01/server.102/b14211/hintsref.htm
    Normally we use HINTS to get better performance of query run time similarly in OBIEE you can have the same hints in physical layer supported by DATABASE(ORACLE)
    By default database query optimizer selects its most optimized path of query execution.
    But you can use hint instructions placed within a SQL statement for telling the database query optimizer the most efficient way to execute the statement.
    Supposing consider the PL/SQL data loading procedures using the following HINTS for performance. They are /*+ APPEND NOLOGGING PARALLEL */
    ■Append: - When “Append” hint is used in a PL/SQL INSERT statement, Oracle will perform a DIRECT Load of data and hence will be fast. It's known as direct path insert
    ■NoLogging : - When "NoLogging" hint is provided, Oracle will not perform any logging operations for this statement
    ■Parallel: - Oracle will make use of Parallel Loading when “Parallel” hint is used in SQL Statement.
    Refer
    http://docs.oracle.com/cd/E10415_01/doc/bi.1013/b31770.pdf
    Page 106 for more good understanding
    Regards
    MuRam

Maybe you are looking for

  • Tabel for PO-item in SRM

    Hi, Can anyone give me the name of the tabel for PO-item in SRM,? Br. Kim

  • Intransit Inventory in OBI

    Hello All, I am an end user with very limited OBI experience. Is anyone using OBI to report on Intransit Inventory? We use OBI today to report on hand inventory but we do not have Item and Quantity detail information available for goods intransit bet

  • Download abap objects by package

    Hi All Any one please suggest any program to download abap programs including ztables / include if any by giving development class Thanks Sekhar

  • Spotify and facebook problem with the date

    Hi, everyone.My spotify account have a problem with the date. I changed the date on facebook and nothing happens with that, the spotify account has a wrong date, is not the same as facebook account

  • Non-Recoverable Tax Accounting for Purchasing of OPM Item

    Hi, As an industry practice and standard functionality of Oracle Inventory, Non-Recoverable TAX (tax paid upon purchase of items is not recovered through sales tax) is charged to the Inventory. However, this functionality is not available in OPM Inve