Performance: call packages from APEX is slow

Hi
we have a complexe authorization, authentication and policy concept. We have encapsulate a lot of functions into a seperate package. Functions and procedures of this package gets called at different places in three different applications. I know if a package function ie. get's called in a report query it could be very slow because it get's called not one time for one row, it sometimes get's called 5 or 10 times for one row. It's always better to join tables and information into reports.
Problem is, we have two instances and in one instance, the application is "running". In the other instance, the application is f*****g slow...
So I read about pinning of packages and problems with session pooling and session cached cursors.
First question is, what excatly happens if I pin a package into memory and what are the prerequisites to do that? Could this realy improve the performance dramatically?
Second question is, could there be some problems of session pooling or can we increase the amount of session that could be pooled so that packages get be chached?
Do you have some more information, links or ideas to increase performance? or caching of packages? or some other tricks like overwriting V(xxx) syntax?
Thanks in advance!

Greetings,
As mentioned in the above post, pinning packages can help with the overhead of packages being loaded and reloaded after being swapped out. If you follow the link and read the blog post, you'll get a good idea of what happens when you Pin a package and how to actually do it.
But more to the point you need to know where your code is "failing to be performant". Luckily there are a number of things that you can do to pinpoint what portion of the code is slow and why.
DBMS_PROFILER allows you to get information about the execution of your PL/SQL packages, including how many times a particular line of code was executed and how long it took to run. This is very useful information when trying to diagnose PL/SQL. However DMBS_PROFILER doesn't give you a 100% picture of what is going on, as it lumps the execution of SQL in with the execution of PL/SQL.
DBMS_HPROF (available on 11g) is similar to DMBS_PROFILER in that it tells you what your code is doing, but it adds the ability to look at the data hierarchically (with parents and children) and to split the execution of PL/SQL from the execution of SQL queries.
There is an Open Source project called the Instrumentation Library for Oracle (ILO) that allows you to instrument your code and collect data about it's response time as well as capture accurately scoped 10046 trace data. Originally authored at the performance experts at HOTSOS (Where I should say, I used to work), the project is now stewarded by Method-R and continues to be expanded.
Speaking of 10046 trace, APEX is actually instrumented so that with a small addition to the URL, you can generate a 10046 Level 12 trace of the session that processes and renders a page. Run that through TK-PROF, SQL-DEV or The Method-R/Hotsos Profiler, and you'll see a full accounting of the time taken.
Another thing you can do is to make sure you're not executing the same code over and over to get the same result. If the result of a particular function or query will be the same for the life of a session, then execute it only once and store the result in a Package Variable. Accessing the package variable is far less overhead than continually executing a query or function even though the result might be cached.
Although there are myriad approaches to tuning code, it all basically starts with identifying where the problem is. The above methods will definitely help you get to the root cause and once you have something more specific to attack, please let us know and I'm sure many of us would be happy to jump in and help.
Hope That Helps,
- Doug Gault -
http://sumnertech.com/

Similar Messages

  • Calling package from another package

    Hi gurus,
    Quick question
    Say i m in user1 schema.
    I want to call package from another package in the same schema. So do i need to grant permission to the calling package to call.Thank you!!

    Why don't you test it?
    create or replace package pack2
    is
      procedure t2;
    end;
    Package created.
    create or replace package body pack2
    is
      procedure t2
      is
      begin
       dbms_output.put_line('Inside Pack2 And t2');
      end;
    end;
    Package Body created.
    create or replace package pack1
    is
      procedure t1;
    end;
    Package created.
    create or replace package body pack1
    is
      procedure t1
      is
      begin
        pack2.t2;
        dbms_output.put_line('Inside Pack1 And t1');
      end;
    end;
    Package Body created.
    begin
    pack1.t1;
    end;
    Inside Pack2 And t2
    Inside Pack1 And t1
    Statement processed.
    0.11 secondsRegards.
    Satyaki De

  • Run Procedure/Package From APEX

    I want to be able to run a procedure/package from within APEX. The procedure is referenced from multiple sources, so I don't want to place it in APEX, it needs to stay in the package. There is no returning data. I have APEX 3.0 and 10g. It goes without saying that I'm very new to APEX, since I'm sure this is not a difficult process to perform. Thanks.

    Hi Jari,
    Finally got it to work. I created a Button that would trigger the Process. In addition to creating the Process, I had to create a Branch.
    So thanks to your direction, it is working.

  • Getting error when calling package from master

    Hi ,
    I am facing one issue ,
    when i am running package indivisually its running fine , but when I am calling same package from Master package it gets failded.
    below is the error massage which I am getting.
    "Exception has been thrown by the target of an invocation"
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi Vipin,
    In addition, here is an article regarding how to execute a package from another package for your reference. Please see:
    http://svangasql.wordpress.com/2012/05/01/parent-child-package-ssis-2012-execute-package-task/
    Please help to elaborate your issue with more detail so that we can help you to solve this issue in a effecive manner.  
    Elvis Long
    TechNet Community Support

  • Calling package from java using JNDI properties

    Hi there,
    I have created an interface to transfer data from oracle to JMS XML Queue. It is inside a package and have generated a scenario.
    The scenario works well when executed from the ODI designer. When I execute it from java it throws an error. The error is
    java.sql.SQLException: Cannot load connection class because of underlying exception: 'javax.jms.JMSException: Cannot create the initial JNDI context
    Is there any ways to set the JNDI properties, (any set methods for ODIConnection object)
    Cheers

    Are you serious with that question? Did you try to build the web service client before? Because this is exactly the same. Try to find "building web service clients" instead "Calling BPEL from java". By default (probably) every BPEL process has both WSIF and SOAP end points, just use correct WSDL address.

  • Help with calling packages from crystal reports

    hi I am trying to call a package from crystal reports, but geting an error
    Failed to open a rowset
    4200:datadirect:odbcdriver:odbc oracle driver: unrecognised escape sequence.
    im sure its somthing realy stupid im doing wrong any ideas????
    the command in crystal is
    {CALL  Enhanced_Pharos_Report.run_report
    (NVL({?var_detail_id},0))}
    the package, which works as a stand alone object is
    ----------spec------------------
    create or replace package Enhanced_Pharos_Report
    AS
    TYPE result_set_type IS REF CURSOR;
    PROCEDURE run_report
    (var_detail_id NUMBER, v_Media_Object_Name out varchar2);
    end;
    -----------body-----------------------
    create or replace package body Enhanced_Pharos_Report as
    v_Media_Object_Name varchar2(300);
    function Media_Object_Name(var_Detail_id Number) return varchar2 as
    Result varchar2(300);
    begin
    SELECT promo_name
    INTO Result
    FROM promo
    WHERE promo_id = (SELECT promo_id
    FROM promo_plan
    WHERE promo_plan_id = (SELECT promo_plan_id
    FROM event_promotion
    WHERE detail_id = var_Detail_id));
    return(Result);
    end Media_Object_Name;
    PROCEDURE run_report
    (var_detail_id NUMBER, v_Media_Object_Name out varchar2)
    is
    begin
    v_Media_Object_Name := Media_Object_Name (var_detail_id);
    end;
    end;

    Are you able to view your report on the browser in the format:
    http://myserver:portno/report_name.rpt

  • Call vbscript from Apex button

    I have added a vbscript to the header section of my page and I'm trying to call this from a button. Is this possible? Can anyone post an example of how this would be done. I've tried calling from the URL redirect section, along with many other things and can't get anything to work. I'm not sure if I added in the header wrong or if I'm calling it wrong.
    Thanks

    What about placing outputs from the procedure to fields on the form?
    Here is the procedure I have created:
    procedure vatTotal (Order_no IN number,Total2 OUT number)
    AS
    CURSOR c_vatTotal is
    select order_line.quantity, gre_product.cost from ord, gre_product, order_line where ord.order_no = order_line.order_no AND
    gre_product.prod_no = order_line.Product_no;
    Total number;
    begin
    Total:= 0;
    for c_record in c_vatTotal loop
    Total := Total + c_record.quantity * c_record.cost;
    end loop;
    Total2 := Total;
    end;
    I believe this is correct. It compiles.
    I tried using Total as an out parameter but received the "duplicate fields in RECORD, TABLE or argument list are not permitted" error.

  • Want to any calling package from thailand to india

    Kindly help me with rthe package for calling form thailand to india

    You must have a credit card registered to a valid address in the U.S in order to buy from the U.S. store. Do you meet that criteria? Are you visiting Thailand?

  • How to call OWB Process Flow from APEX?

    Hello.
    I was wondering if there is a way that I can have a OWB process flow kick off from a button in APEX? I know you can have APEX perform PL/SQL upon being clicked, so I am wondering if there is a way that I can do the same for a process flow? We are looking to have a manual kick off for a job and we are trying to use APEX for this. Any information would be great!
    Thank you

    Hi,
    Using SOAP ?if there is a way ... please provide some examples.
    I finished my EDQ process, and now i am trying to find how to call it from APEX
    My web service WSDL is
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header/>
      <soap:Body>
        <dn:request xmlns:dn="http://www.datanomic.com/ws" id="?">
          <dn:record>
            <dn:ID>?</dn:ID>
          </dn:record>
        </dn:request>
      </soap:Body>
    </soap:Envelope>You did not state your Apex version. If you are on 4.x then see
    Creating a Web Service Reference Based on a WSDL
    Cheers,

  • Problem when calling BPEL process (WS) from APEX

    I am trying to add a web service call to a BPEL process I have created (tried a few others aswell), but every time I try to add the WDSL file I get the following error:
    *1 error has occurred*
    The WSDL document contains multiple SOAP bindings. Application Express only supports WSDL's with one SOAP binding. Click Create Web Service Reference Manually to continue creating a reference for this service.
    It is a simple BPEL process which works fine when called from the BPEL Console, however I have no success when calling it from APEX.
    Am I doing something wrong, or is there a bug in BPEL/APEX?
    Oracle BPEL Console v10.1.3.1.0
    Apex: 3.2
    The WDSL looks like this:
    <definitions name="BPELProcess9" targetNamespace="http://xmlns.oracle.com/BPELProcess9">

    <types>

    <schema>
    <import namespace="http://xmlns.oracle.com/BPELProcess9" schemaLocation="BPELProcess9.xsd"/>
    </schema>

    <schema>
    <import namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing" schemaLocation="http://xxx:8888/orabpel/xmllib/ws-addressing.xsd"/>
    </schema>
    </types>

    <message name="BPELProcess9ResponseMessage">
    <part name="payload" element="tns:BPELProcess9ProcessResponse"/>
    </message>

    <message name="BPELProcess9RequestMessage">
    <part name="payload" element="tns:BPELProcess9ProcessRequest"/>
    </message>

    <message name="WSAReplyToHeader">
    <part name="ReplyTo" element="wsa:ReplyTo"/>
    </message>

    <message name="WSARelatesToHeader">
    <part name="RelatesTo" element="wsa:RelatesTo"/>
    </message>

    <message name="WSAMessageIDHeader">
    <part name="MessageID" element="wsa:MessageID"/>
    </message>

    <portType name="BPELProcess9Callback">

    <operation name="onResult">
    <input message="tns:BPELProcess9ResponseMessage"/>
    </operation>
    </portType>

    <portType name="BPELProcess9">

    <operation name="initiate">
    <input message="tns:BPELProcess9RequestMessage"/>
    </operation>
    </portType>

    <binding name="BPELProcess9Binding" type="tns:BPELProcess9">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="initiate">
    <soap:operation style="document" soapAction="initiate"/>

    <input>
    <soap:header message="tns:WSAReplyToHeader" part="ReplyTo" use="literal" encodingStyle=""/>
    <soap:header message="tns:WSAMessageIDHeader" part="MessageID" use="literal" encodingStyle=""/>
    <soap:body use="literal"/>
    </input>
    </operation>
    </binding>

    <binding name="BPELProcess9CallbackBinding" type="tns:BPELProcess9Callback">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="onResult">
    <soap:operation style="document" soapAction="onResult"/>

    <input>
    <soap:header message="tns:WSARelatesToHeader" part="RelatesTo" use="literal" encodingStyle=""/>
    <soap:body use="literal"/>
    </input>
    </operation>
    </binding>

    <service name="BPELProcess9">

    <port name="BPELProcess9Port" binding="tns:BPELProcess9Binding">
    <soap:address location="http://xxxx:8888/orabpel/default/BPELProcess9/1.1"/>
    </port>
    </service>

    <service name="BPELProcess9CallbackService">

    <port name="BPELProcess9CallbackPort" binding="tns:BPELProcess9CallbackBinding">
    <soap:address location="http://set.by.caller"/>
    </port>
    </service>

    <plnk:partnerLinkType name="BPELProcess9">

    <plnk:role name="BPELProcess9Requester">
    <plnk:portType name="tns:BPELProcess9Callback"/>
    </plnk:role>

    <plnk:role name="BPELProcess9Provider">
    <plnk:portType name="tns:BPELProcess9"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>

    Allow me to reply to my own thread, for the benefit of any others who might want to invoke a BPEL WS from APEX facing the same problem:
    Apex does not seem to like asynchronous BPEL processes so the trick is to make a synchronous BPEL process call the asynchronous BPEL process.

  • Calling procedures from table and apex

    Hi
    I have a stored procedures and I want to put my stored procedures in table and I want to call store procedure from table in apex. how can I do this?
    For example
    I have stored procedures like Students(year number,birimno number) 
    GPA(birimno number,studentno number ) Student Procedure and GPA proecdure retrieve name and lastname
    and I want to create a table
    table has
        Id            Package                 Procedurename                                   Arguments                              Header
          1                                                GPA                                 birimno, studentno                      name, lastname
          2                                                Students                          year, birimno                                name,lastnameSo how can I do like this ? I want to call storeprocedures on APEX with selectlist. Selectlist will has a storeprocedures .
    Edited by: esra aktas on 06.May.2011 01:48
    Edited by: esra aktas on 06.May.2011 01:48
    Edited by: esra aktas on 06.May.2011 04:08

    I am beginner pl/sql .
    I had searched execute immediate for helping my problem.
    My purpose is that I want to collect all of procedures in one table. And I must retrived which I select procedure on APEX Selectlist.
    So I started to create a table which name is procedures and I put my procedures names on it.
    Now how can I execute to procedures that name is in table?
    create or replace
    procedure "ISINIF_BASARI"(normalyariyil number,birimno number )
    IS
    ogrenci_no  VARCHAR2(12);
    ders_kodu  VARCHAR2(12);
    ders_adi   VARCHAR2(50);
    harf_kodu  VARCHAR2(4);
    CURSOR c_basari IS
    select  dk.ogrenci_no,da.ders_kodu,da.ders_adi,dk.harf_kodu
    into ogrenci_no,ders_kodu,ders_adi,harf_kodu
    from ders_aktif da,ders_tanim dt, ders_kayit dk
    where da.ders_kodu like  birimno ||'%'
    and (dt.normal_yariyili=normalyariyil
    OR dt.normal_yariyili=normalyariyil+1)
    and (da.acildigi_donem='1' or da.acildigi_donem='2')
    and dt.ders_kodu = da.ders_kodu
    and dk.acilan_ders_no = da.acilan_ders_no
    BEGIN
    FOR I IN c_basari LOOP
    dbms_output.put_line(' OGRENCI NO '||I.OGRENCI_NO||'  DERS KODU  '|| I.DERS_KODU||'  DERS ADI  '||I.DERS_ADI||' HARF KODU '||I.HARF_KODU);
    end loop;
    end;I have procedure like that.
    and I have a procedures table. And I put the procedure's name in table.
    procedure
    id procname
    1 ISINIF_BASARI
    Now I want to call procedure using this table .
    When I call yhe procedures from table I wrote like this. But it has faults.
    create or replace
    PROCEDURE CALLSPFROMTABLE  as
    v_sql_exp VARCHAR2(100);
    BEGIN
    v_sql_exp :='begin'||'select p.procname from procedure p where id=1'||'end;';
    end;Edited by: esra aktas on 07.May.2011 02:19

  • Regarding tutorial of how to call Oracle Reports from APEX

    Hi,
    I'm trying to call Oracle Reports from APEX using this tutorial.
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_integrate_oracle_reports.html
    But in the step of 'Create the Oracle HTML DB Application', 'OE' doesn't appear in the LOV of Existing Schema, even though the sample schema exists in the schema and they are unlocked. And when I type 'OE' directly without using LOV, and press Next, the message 'Schema is reserved or restricted' appears.
    How can I create the workspace based on OE schema?

    Hello Shohei,
    I know your following the tutorial, but if you want to call oracle reports from apex it is quite easy though if your working with oracle reports 9i or higher. Just create an html region and put in the source the html code for referencing an url like to_report
    Or reference the same url from a button placed on the HTML region
    (you can create a package that would create the whole URL and returns it as a string, easier for scalability)
    Hope this can help you to (tutorial is good but try and learn from scratch is also good ;-) )
    Erwin

  • Calling Oracle Discoverer Report from Apex

    How to call Oracle Discoverer Report from apex application?
    Thanks!

    The report is on a different data base ... need to create a process to get the data into the view behind the report and then materialized view in Apex etc .Then recreate the same report in Apex. But I am trying use the disc report url to invoke the report directly from apex.
    Any suggestions or thoughts are greatly aprreciated.

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How call procedure or package from Oracle BI Publisher 10.1.3.2.1

    Hi Gurus,
    I need to call a procedure or package from Oracle BI Publisher 10.1.3.2.1 by passing parameters, I do it because it would be easier to fill a table as the report that asks for is too complex (8 breaks, 5 dblinks, 20 tables, etc).
    I'm not using the Oracle XML. Review include the following solutions:
    Re: Stored procedures and dynamic columns
    Re: Is it possible to use Stored Procedures in BI Publisher GUI?
    Re: PL/SQL Stored Procedure w/ XML Template?
    But none of them useful for me was the level of complexity.
    Best regards.

    Hi Vetsrini,
    I write the sentence as it showed in the previous thread
    select from whc_kk_v2.whc_p_kk_publisher (pv_msgerror =>: msgerror,*
    pv_pro1 =>: prov_1,
    pv_pro2 =>: prov_2)
    run when I get the error BIP
    ORA-00933: SQL command not properly ended
    Show me I'm doing wrong, or who may be causing the error. I tried everything but does not leave, please your help.
    Best regards

Maybe you are looking for