FETCH Execute in TKPROF.

Hi,
SELECT N_ORIGIN,SUB_ACC_ID,STAT_DATE,TYPE,PAGE_TOT,PAGE_NO,CL_BAL,CL_BAL_DC
FROM
O_950P  WHERE   N_ORIGIN  = :P03137  AND  SUB_ACC_ID  = :P03140  AND 
  TO_CHAR ( ORA_TO_PRO4_DATE ( STAT_DATE ) )  ||  '/'  ||  PAGE_TOT  ||  '/' 
  ||  PAGE_NO  =  ( SELECT  MAX ( TO_CHAR ( ORA_TO_PRO4_DATE ( P.STAT_DATE ) )
    ||  '/'  ||  P.PAGE_TOT  ||  '/'  ||  P.PAGE_NO  )  FROM  O_950P  P 
  WHERE  P.N_ORIGIN  = :P03137  AND  P.SUB_ACC_ID  = :P03140  AND  TO_CHAR (
  ORA_TO_PRO4_DATE ( P.STAT_DATE ) )  ||  '/'  ||  P.PAGE_TOT  ||  '/'  || 
  P.PAGE_NO  != :P03158  ||  '/'  || :P03148  ||  '/'  || :P03153  )
call     count       cpu    elapsed       disk      query    current        rows
Parse        0      0.00       0.00          0          0          0           0
Execute     48      0.03       0.02          0          0          0           0
Fetch       96   1947.78    1904.24          0    1132434          0          48
total      144   1947.81    1904.26          0    1132434          0          48
Misses in library cache during parse: 0
Optimizer mode: RULE
Parsing user id: 13074 
Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                      96        0.00          0.00
  SQL*Net message from client                    96        0.00          0.12
Having this following tkprof output.where it shows execute is actually 48 and fetch 96 . This looks quite wierd to me.Any ideas ?

Optimizer mode: RULE ????
What about this?
Shiva.

Similar Messages

  • Diference bte fetch into statement fetch bulkcollect into statement.

    hi,,
    difference btw fetch into statement and bulk collect into statement.
    differece btw for loop and forall loop.

    Hi,
    Syntax:
    (Select)(Fetch)(execute immediate) … BULK COLLECT Into collection_name [,collection_name, …] [LIMIT max_lines] ;
    LIMIT is used to limit the number of rows returned.
    BULK COLLECT can also be used to retrieve the result of a DML statement that uses the RETURNING INTO clause:
    SQL> Declare
    2 TYPE TYP_TAB_EMPNO IS TABLE OF EMP.EMPNO%Type ;
    3 TYPE TYP_TAB_NOM IS TABLE OF EMP.ENAME%Type ;
    4 Temp_no TYP_TAB_EMPNO ;
    5 Tnoms TYP_TAB_NOM ;
    6 Begin
    7 -- Delete rows and return the result into the collection --
    8 Delete From EMP where sal > 3000
    9 RETURNING empno, ename BULK COLLECT INTO Temp_no, Tnoms ;
    10 For i in Temp_no.first..Temp_no.last Loop
    11 dbms_output.put_line( 'Fired employee : ' || To_char( Temp_no(i) ) || ' ' || Tnoms(i) ) ;
    12 End loop ;
    13 End ;
    14 /
    Fired employee : 7839 KING
    try to understand this example.i think it is sufficient.
    Thanks,
    Sanjeev.

  • SQLJ and reparsing?

    My trace outputs show that when using SQLJ it seems that all
    statements being used seem to be reparsed whenever they are
    used (identical parse/execute/fetch counts from tkprof). Is
    there any way in SQLJ to do a sort of PREPARE for e.g. e SELECT
    or UPDATE and then just re-execute it, avoiding the re-parsing
    overhead?
    Thanks,
    Erwin
    null

    Oracle Product Development Team wrote:
    : Unfortunately NO in 8i
    : But the good news is that we are working on
    : Statement Caching and this feature should be available
    : in 8.1.6
    : Erwin Heute (guest) wrote:
    : : My trace outputs show that when using SQLJ it seems that all
    : : statements being used seem to be reparsed whenever they are
    : : used (identical parse/execute/fetch counts from tkprof). Is
    : : there any way in SQLJ to do a sort of PREPARE for e.g. e
    SELECT
    : : or UPDATE and then just re-execute it, avoiding the re-
    parsing
    : : overhead?
    : : Thanks,
    : : Erwin
    : Oracle Technology Network
    : http://technet.oracle.com
    Thanks for the info. I'll be looking forward to it.
    Regards,
    Erwin
    null

  • Massive IMAP problem, multiple iPhones - constant spinning wheel

    A friend has had problems using email on his iPhone since he got it, and now after a couple of months of no problems, mine has started doing the same thing.
    The problem started for him on a UK 1.1.2 firmware iPhone with an IMAP account. If you start from scratch, manually setup an IMAP account, it will connect and get your messages. However later, you will find that the iPhone email program is constantly showing the spinning wheel at the top of the screen (showing activity), not the symbol at the bottom of the screen. Worse, the battery rapidly runs down (because it is doing constant data transfers), and worse new emails do not reliably get through. This happens whether you are using GPRS, EDGE, or WiFi (does not make a difference). This problem still happens with 1.1.3 firmware. There is so much data transfer happening (or trying to happen) that the phone actually gets quite warm.
    This week after a couple of months of owning my own iPhone with 1.1.3 firmware has also started doing the same thing. My main IMAP account is on a totally different server, running a different server application to my friends. However it also seems to happen with GMail accounts (using IMAP).
    I am currently at home and I can see my WiFi (AirPort Extreme) base-station showing lots of activity and I know that no other WiFi devices are active so it is purely the iPhone. Turning off the email account stops the problem (and I can then see the WiFi activity stop as well) but that is hardly a solution. Also setting it to manual polling for email helps but again is not a proper solution. It is so bad that sending emails is very difficult as well.
    Even though at the iPhone end nothing seems to be coming through, one can see the iPhone as a connected user at the server end (I have access to the servers, obviously not for Gmail though).
    My friend has swapped his phone four times at the Apple Store and still has the problem, and as I said mine has started as well. Turning off and on does not help, resetting network settings does not help.
    Apple Mail on a Mac (running both Leopard and Tiger), and other IMAP clients have no problems with the same IMAP accounts (for both of us).
    Other Internet access like Web, Stock Widget, Weather Widget, even the iTunes WiFi store work fine. It is just email that is broken.

    Pdobry wrote:
    The problem is that Mail app in iPhone is trying to download message headers via FETCH command and does not handle properly response from IMAP server which does not support partial download of email headers. It starts asking for the headers in the infinite loop which quickly drains out the battery
    More recent testing by myself reveals it is getting stuck on some messages when doing the 'message peek' to get the summary of an email. It gets the subjects fine (as the first pass) but then gets stuck on some emails when doing the second pass to get the summary. Apple Mail on a Mac does not (as far as I am aware) do a message peek so does not have this problem.
    The two different makes of server I have seen this problem with do support this message peek command in that at least some of the time it is working with the iPhone.
    I was able to get a debug level log which shows entries like this
    \[02/Apr/2008 23:56:17\]\[48699904\] {imaps} Peek FETCH executed on message 0000ba58 in folder [email protected]/INBOX
    \[02/Apr/2008 23:56:17\]\[48699904\] {imaps} Sent 1 fetch responses
    \[02/Apr/2008 23:56:18\]\[48699904\] {imaps} Command 293 UID FETCH 47704 BODY.PEEK\[2.HEADER\]<1177.15207>
    \[02/Apr/2008 23:56:18\]\[48699904\] {imaps} Peek FETCH executed on message 0000ba58 in folder [email protected]/INBOX
    \[02/Apr/2008 23:56:18\]\[48699904\] {imaps} Sent 1 fetch responses
    \[02/Apr/2008 23:56:18\]\[48699904\] {imaps} Command 294 UID FETCH 47704 BODY.PEEK\[2.HEADER\]<1177.15207>
    The above shows two repetitions but it keeps on (and on, and on). Other occasions show this does work for other messages. If I deliberately arrange to get the iPhone to connect to get the latest messages I can see it get stuck on a particular message, and then even if I turn it off and back on and reconnect it will get stuck on the same message. If repeated on a later date then the contents of the inbox will have changed and the message it gets stuck on will be different.
    As it seems to be linked to specific messages it was not a surprise that when this is tried on a practically empty email account the problem does not occur.
    This has happened with multiple different makes of mail server (well at least two), multiple email accounts, multiple users, and multiple different iPhones (one person had his swapped four times). It does not happen with 'ordinary' IMAP client software, only with the iPhone.
    Even if one for arguments sake assumes the mail server is at fault and is sending the iPhone garbage, the iPhone should only try a single specific email a maximum number of times (for example five), and then give up. This would prevent it draining the battery so fast and trying to cook itself (by constantly running its transmitter).

  • Cant syncronize! Threads problem

    Hello everybody,
    recently i posted a question(im new to threads) and it was asked immediately but now i have another
    type of problem.
    Please read here the initial post and the answer and please give me any ideas..
    Initial Post
    Hi everybody,i have this thread problem(i'm new to java and h
    ave no idea what exactly to do).
    Well,in my applet i have this action performed method
    that i imagine is in the event dispatch thread.
    This method calls as u see, two other methods of a class named CPU(.
    Note that fetch and execute are observed classes and my applet class
    is the observer.
    The problem is that during the execution of fetch() and execute(),
    inside these methods change some things and so they call notifyObservers(Object arg)
    passing to the applet the argument and so the applet updates some text components.
    But as you can immagine there is no time for the gui to update himself so i see nothing.
    So, my question is which of the methods need to be in a separate thread so to ensure
    visible results(component updating)?
    Perhaps,the update method needs to be invokedLater with SwingUtilities?
    Please give me an example code if possible.
    Here is the actionPerformed code(from the applet class) and the fetch method:
        void executeProgramButton_actionPerformed(ActionEvent e) {      
    int numInstr = this.machine.ram.segmentSize;       
    for (int i = 0; i < numInstr; i = i + 4) {           
    machine.cpu.fetch();           
    machine.cpu.execute();       
    /*The following method is in the CPU class
    fetch method:here the observedPC is the observable value
    that notifies the observer(the main applet)
    that does: pcTextField.setText(arg.toString());*/   
    public void fetchInstructionProgram() {       
    observedPC = Integer.toString(pc);       
    setChanged();       
    notifyObservers(observedPC);       
    instructions++;       
    instruction=readOperation(cache.instructionfetch,pc);       
    pc = pc + 4;    }
    Answer to initial post
    Author: stevejluke
    One way could be to put the content of the action performed method into a new thread, then use invokeLater in your Observers that cause GUI updates:
        void executeProgramButton_actionPerformed(ActionEvent e) {     
    new Thread()       {      
    public void run()        {         
    int numInstr = this.machine.ram.segmentSize;         
    for (int i = 0; i < numInstr; i = i + 4)           {           
    machine.cpu.fetch();           
    machine.cpu.execute();         
    }.start();    }
    // In your Observer    public void update(Observable o, Object arg)    {     
    SwingUtilities.invokeLater(new Runnable() {      
    public void run()        { 
    /* your GUI afecting code
    });[i]
    Or something like that.
    You might need to watch for synchronizing things
    He was right...GUI is responsive but the results...
    Well,let me describe the new problem.
    Here you cant see the method execute().
    The problem is a synchronization problem.
    Actually,what the two methods do is:fetch() updates the value of a long called instruction and execute() takes this value and do some things.Note also that the time the execute method needs to finish is not
    always the same.By that, i mean that it depends on the value of the instruction updated by fetch().
    By putting some System.outs before and after updating i realized that there are delays or sometimes
    i noticed that fetch() executes 2 times before execute() takes control.
    So,i created some synchronized private methods set and get to control access to these resources.
    Better but still not correct...
    What should i look?Where stays the answer?
    How to synchronize these two methods on these resources?
    Thank you in advance,
    Chris

    I think that your fetch and execute has a "Producer-Consumer Relationship"
    in such cases you can make the producer place the produced value in to a queue and consumer take the vlues from the queue
    In the producer thread it sleeps for a while and try again if the Queue is full
    In the Consumer thread it sleeps for a while if the Queue is empty and then try again
    Or you can do as follows
    In the Producer thread it waite() if the Queue is full
    In the Consumer thread it waite() if the queue is empty
    When ever Producer put a value in to the Queue it calls the notify on Consumer and when ever Consumer takes a value from Queue it calls the notify() on Producer
    you can even use notify all
    I think thiere is no built in Queue class in java so you will have to write one here is a example
    public class MyLongQueue{
                long data[];
                int head, tail;
                int size;
               public MyLongQueue(int size){
                    data = new long[size];
                    head = -1;
                    tail = -1;
                    this.size = 0;
                public synchronized boolean isFull(){
                    return (size==data.length);
                public synchronized boolean isEmpty(){
                    return (size==0);
                public synchronized boolean  insert(long l){
                    if (size==data.length) return false; //Queue is full cant add more data
                    tail = (tail + 1) % data.length;
                    data[tail] = l;
                     size++;
                    return true;
               public synchronized long remove(){
                   if (size==0) throw new ArrayIndexOutOfBoundsException();
                   size--;
                   head = (head + 1) % data.length;
                   return data[head];

  • ORA-02393: exceeded call limit on CPU usage -- Concept Understanding is req

    In our System CPU_PER_CALL is set to 1.5 Hours for Reporting Users.
    I can see some query runs for 10 hours-15 hours and complete successfully and some queries fail exactly after 1.5 hours.
    I want to understand what does CPU_PER_CALL Means. On what basis it calculates CPU_PER_CALL ( Fetch , Execute , parse). How a query is calculating time ?
    With the same profile options some queries run for 10 hours but some queries fail after 1.5 hours.
    Regards
    Sourabh Gupta

    The short answer is that different queries wait on different sorts of events. Let's assume that the only 2 wait events in the world are waits for CPU and waits for I/O (there are many other types of waits but most reporting queries will primarily be waiting for these two resources). If you have a query that runs for 15 hours but spends 14.5 hours waiting on I/O and only 0.5 hours on the CPU doing comparisons and/or calculations, the CPU usage for that query is only 0.5 hours. Another query might run for 1.51 hours and do 0.01 hours of I/O and spend 1.5 hours on the CPU calculating various aggregate values for that data. The second query would use 1.5 hours of CPU (and thus exceed your CPU_PER_CALL) while the first query would only use a third as much CPU.
    Oracle profiles allow you to specify a number of different limits so that you can specify limits on CPU usage (CPU_PER_CALL/ CPU_PER_SESSION) or I/O usage (LOGICAL_READS_PER_CALL/ LOGICAL_READS_PER_SESSION) or a combination of the two (COMPOSITE_LIMIT).
    Justin

  • Whisch one is correct for undo_retention and what is the difference

    Hi ALL,
    whisch one is correct for undo_retention and what is the difference
    SQL> select max(maxquerylen) from v$undostat;
    MAX(MAXQUERYLEN)
    6060
    SQL> select max(maxquerylen) from dba_hist_undostat;
    MAX(MAXQUERYLEN)
    17221

    hi Afzal,
    you can use begin_time & end_time of v$undostat -> to specify the time interval of your interest.
    A brief note, of what you have discussed here:
    maxquerylen
    Identifies the length of the longest query (in seconds) executed in the instance during the period. You can use this statistic to estimate the proper setting of the UNDO_RETENTION initialization parameter. The length of a query is measured from the cursor open time to the last fetch/execute time of the cursor. Only the length of those cursors that have been fetched/executed during the period are reflected in the view.
    V$UNDOSTAT is dynamic, showing current stats.
    DBA_HIST_UNDOSTAT displays the history of histograms of statistical data to show how well the system is working. The available statistics include undo space consumption, transaction concurrency, and length of queries executed in the instance.This view contains snapshots of V$UNDOSTAT
    hope it help.
    regards,
    X

  • Prepared=True Not working. Parse:Execute ration is one in tkprof report

    Hello,
    DB Version 9.2.0
    OS NT
    Provider: OraOLEDB 9.2.0.1.0
    I have a small .NET application. I use bind variables all overe my application. But my parse:execute ratio is 1 for some of all SELECT statements. There are many softparses in my application. I have also set session_cached_cursors.
    While using ADODB command object I set the "Prepared" parameter to true. But even though
    there are many parses.
    Heres is the simple block of code ..
    strCmd = "SELECT DISTINCT TO_CHAR(exp_date,'Month') Months, " _
    TO_CHAR(exp_date,'MM') MM FROM expenses ORDER BY MM"
    cmd1 = New ADODB.Command()
    cmd1.ActiveConnection = cConn
    cmd1.CommandText = strCmd
    cmd2 = New ADODB.Command()
    cmd2.ActiveConnection = cConn
    cmd2.CommandText = strCmd
    cmd2.Prepared = True
    For intLoop = 1 To 4
    cmd1.Execute()
    Next intLoop
    For intLoop = 1 To 4
    cmd2.Execute()
    Next intLoop
    Heres the tkprof trace output
    SELECT DISTINCT TO_CHAR(exp_date,'Month') Months, TO_CHAR(exp_date,'MM') MM
    FROM
    expenses ORDER BY MM
    call count cpu elapsed disk query current rows
    Parse 8 0.00 0.00 0 0 0 0
    Execute 8 0.04 0.06 0 0 0 0
    Fetch 8 0.01 0.01 0 56 0 226
    total 24 0.06 0.07 0 56 0 226
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 62
    Rows Row Source Operation
    23 SORT ORDER BY
    23 TABLE ACCESS FULL EXPENSES
    Logically it should be one parse and 8 execution. Will anybody please suggest me, how do I minimise the number of parses?
    Thanks in advance
    Sameer

    "db file parallel read" is likely to be associated with something like index prefetching.
    See:
    http://www.freelists.org/post/oracle-l/RE-Calculating-LIOs,11
    http://aprakash.wordpress.com/2012/05/29/index-range-scan-and-db-file-scattered-read-as-session-wait-event/
    http://jonathanlewis.wordpress.com/2006/12/15/index-operations/
    Tune the SQL.
    Review the execution plan.
    Check whether the statistics are accurate.
    Review whether the index hint (and others that we can't see) is appropriate.

  • 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)

  • Database parse execute and fetch shows 9 counts.

    for one of the SQLs, database parse execute and fetch shows 9 counts along with query - fetch 21 the rows - fetch shows 2,
    I also observe the below for the other sql statements,
    this stats have been collected by level 12 trace and then generating tkprof. please let me know few relevant links / notes through which can dig further into this.
    call count cpu elapsed disk query current rows
    Parse 10 0.01 0.00 0 0 0 0
    Execute 33 0.01 0.00 0 0 0 0
    Fetch 33 0.00 0.00 0 199 0 33
    total 76 0.02 0.01 0 199 0 33
    Regars.

    Exactly, you have understood it right(Sorry i was way involved with this tkprof when I initially posted the thread) .
    I've couple of sql's in my tkprof(leverl 12 trace) which are showing similar results and looks like its doing lot of work and fetching less number of rows.
    Bbackground
    1.A program was taking less than a minute to complete and now it is taking approximately 30 mins( The data being fetched is all the same) ..
    2.There are no changes applied to the database since last run.
    3.DB - 10.2.0.3.0
    would like to know ways to dig further into it.

  • Error executing a Oracle query when connection is fetched from Datasource

    Hi Folks,
    I am struggling with a rather wierd issue. The DBA of my application has exposed some function based view(not exactly sure what that means) which returns results like any query over a table. I am having a tough time consuming it in my java application. The name of the view is - `networknode_api.get_ftapp_networknode_hrchy` The SQL for it is(syntax might be a bit strange as there is actual word `table` in the query)
    view plaincopy to clipboardprint?
    Note: Text content in the code blocks is automatically word-wrapped
    01.SELECT * FROM table (networknode_api.get_ftapp_networknode_hrchy('19-Feb-2013'));
    SELECT * FROM table (networknode_api.get_ftapp_networknode_hrchy('19-Feb-2013'));
    The query returns a hierarchical result data, provided below is a sample output (ignore the ouput if the formatting is too werid)
    Parent_NODE | Child_NODE | NODE_DISPLAY_NAME | BEGIN_DATE | END_COB_DATE | LVL
    null | CCN | Connent Node | 01/20/2013 | 10/19/2013 | 1
    CCN | AVT | Avg Vol Turn | 01/20/2013 | 10/19/2013 | 2
    AVT | L:2 | L:2 | 01/20/2013 | 10/19/2013 | 3
    AVT | L:6 | L:6 | 01/20/2013 | 10/19/2013 | 3
    CCN | NUT | Nap Up Turn | 01/20/2013 | 10/19/2013 | 2
    I have the following method in my DAO -
    public List<NetworkNodeGroupDTO> fetchNetworkNodeHierarchy(Date cobDate) {
    try {
    InitialContext ic = new InitialContext();
    //DataSource ds1 = (DataSource) ic.lookup("jndiDsFlex");
    //Connection conn = ds1.getConnection();
    /* Using the RmiDataSource class for performance optimizations */
    weblogic.jdbc.common.internal.RmiDataSource ds = (weblogic.jdbc.common.internal.RmiDataSource) ic.lookup("jndiDsNex");
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    boolean hasRows = stmt.execute("SELECT * FROM table (networknode_api.get_ftapp_networknode_hrchy('19-Feb-2013'))");
    rs = stmt.getResultSet();
    while(rs.next()) {
    System.out.println(rs.getString("parent_node"));
    System.out.println(rs.getString("child_node"));
    System.out.println(rs.getString("node_display_name"));
    stmt.close(); stmt = null;
    conn.close(); conn = null;
    } catch(Exception ex) {
    ex.printStackTrace();
    return null; // please ignore the return type for now
    Exception is thrown at line - stmt.execute(....)
    java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier
    I debugged through the code and noted the driver and connection details that the connection object has embedded. Using that I wrote a sample java jdbc code-
    public static void main(String[] args) throws Exception {
    try {
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //Class.forName("weblogic.jdbc.rmi.Driver");
    Driver myDriver = (Driver) Class.forName("weblogic.jdbc.jts.Driver").newInstance();
    } catch (ClassNotFoundException e) {
    System.out.println("Where is your Oracle JDBC Driver?");
    e.printStackTrace();
    return;
    Connection connection = null;
    try {
    connection = DriverManager.getConnection(
    "jdbc:oracle:thin:@//ssn20331020-rt.eu.prog.net:1522/NEXSERV",
    "sample",
    "sample1234");
    } catch (SQLException e) {
    System.out.println("Connection Failed! Check output console");
    e.printStackTrace();
    return;
    Statement stmt = connection.createStatement();
    stmt.execute("SELECT * FROM table (flex_compnode_api.get_ftapp_compnode_hrchy('19-Feb-2013'))");
    ResultSet rs = stmt.getResultSet();
    int i = 0;
    while(rs.next()) {
    String pNode = rs.getString("parent_node");
    String cNode = rs.getString("child_node");
    String dName = rs.getString("node_display_name");
    System.out.println("Hello: "+i++);
    The above code works perfectly fine. Also tried the above code using normal Oracle JDBC driver and too works fine. I am baffled; what goes wrong when using the connection from a DataSource object. Does the driver treat SQL statements differently based on how the connection object is obtained? Appreciate your inputs/comments for same.
    The oracle db version is - Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    Application Server - Weblogic 10.3

    Below is the stacktrace and the driver details which are same for both the standalone basic Jdbc program and one where connection is fetched through datasource.
    Driver name: Oracle JDBC driver
    Driver version : 11.2.0.2.0
    Driver major ver: 11
    Driver minor ver: 2
    java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:852)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1890)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1855)
    at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:304)
    at weblogic.jdbc.wrapper.Statement.execute(Statement.java:458)
    at com.rfs.gs.ggl.nex.persistence.jpa.FlagDao.fetchCompositeNodeHierarchy(FlagDao.java:258)
    at com.rfs.gs.ggl.nex.service.mars.GSServiceBean.searchCompositeNode(GSServiceBean.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
    at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
    at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy119.searchCompositeNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
    at $Proxy92.searchCompositeNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:101)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:83)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:152)
    at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:264)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at weblogic.wsee.jaxws.tubeline.FlowControlTube$FlowControlAwareTube.processRequest(FlowControlTube.java:148)
    at weblogic.wsee.jaxws.tubeline.FlowControlTube.processRequest(FlowControlTube.java:99)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:604)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:563)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:548)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:445)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:275)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:250)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:140)
    at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:319)
    at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:232)
    at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:310)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    <Timestamp Fri Feb 22 11:41:19 EST 2013 (1361551279781)>

  • Execute store procedure( in Id, in out RefCursor), and data fetched in ref cursor should be sent out as excel sheet.

    I am trying to make a ssis package that get the data calling the store proc with two param one is ID and other is Sys_refcursor. Say Store Proc as ListName(Id int, myCur sys_refcursor), which gets the datas with the conditions inside it.
    REATE OR REPLACE PROCEDURE schemaName.LISTNAME (P_ID  IN INT, LST_NAME_REFCUR   IN OUT SYS_REFCURSOR)
    IS
    P_NAMESOURCE_ID INT;
    BEGIN
        SELECT SOURCE_ID INTO P_NAMESOURCE_ID FROM SEARCHING_TABLE ST WHERE ST.ID = P_ID;           
                   IF (P_NAMESOURCE_ID=1)
                   THEN
                      OPEN LST_SOURCE_REFCUR FOR 
                            SELECT ST.ID,
                                   ST.TRANSACTION_DATE AS TRAN_DATE,
              IF (P_NAMESOURCE_ID=1)
                   THEN 
                      OPEN LST_SOURCE_REFCUR FOR             ....     
    then i need to get the data from that refcursor and fetch those data to excel sheet to a virtual directory.
    Any help would be appreciated. I am new to SSIS. and i need to do this assignment this friday. 

    Hi 11srk,
    To fetch data from Oracle store procedure, you can use a Script Component as source to call the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please
    see:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices
    http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx  
    Regards,
    Mike Yin
    TechNet Community Support

  • Query not fetching results and shows executing

    All,
    When I run a query from SQL Plus I am getting query results immediately table with more than 50,000 rows), but when I run from TOAD or PL/SQL Developer am not getting any result and all I see is query executing no error message also.
    Surprising part is I am able to see results if the table is less than 100 rows in SQL Plus, TOAD and PL/SQL Developer.
    Please tell me is there anything I have to do in the database configuration, I am facing this issue due to database move to a new server.
    Thanks in advance

    Anand,
    I don't see this as an issue with TOAD or PL/SQL Developer, the reason is using my TOAD or PL/SQL Developer I am able to connect to the copy of this database (DEV) and able to fetch results. Only in the database I migrated to the new server I am not able to fetch results from connecting through any application, the only place I am able to run and get results is SQL PLUS.
    So I believe this is something which I am missing in my database configuration or in my new server.
    Please help me
    Thanks in Advance

  • Clients - Parse, Execute, Fetch - Starttime

    Hello guys,
    i have a look at the some php scripts which are connecting to an oracle database and it looks like the following example.
    -> $db = @ora_logon("scott@testdb29","tiger")
    Ok here is a connect done to oracle
    -> $curs = ora_open($db);
    Ok a cursor is opened
    -> $sql = "SELECT * FROM dept"; ora_parse($curs,$sql)
    Ok the sql statement is parsed, with the previous opened cursor
    -> ora_exec($curs);
    Statement is executed
    -> while (ora_fetch_into($curs, $results)) { $results[0]; }
    Fetches from the select data
    In which step does oracle starts to read the data (logical i/o or phyiscal i/o)?
    Does it start at execute or does it start at the fetch?
    When it starts at execute... what happens if i don't fetch the data? for example if oracle had to sort the data in the pga...
    When it doesn't start at execute... what is done on the execute command?
    Are these steps the same in every client (for example sqlplus) or can it vary?
    Thanks and Regards
    Stefan

    Hello Khurram,
    ok no problem ... but the php documentation does not contain this information :-(
    I think that is a general question... i found a german pdf which describes the sql phases of 8i.
    I am translating some parts of it:
    http://members.aon.at/hermann.zauner/Oracle8i.pdf
    Point 2.1 SQL
    -> 2.1.2.1The cursor
    This point is clear
    -> 2.1.2.2 The Open-Phase
    Also clear
    -> 2.1.2.3 The Parse-Phase
    Also clear
    -> 2.1.2.4 The Execute-Phase
    A SCN will be observed in the cursor. This is the guarantee, that a sql statement is always consistent, that means from the sql's point of view, that the data has not changed since the start of the command.
    In case of a select statement with a sort or a group by, the data will be formatted and put in some temporary area ( => i think, the creator of the pdf means the sort area or the temp tablespace)
    -> 2.1.2.5 The Fetch-Phase
    This phase will only be perform in case of a select statement. In the fetch phase the data will be transfered to the client. The data will be read out of data/index blocks or out of the temporary area, which was prepared in the execution phase.
    -> 2.1.2.6 The Close-Phase
    also clear
    Ok but the pdf description is a little bit unexact in the part of the temporary areas and the fetch data.
    Please correct me if i misunderstand the behaviour of the sql execution phases in case of SELECTs
    - The execute phase can contain some data reads (or writes) in cases if the data must be converted (i mean sorts, groups, sums, etc..).
    - A normal "select * from EMP" will initiate oracle to read the data (out of the data files into the buffer cache, if they don't already exists in there) in the fetch phase.
    Maybe someone of you got more detailed information, but this was the only one i could find about that topic...
    Maybe J. Lewis knows more in detail :-)
    Regards
    Stefan

  • Help with WITH clause (ORA-24374: define not done before fetch or execute)

    Hi all
    I am uising with clause in SQL and getting this error. Please help ORA-24374: define not done before fetch or execute and fetch
    with dea as
    (SELECT MAX (idnt_value_cd) dea_num_cd,
    MAX (xtl_bpa_idnt_value_eff_dt)dea_eff_dt,
    MAX (idnt_value_cd_term_dt)dea_exp_dt,bpa_id
    FROM xtl_bpa_idnt_value
    WHERE xtl_bpa_idnt_id = 1
    AND merci_util.is_date_range_active
    (xtl_bpa_idnt_value_eff_dt,
    idnt_value_cd_term_dt
    ) = 0
    GROUP BY bpa_id)
    SELECT 'IPLAN' src_sys_name, bp.bp_id src_bp_id, 'INDV' bp_type_cd,
    CAST (NULL AS VARCHAR2 (10)) src_bp_clsfn_cd,
    CAST (NULL AS VARCHAR2 (10)) src_bp_sub_clsfn_cd,
    CAST (NULL AS VARCHAR2 (100)) bp_name, hcp.first_nm first_nm,
    hcp.middle_nm midl_nm, hcp.last_nm last_nm,
    hcp.name_pfx_dcd salu_txt, hcp.name_sufx_dcd sfx_txt,
    birth_yr_cd || birth_mth_cd || birth_day_cd birth_dt,
    gender_dcd gndr_cd, mpro_type.mpro_cd src_pfsnl_dgntn_cd,
    (SELECT spty_nm
    FROM specialty
    WHERE spty_id =
    (SELECT spty_id
    FROM bp_specialty
    WHERE bp_id = bp.bp_id
    AND bp_specialty_id =
    (SELECT MAX (bp_specialty_id)
    FROM bp_specialty
    WHERE bp_id = bp.bp_id)))
    src_prim_mdcl_spty_cd,
    (SELECT spty_nm
    FROM specialty
    WHERE spty_id =
    (SELECT spty_id
    FROM bp_specialty
    WHERE bp_id = bp.bp_id
    AND bp_specialty_id =
    (SELECT MAX (bp_specialty_id) - 1
    FROM bp_specialty
    WHERE bp_id = bp.bp_id)))
    src_sec_mdcl_spty_cd,
    (SELECT spty_nm
    FROM specialty
    WHERE spty_id =
    (SELECT spty_id
    FROM bp_specialty
    WHERE bp_id = bp.bp_id
    AND bp_specialty_id =
    (SELECT MAX (bp_specialty_id) - 2
    FROM bp_specialty
    WHERE bp_id = bp.bp_id)))
    src_tert_mdcl_spty_cd,
    lic.lic_num_cd src_st_lic_num, vhcp.state_cd src_sln_state_cd,
    lic.lic_eff_dt src_st_lic_eff_dt,
    lic.lic_expr_dt src_st_lic_exprn_dt,
    bp_status.bp_status_type_dcd src_bp_actv_ind,
    bp_status.bp_status_eff_dt src_bp_sta_chg_dt,
    mpro_type.mpro_type_dcd titl_txt,
    CAST (NULL AS VARCHAR2 (10)) src_cmeh_bp_id,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 6)
    callmax_cust_id,
    CAST (NULL AS VARCHAR2 (10)) wk_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 26) ims_psbr_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 22) ama_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 3) aoa_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 21) ada_num,
    CAST (NULL AS VARCHAR2 (10)) vet_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 23) np_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 20) pa_num,
    CAST (NULL AS VARCHAR2 (10)) pod_num,
    CAST (NULL AS VARCHAR2 (10)) opt_num,
    (SELECT xtl_bp_idnt_value_cd
    FROM xtl_bp_idnt_value
    WHERE bp_id = vhcp.hcp_id AND xtl_bp_idnt_id = 7) tax_id,
    CAST (NULL AS VARCHAR2 (10)) hin_num,
    CAST (NULL AS VARCHAR2 (10)) npi_num,
    vhcp.phone_num_cd bp_off_phn_num, vhcp.fax_num_cd bp_fax_num,
    CAST (NULL AS VARCHAR2 (10)) bp_cell_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bp_pager_num,
    CAST (NULL AS VARCHAR2 (10)) bp_home_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bp_vmail_num,
    vhcp.e_mail_cd bp_email_addr_txt,
    CAST (NULL AS VARCHAR2 (10)) bp_url, vhcp.bpa_id src_bpa_id,
    vhcp.addr_1_ds addr_ln_1_txt, addr_2_ds addr_ln_2_txt,
    CAST (NULL AS VARCHAR2 (10)) addr_ln_3_txt,
    CAST (NULL AS VARCHAR2 (10)) addr_ln_4_txt, city_nm,
    state_nm state_cd, postal_cd zip_5,
    CAST (NULL AS VARCHAR2 (10)) zip_4,
    vhcp.pfrd_ctac_loc_ind pfr_locn_ind,
    DECODE
    (merci_util.is_date_range_active ((SELECT bp_address.eff_dt
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id),
    (SELECT bp_address.end_dt
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id)
    0, 'ACTIVE',
    'INACTIVE'
    ) src_bpa_actv_ind,
    TO_CHAR (vhcp.bpa_updt_dtm, ' YYYYMMDD') src_bpa_sta_chg_dt,
    vhcp.prac_loc_ind bpa_off_addr_ind,
    vhcp.ship_to_loc_ind bpa_ship_addr_ind,
    vhcp.pfrd_fncl_loc_ind bpa_bill_addr_ind,
    (SELECT bp_address.mail_loc_ind
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id) bpa_mail_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_sm_addr_ind,
    (SELECT bp_address.home_loc_ind
    FROM bp_address
    WHERE bpa_id = vhcp.bpa_id) bpa_home_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_hdqtr_addr_ind,
    vhcp.affiliation_ind bpa_affl_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_prov_addr_ind,
    CAST (NULL AS VARCHAR2 (10)) bpa_other_addr_ind,
    dea.dea_num_cd,
    dea.dea_eff_dt,
    dea.dea_exp_dt,
    CAST (NULL AS VARCHAR2 (10)) schd_clas_cd,
    (SELECT MAX (idnt_value_cd) affl_id_cd
    FROM xtl_bpa_idnt_value
    WHERE 1 = 1
    AND xtl_bpa_idnt_id = 3
    AND merci_util.is_date_range_active
    (xtl_bpa_idnt_value_eff_dt,
    idnt_value_cd_term_dt
    ) = 0
    AND xtl_bpa_idnt_value.bpa_id = vhcp.bpa_id
    GROUP BY bpa_id) ims_outlet_num,
    (SELECT MAX (idnt_value_cd) affl_id_cd
    FROM xtl_bpa_idnt_value
    WHERE 1 = 1
    AND xtl_bpa_idnt_id = 6
    AND merci_util.is_date_range_active
    (xtl_bpa_idnt_value_eff_dt,
    idnt_value_cd_term_dt
    ) = 0
    AND xtl_bpa_idnt_value.bpa_id = vhcp.bpa_id
    GROUP BY bpa_id) callmax_afln_id,
    CAST (NULL AS VARCHAR2 (10)) src_cmeh_bpa_id,
    vhcp.bpa_id src_addr_id, vhcp.phone_num_cd bpa_off_num,
    vhcp.fax_num_cd bpa_fax_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_cell_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_pager_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_home_phn_num,
    CAST (NULL AS VARCHAR2 (10)) bpa_vmail_num,
    vhcp.e_mail_cd bpa_email_addr_txt,
    CAST (NULL AS VARCHAR2 (10)) bpa_url,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_1,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_2,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_3,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_4,
    CAST (NULL AS VARCHAR2 (10)) bp_filler_5,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_1,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_2,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_3,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_4,
    CAST (NULL AS VARCHAR2 (10)) bpa_filler_5,
    max_date (max_date (vhcp.bpa_updt_dtm, vhcp.hcp_updt_dtm),
    bp_status.updt_dtm
    ) updt_dtm,
    SYSDATE refresh_dtm
    FROM business_party bp,
    hcp,
    (SELECT hcp_id, lic_num_cd, MIN (lic_eff_dt) lic_eff_dt,
    MAX (lic_expr_dt) lic_expr_dt
    FROM mpro_govt_org_license
    WHERE 1 = 1
    AND merci_util.is_date_range_active (lic_eff_dt, lic_expr_dt) =
    0
    GROUP BY hcp_id, mpro_type_dcd, geoa_id, lic_num_cd) lic,
    (SELECT code_type_nm, code_value_cd mpro_type_dcd,
    xtl_src_obj_cd mpro_cd
    FROM xtl_src_code_value
    WHERE 1 = 1 AND code_type_nm = 'MPRO_TYPE') mpro_type,
    vm_hcp_address vhcp,
    bp_status,
    dea
    WHERE bp.bp_id = hcp.hcp_id
    AND hcp.hcp_id = lic.hcp_id(+)
    AND dea.bpa_id(+) = vhcp.bpa_id
    AND bp.hcp_ind = 'Y'
    AND hcp.mpro_type_1_dcd = mpro_type.mpro_type_dcd(+)
    AND hcp.hcp_id = vhcp.hcp_id
    AND hcp.srch_ctac_bpa_id = vhcp.bpa_id
    AND hcp.hcp_id = bp_status.bp_id
    and hcp.hcp_id=2200970

    Do you have an Oracle version? Trick question, you do, we just have no idea what it is.
    select * from v$version;Also, do you have a line number where this error occurs? Another trick question, you do, but you haven't posted it :(
    And finally, what are you using to run this query (SQLPLUS, SQLDEVELOPER, TOAD, etc....).
    And finally finally, please use the code tags .... { code } with no spaces so that your code doesn't look like a dictionary vomiting.
    Thanks.

Maybe you are looking for

  • Structure of the context for declaring internal table

    Hi, Can we use the structure of the context for declaring the internal ? -Sid

  • Business Intelligence in Ireland

    Hi great ones, I am currently working as a technical support analyst at the moment but I want to change to SAP Business Intelligence. I am very new to SAP and I am living in Ireland, going through job adverts I have not really been seeing BI jobs in

  • Help seting up wrt54g2 as an access point

    I have a linksys wrt54g wireless router now working fine and i have a wrt54g2 that i want to hookup to this as an access point. I tryed useing the software but i keep getting an error 302 so i want to know what i am doing wrong or how to manually set

  • Please help me with turtle graphics problem

    I'm trying to draw a right triangle using turtle graphics, but I keep getting an error that says "incompatible types"(In class NewShape where it says "Pen p = new StandardPen();"). I have an idea of what that means generally, but I can't figure out w

  • Can i store Arabic in XE database

    How can i make a form in APEX to take Arabic text and to store it in XE database? Thanks in Advace Regards. Mazahir Abbas