PERFORMANCE BAD WHEN CURSORS ARE USED WITHIN PL/SQL BLOCKS

There are poor database performance at Oracle 10g
For some cursor selects, the performance is under Oracle 10g
significant slower than under Oracle 9i.On a test system (Oracle 9) the
problem does not reproduce, on the 10g system however always.
The simple execution of the base select statement was on both
databases in roughly of the same speed. If however a cursor was defined and
those executed within a PL/SQL block (without involving the user interface),
then the time behavior was in accordance with the observed behavior
behavior on the user interface.
By adding of the hint first_rows on both machines a
similar (fast) time behavior can be achieved.
Conclusion: Something in the (Optimizer) settings of the Oracle-10
databases must be fundamentally different than that of Oracle 9. Or Oracle
10 has a real problem. The analysis and solution of this general
problem seems to me more reasonable than the solution of individual performance
problems.
can you help me, many thanks

Hello, thanks for the explanatory notes.
Here are the concerned Script. The only difference is the Hint (with Hint = good püerformance; without Hint = bad performance)
DECLARE
b BOOLEAN;
BEGIN
b := plogin.batch_login('**', '****', 717, FALSE);
prost.reload_context;
END;
DECLARE
l_ma_kuerzel VARCHAR2(100) DEFAULT NULL;
l_sta_id mitarbeiter_historie.sta_id%TYPE;
l_org_id organisationseinheit.org_id%TYPE;
l_pv_like mitarbeiter.ma_name%TYPE;
l_typ_id typ.typ_id%TYPE;
l_mihi_beginn VARCHAR2(40);
l_ma_ausgeschieden VARCHAR2(40);
l_ma_ldap mitarbeiter.ma_ldap%TYPE;
l_smodify_form VARCHAR2(80);
l_sform_typ VARCHAR2(80);
l_sheader VARCHAR2(200);
l_nurlsource NUMBER;
l_nurldestination prosturl.pur_id%type;
l_ma_like VARCHAR2(100) DEFAULT NULL;
l_nma_typ NUMBER;
l_bshow BOOLEAN;
l_counter NUMBER DEFAULT 0;
cursor ma_list_not_all_detail(
p_ma_like IN VARCHAR2 DEFAULT NULL,
p_ma_kuerzel IN VARCHAR2 DEFAULT NULL,
p_sta_id IN VARCHAR2 DEFAULT NULL,
p_org_id IN VARCHAR2 DEFAULT NULL,
p_typ_id IN VARCHAR2 DEFAULT NULL,
p_mihi_beginn IN VARCHAR2 DEFAULT NULL,
p_pv_like IN VARCHAR2 DEFAULT NULL,
p_ma_ausgeschieden IN VARCHAR2 DEFAULT NULL,
p_ma_ldap IN VARCHAR2 DEFAULT NULL
) IS
SELECT /*+ first_rows */
ma.ma_id ma_id
, view_fkt.display_ma(mihi.typ_id_mt
, view_fkt.cat_maname(ma.ma_name
, ma.ma_zusatz
, ma.ma_titel
, ma.ma_vorname)) name
, view_fkt.display_ma(mihi.typ_id_mt,ma.ma_kuerzel) ma_kuerzel
, typ.typ_value mt_kuerzel
, substr(org.typ_id,4,length(org.typ_id)) || ' ' || org.org_name||' ('||org.org_ktr||')' org_name
, to_char(mihi.mihi_beginn, 'dd.mm.yyyy') beginn
, decode(pv.ma_name ||' '|| pv.ma_titel ||' '|| pv.ma_vorname
, ' ',prost_cons.t_blank
, pv.ma_name||', '||pv.ma_titel||' '||pv.ma_vorname) pv_kuerzel
, mihi.sta_id sta_id
, nvl(to_char(ma.ma_ausgeschieden,'dd.mm.yyyy'), ' ') ausgeschieden
, nvl(to_char(mihi.mihi_wochenarbeitszeit,'90D00'),' ') wochenarbeitszeit
, nvl(to_char(mihi.mihi_taz_mo,'90D00'),' ') taz_mo
, nvl(to_char(mihi.mihi_taz_di,'90D00'),' ') taz_di
, nvl(to_char(mihi.mihi_taz_mi,'90D00'),' ') taz_mi
, nvl(to_char(mihi.mihi_taz_do,'90D00'),' ') taz_do
, nvl(to_char(mihi.mihi_taz_fr,'90D00'),' ') taz_fr
, nvl(to_char(mihi.mihi_taz_sa,'90D00'),' ') taz_sa
, nvl(to_char(mihi.mihi_taz_so,'90D00'),' ') taz_so
, nvl(ma.ma_ldap, ' ') ma_ldap
, mihi.mihi_beginn mihi_beginn
, mihi.mihi_order_no mihi_order_no
, mihi.mihi_order_pos mihi_order_pos
FROM organisationseinheit org
, typ typ
, mitarbeiter pv
, mitarbeiter ma
, v$mihi_id mid
, mitarbeiter_historie mihi
, v$access_orgs_th_t th
WHERE mihi.org_id = th.org_id
AND mid.mihi_id = mihi.mihi_id
AND ma.ma_id = mid.ma_id
AND ma.ma_delete = 'n'
AND ma.ma_virtualitaet = 'N'
AND (p_ma_like IS NULL
OR ma.ma_name LIKE p_ma_like)
AND (p_ma_kuerzel IS NULL
OR ma.ma_kuerzel LIKE p_ma_kuerzel)
AND (p_sta_id IS NULL
OR mihi.sta_id = p_sta_id)
AND (p_org_id IS NULL
OR org.org_id = p_org_id)
AND (p_typ_id IS NULL
OR typ.typ_id = p_typ_id)
AND mihi_beginn >= nvl(p_mihi_beginn,to_date('01.01.1960','dd.mm.yyyy'))
AND (p_pv_like IS NULL
OR pv.ma_name LIKE p_pv_like)
AND (ma.ma_ausgeschieden >= nvl(p_ma_ausgeschieden,to_date('01.01.1960','dd.mm.yyyy'))
AND ma.ma_ausgeschieden - 1 < nvl(p_ma_ausgeschieden,to_date('01.01.1960','dd.mm.yyyy'))
OR p_ma_ausgeschieden IS NULL)
AND (p_ma_ldap IS NULL
OR ma.ma_ldap LIKE p_ma_ldap)
AND pv.ma_id (+)= mihi.ma_id_pv
AND org.org_id (+)= mihi.org_id
AND typ.typ_id = mihi.typ_id_mt
ORDER BY upper(ma.ma_name), upper(ma.ma_vorname);
l_result ma_list_not_all_detail%ROWTYPE;
BEGIN
l_nMA_Typ := pmitarbeiter.cn_Incomplete_Ma;
l_ma_like := NULL;
l_ma_kuerzel := NULL;
l_sta_id := NULL;
l_org_id := 'KST0000421301';
l_typ_id := NULL;
l_mihi_beginn := NULL;
l_pv_like := NULL;
l_ma_ausgeschieden := NULL;
l_ma_ldap := NULL;
IF (l_ma_like IS NOT NULL
OR l_ma_kuerzel IS NOT NULL
OR l_sta_id IS NOT NULL
OR l_org_id IS NOT NULL
OR l_typ_id IS NOT NULL
OR l_mihi_beginn IS NOT NULL
OR l_pv_like IS NOT NULL
OR l_ma_ausgeschieden IS NOT NULL
OR l_ma_ldap IS NOT NULL) THEN
-- fuer Mitarbeiter unvollstandig wird ein andere cursor angesprochen
-- um der Mitarbeiter vollstandig zu kriegen soll ein Standort,
-- Arbeitszeitmodel, Bereich und Tagesarbeitszeiten ausgevult wirden
-- Wenn er dan gespeichert wirdt wirden die betriffende velder gespeichert
-- und wirdt das Feld Virtualiteat auf R gesetzt (war N)
l_counter := 0;
dbms_output.put_line(to_char(sysdate, 'sssss'));
FOR j IN ma_List_Not_All_Detail(
l_ma_like,
l_ma_kuerzel,
l_sta_id,
l_org_id,
l_typ_id,
l_mihi_beginn,
l_pv_like,
l_ma_ausgeschieden,
l_ma_ldap
) LOOP
l_counter := l_counter + 1;
dbms_output.put_line(l_counter);
dbms_output.put_line(j.ma_kuerzel);
END LOOP;
dbms_output.put_line(to_char(sysdate, 'sssss'));
END IF;
return;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(sqlerrm);
END;
=============
Thank you

Similar Messages

  • How to Improve performance issue when we are using BRM LDB

    HI All,
    I am facing a performanc eissue when i am retriving the data from BKPF and respective BSEG table....I see that for fiscal period there are around 60lakhs records. and to populate the data value from the table to final internal table its taking so much of time.
    when i tried to make use of the BRM LDB with the SAP Query/Quickviewer, its the same issue.
    Please suggest me how to improve the performance issue.
    Thanks in advance
    Chakradhar

    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting - post locked
    Rob

  • IPhone 4 soundis very low when headphones are used

    my iPhone volume is extremely low when i plug headphones in when listening to Netflix, Pandora, etc. When i unplug the headphones, the volume is normal when coming from the speakers in the phone- this only happens when we use headphones. We took the phone to the Apple store yesterday and they completely replaced the phone with a new one- and the new one is doing the same thing- you can barely hear anything when headphones are used.. all our sounds are turned all the way up- if there a way to configure the sound settings in iTunes for your iPhone???

    This sounds silly but did you remove the plastic tabs covering each ear plug?
    If so then read here : http://support.apple.com/kb/TS2802
    Good Luck

  • Received a replacement ipod nano in early January . Works well in a sound system but keeps turning off when earphones are used. tried 3 pair but same result. When tried for support comes up as  expires. Says I have to purchase . Why????

    Received an ipod nano replacement in January. It works in a sound system but keeps turning itself of or loosing sound when earphones are used. I have tried several sets os earphones with the same result. When I just tried to seek support my Serial number comes up with warranty expired although the letter says 3 mths warranty. What gives Apple ??? Any one any advice??/

    This is usually an indication that your headphones are not plugged all the way in.  The white plastic part of the headphones should be flush with the Nano and no silver from the plug should still be visible.  The headphone jacks on the new 6G Nanos are a bit tighter than previous generations, so it requires a bit of extra push to get the headphones to pop all the way in.
    Also check make sure the jack is clear of debris such as lint.
    B-rock

  • When we are using java.io.DataInputstream and method readInt()or read doubl

    Hi
    When we are using java.io.DataInputStream some garbage value is coming
    import java.io.*;
    class DataDemo
    public static void main(String ar[]) throws IOException
    DataInputStream dis=new DataInputStream(System.in);
    double d=dis.readDouble();
    System.out.print("ERRRRR"+d);
    when we input 234.66
    its printing 7.123096485547326E-67
    If anybody know why plz answer me
    Regards
    Rani

    DataInputStream(System.in);Why do you expect this to create a double? It doesn't, see the documentation for the method, you're misusing it.

  • ItemFocusOut called twice when you are using datagrid

    Have you ever encountered itemFocusOut called twice when you
    are using datagrid. I use this event to check the text that has
    been entered.
    Also when I use regex expressions
    if((event.itemRenderer as TextInput).text.search(new
    RegExp(/.*\..*\./)) != -1){
    in the itemFocusOut method and someone enters
    234.34.234
    I get an error
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at
    mx.controls::DataGrid/destroyItemEditor()[C:\autobuild\3.2.0\frameworks\projects\framewor k\src\mx\controls\DataGrid.as:4000]
    at
    mx.controls::DataGrid/itemEditorItemEditEndHandler()[C:\autobuild\3.2.0\frameworks\projec ts\framework\src\mx\controls\DataGrid.as:4897]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9298]
    at
    mx.controls::DataGrid/endEdit()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\c ontrols\DataGrid.as:4041]
    at
    mx.controls::DataGrid/mouseDownHandler()[C:\autobuild\3.2.0\frameworks\projects\framework \src\mx\controls\DataGrid.as:4296]
    Could some be so kind as shed some light on this
    situation

    I've worked around the error. I had something to do with the
    fact that the event was being twice and I worked my handling code
    around to avoid the error. However the problem with the event still
    remains. I think it is because the data it in the grid is being
    refreshed intentially after the code in the itemFocusOut is called
    that is cause the second event to fire.

  • [svn:fx-trunk] 9320: Fix Application.url property when RSLs are used.

    Revision: 9320
    Author:   [email protected]
    Date:     2009-08-14 14:49:12 -0700 (Fri, 14 Aug 2009)
    Log Message:
    Fix Application.url property when RSLs are used.
    Use LoaderUtil.normalizeURL() to normalize the Application.url property. Do the same thing for both the Halo and Spark versions of Application.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-22154
    Reviewer: Alex
    Tests run: checkintests
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22154
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as

  • Is it possible to monitor when apps are used?  Like say I have skpe and I talk to a friend for over 3 hours, could someone look and see that I did that without having my skype or iphone?

    Is it possible to monitor when apps are used and how long they have been used for?  Like say I have skpe or oovoo and I talk to a friend for over 3 hours, could someone look and see that I did that and how long I did it for without having my skype or iphone?

    We are having an identical issue with Photos. I'm able to add information and keywords when they're in my library, but as soon as I share them, all of that information disappears. I'm hoping it's possible because it's a much nicer way to browse shared photo albums than Dropbox.

  • SQL within PL/SQL block

    This question sound funny. I just want to make sure this rule. In Oracle database before 10g, we can only use DML and transaction control code within PL/SQL block. We can not use DDL or other control languages within PL/SQL block. How about 10g? can I use DDL in PL/SQL block in 10g?
    I have created a procedure to drop all materialized view. Drop object is DDL. I used a piece of code like this:
    v_sql_stmt1 := 'DROP MATERIALIZED VIEW'||v_schema||'.'||x.mview_name;
    EXECUTE IMMEDIATE v_sql_stmt1;
    The procedure was compiled successfully. However, when I run this SP, it generate ORA-00905 missing keyword error on EXECUTE IMMEDIATE statement part. Is this caused by missing keyword in sql statement or DROP as DDL can not be used in PL/SQL block? If it is first one, what is the keyword for DROP MATERIALIZED VIEW statement?

    The versions of Oracle that run on this planet have been able to do DDL in PL/SQL for quite some time now. The DBAs who blasted off into space with you and worked in a vacuum the past however many years you feel you've been limited by this need to be replaced or re-introduced to Oracle.
    For what it's worth, the error looks like you're missing a space.

  • My internet is really slow when others are using i...

    Hey my internet is really slow when other people use it.
    Also it is a problem when i'm xbox live, i'll be playing a game and when someone else in the house is on BBC i player, it skips like mad and its so frustrating to play on, in fact its unplayable.
    I just want to know if there is a way to fix this,
    I have BT broadband and i have the black hub.
    I have no ideas about computers and internet so i really dont know what to do about this!
    any help would be much appreciated, thank you xx

    thank you,
    here are my results from the hub;
    ADSL line status
    Connection Information
    Line state Connected
    Connection time 7 days, 00:33:53
    Downstream 1,824 Kbps
    Upstream 448 Kbps
    ADSL Settings
    VPI/VCI 0/38
    Type PPPoA
    Modulation G.992.1 Annex A
    Latency type Interleaved
    Noise margin (Down/Up) 14.8 dB / 14.0 dB
    Line attenuation (Down/Up) 55.7 dB / 31.5 dB
    Output power (Down/Up) 2.8 dBm / 1.3 dBm
    Loss of Framing (Local/Remote) 0 / 0
    Loss of Signal (Local/Remote) 0 / 0
    Loss of Power (Local/Remote) 0 / 0
    FEC Errors (Down/Up) 1627 / 261
    CRC Errors (Down/Up) 385 / 189
    HEC Errors (Down/Up) 1544 / 147
    Error Seconds (Local/Remote) 279 / 95
    and here are my results from the speed test
    1. Best Effort Test: -provides background information.
    Download Speed
    1143 Kbps
    0 Kbps 2000 Kbps
    Max Achievable Speed
    Download speedachieved during the test was - 1143 Kbps
    For your connection, the acceptable range of speedsis 800-2000 Kbps.
    Additional Information:
    Your DSL Connection Rate :1824 Kbps(DOWN-STREAM), 448 Kbps(UP-STREAM)
    IP Profile for your line is - 1250 Kbps
    The throughput of Best Efforts (BE) classes achieved during the test is - 12.94:24.68:62.38 (SBE:NBEBE)
    These figures represent the ratio while sententiously passing Sub BE, Normal BE and Priority BE marked traffic.
    The results of this test will vary depending on the way your ISP has decided to use these traffic classes.
    2. Upstream Test: -provides background information.
    Upload Speed
    364 Kbps
    0 Kbps 448 Kbps
    Max Achievable Speed
    >Upload speed achieved during the test was - 364 Kbps
    Additional Information:
    Upstream Rate IP profile on your line is - 448 Kbps
    We were unable to identify any performance problem with your service at this time.
    It is possible that any problem you are currently, or had previously experienced may have been caused by traffic congestion on the Internet or by the server you were accessing responding slowly.
    If you continue to encounter a problem with a specific server, please contact the administrator of that server in the first instance.

  • How to deal with dynamic selection screen elements when macros are used?

    Hello experts,
    This is regarding the dynamic selection screen elements. Actually the requirement is to modify the existing standard report program RFUMSV00 by copying it into a Z report, adding a few selection screen elements and new fields in the output. I actually did everything required except for the one thing that is going out of my reach.
    There are a certain fields which are coming when they are not supposed to get displayed. I don't understand the code because of its obsoleteness. Neither can I debug it because it is just data declaration.
    This is the code where there is a fault. If I copy the entire code into a new Z report, I'm getting new fields like Entry Date, Document Type, Reference Transaction,  Reference key, Logical system.
      DEFINE selection_screen_line.
      selection-screen: begin of line.
      parameters &3 like &4 default 'X' modif id mc4.
      selection-screen: comment (30) &1 for field &3 modif id mc4.
      selection-screen: comment pos_low(10) text-019
                        for field &2 modif id mc4.  "neu
      parameters &2 like rfums_alv-variante modif id mc4.
      selection-screen:
          position pos_high.
      selection-screen: pushbutton (15) text-028
                        user-command &5 modif id mc4.
      selection-screen end of line.
    END-OF-DEFINITION.
    Kindly, suggest me the right solution.

    In the program attributes ( SE38 > RFUMSV00 > GOTO > Properties ), you will find a logical database BRF declared. The include DBBRFSEL is part of the selection screen of this logical database.
    The selection screen is actually the selection screen of this logical database.
    Under the Logical Database field, there is a Selection screen field where you can input which selection screen of the logical database to be used.
    But, this is just to change the selection screen that is displayed. To completely suppress it you need to remove logical database declaration from the properties of the program and call it inside your program through function module.
    You cannot just remove it from the declaration because many of its variables are used in the program.
    So call it using function module as the first step in INITIALIZATION section of the program.
    The syntax and function module to call it in your program can be found in the following thread :
    How to hide the selection screen of a Logical datebase?
    Regards,
    Ashish

  • Getting Error when we are using same variable value in parallel flows

    Hi All
    In one of the case we will get a Zipped folder in which we have 4 different types of files . we will have date in folder name . we want to insert that date in all the 4 types file data . so we are storing the filedate in a variable and we are planning to
    insert that variable value in all the 4 types files . when we are loading data  in parallel of those 4 files (if the folder size is less than 20MB there is no problem )  we are getting the below error . If we run them in Sequence it is working
    fine without error . Please suggest what will be the issue .
    [OLE DB Destination [132]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
    [OLE DB Destination [132]] Error: There was an error with input column "filedate" (523) on input "OLE DB Destination Input" (145). The column status returned was: "The value could not be converted because of a potential loss of data.".
    [OLE DB Destination [132]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "OLE DB Destination Input" (145)" failed because error code 0xC0209077 occurred, and the error row disposition on "input "OLE
    DB Destination Input" (145)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE DB Destination" (132) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (145). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the
    failure.
    Surendra Thota

    Hi Surendra,
    It might be a data type casting issue caused by memory pressure. Please try to use the minimal length of data types that meet the requirements. Besides, if the package runs in 32-bit runtime mode, try to execute it in 64-bit runtime mode. In addition, if
    the issue is not happening in the production environment, I suggest that you install the latest Service Pack for your SQL Server 2008 (R2).
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • How to generate an .xsl , XML data schema when we are using BI publisher

    We are using BI publisher to generate our invoices
    and we are using 3 rd party to print invoices and mail invoice to customers on our invoice template
    We are planning send XML payload to the 3rd party.
    How can we send the 3rd party our xml schema and our style sheet (.xsl file)
    This is question asked at demo at Starbucks

    Print from what? If you aren't licensing ID for the sales staff that sounds like they print from PDF. I don't know anything about Easy Catalog, but I don't think there's any way to edit the PDF using it.
    I think you should ask the folks at Easy Catalog about this, and maybe post the question over in ID scripting. It may be possible to write a script that will automatically update the PDF when the ID file is closed or saved, which I suspect is about as close as you are going to come to what you want. InDesign Scripting

  • #Error & #Syntax when we are using merged dimension in BO4.1 SP3

    Dear All,
    We are using BO4.1 SP3 and Bex query as datasource.
    When we are trying to take merged dimensions in Report block its giving #Syntax Error.
    When we are defining variable with merged dimension, its giving #Error message and the merged dimension is deleted from the definition.
    Please guide how can I use merged dimension.
    Kindly let us know if there are some update required in the current BO version.
    Warm Regards,
    Sonal

    First things abt merge dimension is that merge is applicable only on dimension not on measures.
    And other is dimension that are going to be merge should have same data type.
    I think you should check these conditions then it will works.
    Merge is nothing but full outer join between two data providers. It helps joining two result sets on webi level.
    Kindly attach your screen shots so that it would be helpful.

  • How do you know when you are using the internet?

    If I am using an app that requries internet, and I press the middle button to get out of it am I still using part of my data plan?

    While you are using the app if you are not on WiFi you are using the internet. If the app is one of the few that can run in the background you need to close it to stop it from using your data plan. Double click the home (middle) button, hold down your finger on the app, when you see a red circle with a dashed white line next to the app icon tap it, press the home button.

Maybe you are looking for