Trace File - Procedure

Hello All,
I want to find the depth analysis of the calls in the procedure.
How can i achieve it through trace??
Plz let me know the steps for finding trace file in a procedure...
I have just run the code in SQLPLUS...
ALTER SESSION SET sql_trace = TRUE
How can i call the code to achieve it....?
THanks for your comments...
PROCEDURE p_tst
IS
  CURSOR cur_get
   IS
    select column
    from tables
   where condition;
BEGIN
FOR i IN cur_get
LOOP
pkg1.proc1
END LOOP;
END;

It's explained here:
http://oracle-randolf.blogspot.com/2009/02/basic-sql-statement-performance.html
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#PFGRF01020

Similar Messages

  • Unable to generate trace file

    Hi,
    I have written the stored procedure for starting sql trace on a given session for say n number of seconds.
    create or replace procedure start_trace
    v_sid in number,
    v_serial# in number,
    seconds in number)
    IS
    v_user varchar2 (32);
    duration number;
    dump_dest varchar2 (200);
    db_name varchar2 (32);
    no_session_found exception;
    stmt varchar2(100);
    stmt1 varchar2(100);
    BEGIN
    begin
    select username into v_user
    from v$session
    where sid= v_sid and
    serial# = v_serial#;
    exception
    when NO_DATA_FOUND then
    raise no_session_found;
    end;
    dbms_output.put_line('Tracing Started for User: '|| v_user);
    dbms_output.put_line('Tracing Start Time: '|| TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS'));
    dbms_system.set_sql_trace_in_session(v_sid,v_serial#,true);
    if seconds is null then
    duration := 60;
    else
    duration := seconds;
    end if;
    dbms_lock.sleep(duration);
    dbms_system.set_sql_trace_in_session(v_sid,v_serial#,false);
    dbms_output.put_line ('Tracing Stop Time: '|| TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS'));
    select value into dump_dest
    from v$parameter
    where name = 'user_dump_dest';
    dbms_output.put_line('Trace Directory: ' || dump_dest);
    exception
    when no_session_found then
    dbms_output.put_line('No session found for sid and serial# specified');
    END start_trace;
    The above procedure compiles successfully and when I call it from sql prompt it gives me the message that the pl/sql procedure was completed successfully and all put_line statements are displayed.
    Real problem comes when I check udump for the trace file. I can not find it there. It seems all the statements in the procedure are executed successfully except dbms_system.set_sql_trace_in_session(v_sid,v_serial#,true) and dbms_system.set_sql_trace_in_session(v_sid,v_serial#,false) for some strange reasons.
    Any help will be appreciated.
    Thanks.

    Thanks for the reply.
    I do not get any error message. The following is the output:
    SQL> exec start_trace(118,6243,30);
    Tracing Started for User: SVCWRK
    Tracing Start Time: 09-26-2011 16:28:29
    Tracing Stop Time: 09-26-2011 16:28:59
    Trace Directory: /orasoft/app/oracle/admin/testsvcb/udump
    PL/SQL procedure successfully completed.
    But the trace file is not generated.
    I am using Oracle 10.2.0.4.0.
    Will try using DBMS_MONITOR.
    Thanks again.

  • Deleting default trace file in java

    Hello all,
    Whats the best way to automatically delete default trace file in java instance? I want to delete these files lets say every week or 2 wkkds,Is there any type of configuration that can be done through NWA or OS...? or do i have to write some scripts? Please advice.

    Perfect.
      When set to 10, 0 -->9 are cyclic files. Regarding archiving, yes this is possible. Apart from defaulttrace files you can also archive other java log files (system, network,security etc). The configuration procedure is explained :-
    http://help.sap.com/saphelp_nw04/helpdata/en/48/2edfd5bd3e0d4a81b90325fe195a70/frameset.htm
    Once the 10th trace file(i.e.defaultrace9) is full, all the trace files (from defaulttrace0-defaultrace9) are zipped to a single file. The file compression ratio is extremely good.
    Unfortunately there is no automated mechanism to clear off the archived files. This needs manual intervention(regular cleanup, script etc).
    The archived log files may also be viewed for analysis from NWA.
    While estimating the size for each defaulttrace consider  three factors  i) System load ii) Number of defaulttrace files.
    iii) Retention days(without archiving)
    Ex: System load as observed :
    Say the trace file size is 10MB and 6 trace files get written in 4 hours of peak time and 1 trace files is written for 4 hours during non-peak time .Assuming 8 hours of peak business hours and rest all non-working hours.
    No of files generated is 62 + 14 = 16 files of 10 MB each are generated per week day
    If the defaulttrace file  count is set to 16, you can retain one days' logs . Say you wish to retain the same with less number of files (i.e. 8) you would have to increase the file size to 20 MB. Also will have to look at file system space availability.
                   CAUTION: For a file system occupancy estimate, you will have to also consider as to how many Server nodes are 
                                    configured as each node has its own log area !
    For this you need to observe the pattern as to how many files are being written then estimate the size and count
    cheers !
    PRADi

  • No trace file in .../udump

    Hi,
    DB 10.2.0.5
    I enabled a session tarce by :
    execute sys.dbms_system.set_sql_trace_in_session(267,21842,TRUE); (that's the J011 process)
    and can see it in v$session:
    SQL> select sid, serial#, sql_trace, sql_trace_waits, sql_trace_binds from v$session where sid=267;
    SID SERIAL# SQL_TRAC SQL_T SQL_T
    267 21842 ENABLED TRUE TRUE
    but there is no trace file written to the udump dir?
    br
    Daniel

    Daniel,
    The dbms_system package is an undocumented , internal-only package. Please don't use it. Instead of it, use dbms_monitor package to do the same task.
    edit
    If you are still interested to use this package only , do some activity in the session. See below,
    SQL> grant dba to aman identified by aman;
    Grant succeeded.
    SQL> cl scr
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    [oracle@edbar2p0-orcl ~]$ sqlplus aman/aman
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 11 17:00:34 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    SQL> select sid, serial# from V$session where username='AMAN';
           SID    SERIAL#
            31        353
    SQL> execute sys.dbms_system.set_sql_trace_in_session(31,353,TRUE);
    BEGIN sys.dbms_system.set_sql_trace_in_session(31,353,TRUE); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'SYS.DBMS_SYSTEM' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL> conn / as sysdba
    Connected.
    SQL> grant execute on dbms_system to aman;
    Grant succeeded.
    SQL> cl scr
    SQL> conn aman/aman
    Connected.
    SQL> select sid, serial# from V$session where username='AMAN';
           SID    SERIAL#
            31        357
    SQL> alter session set tracefile_identifier='aman';
    Session altered.
    SQL> execute sys.dbms_system.set_sql_trace_in_session(31,357,TRUE);
    PL/SQL procedure successfully completed.
    SQL> select sid, serial#, sql_trace, sql_trace_waits, sql_trace_binds from v$session where sid=31;
           SID    SERIAL# SQL_TRAC SQL_T SQL_T
            31        357 ENABLED  FALSE FALSEAfter this, I checked in the diag folder, there is no control file created.
    [oracle@edbar2p0-orcl trace]$ ls *aman*
    ls: *aman*: No such file or directory
    [oracle@edbar2p0-orcl trace]$ Now, I just ran some queries in the session.
    SQL> select * from scott.emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800
            20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300
            30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975
            20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400
            30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2450
            10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000
            20
          7839 KING       PRESIDENT            17-NOV-81       5000
            10
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0
            30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100
            20
          7900 JAMES      CLERK           7698 03-DEC-81        950
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7902 FORD       ANALYST         7566 03-DEC-81       3000
            20
          7934 MILLER     CLERK           7782 23-JAN-82       1300
            10
    14 rows selected.After doing this, I checked again ,
    [oracle@edbar2p0-orcl trace]$ ls *aman*
    orcl_ora_9828_aman.trc  orcl_ora_9828_aman.trm
    [oracle@edbar2p0-orcl trace]$
    PARSING IN CURSOR #3 len=23 dep=0 uid=93 oct=3 lid=93 tim=1310404033551285 hv=52
    404428 ad='32ab2004' sqlid='ggqns3c1jz86c'
    select * from scott.emp
    END OF STMT
    PARSE #3:c=1000,e=1903,p=1,cr=24,cu=0,mis=1,r=0,dep=0,og=1,plh=3956160932,tim=13
    10404033551284
    EXEC #3:c=0,e=10,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=3956160932,tim=131040403
    3551335
    FETCH #3:c=0,e=266,p=6,cr=7,cu=0,mis=0,r=1,dep=0,og=1,plh=3956160932,tim=1310404
    033551649
    FETCH #3:c=0,e=19,p=0,cr=1,cu=0,mis=0,r=13,dep=0,og=1,plh=3956160932,tim=1310404
    033551860
    STAT #3 id=1 cnt=14 pid=0 pos=1 obj=73181 op='TABLE ACCESS FULL EMP (cr=8 pr=6 p
    w=0 time=0 us cost=3 size=532 card=14)'HTH
    Aman....
    Edited by: Aman.... on Jul 11, 2011 5:08 PM
    added Edit

  • Trace file not being generated

    Hi,
    I am using Oracle 10g Rel2.
    I am trying to generate trace file for a session using DBMS_SYSTEM.
    Firstly I used DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION procedure to generate trace file for a session, but this was generating trace files in udump directory. Then i checked on net & found that we can not generate trace file this way for active sessions.
    Then I tried using DBMS_SYSTEM.SET_ENV procedure, same results. This is also not generating trace files?
    Any idea why this is happening? Moreover for around how much duration I should enable trace?
    Thanks in advance.

    Firstly I used DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION procedure to generate trace file for a session, but this was generating trace files in udump directory.
    As is the normal behavior, so nothing wrong.
    Then i checked on net & found that we can not generate trace file this way for active sessions.
    Which is, of course, nonsense.
    Then I tried using DBMS_SYSTEM.SET_ENV procedure, same results. This is also not generating trace files?
    This is again nonsense.
    As you didn't consider it necessary to post your exact commands, and nobody is looking over your shoulder, an adequate response is impossible.
    Sybrand Bakker
    Senior Oracle DBA

  • Where is the user trace file?

    I have issued the statement below to enable sql trace in session 260 ,and it execute successfully.but i can not find where the trace file in directory $ORACLE_BASE/admin/testcs/udump (testcs is my database name).
    SQL> execute dbms_system.set_sql_trace_in_session(260,34880,true);
    PL/SQL procedure successfully completed.
    where is the trace file?
    By the way,how can i find the information about the package DBMS_SYSTEM which is not in ORACLE references?

    Did you issue some queries after turning tracing on? The trace file might not be created until there is some activity in the session.
    I know that DBMS_SYSTEM is documented in the O'Reilly Press book "Oracle Built-in Packages" by Feuerstein, Dye & Beresniewicz.
    However for tracing I think that Oracle expects you to use the dbms_support package:
    execute sys.dbms_support.start_trace_in_session -
      (sid => &sid, serial => &serial, waits => true, binds => true)Or for Oracle 7.3.4 or 8.0 you can use oradebug. Example:
    select pid, spid, username from v$process;
    PID    SPID   USERNAME
    8      25807  oracle
    SVRMGR> oradebug setorapid 8
    -- or -
    SVRMGR> oradebug setospid 25807
    -- turn on
    SVRMGR> oradebug event 10046 trace name context forever, level 12 
    -- turn off
    SVRMGR> oradebug event 10046 trace name context off

  • Do you know Timmings for trace files generated?

    Hi,
    I have done some sql traceing using DBMS_MONITOR package.
    We can also enable SQL traceing using DBMS_SESSION.
    I want to generate sql trace file for "particuler part of application".
    When i did that i got some sql trace files,, now that "particuler part of application" was over application was idle..
    but as time goes these files are still populating in size means they are still sql traceing going on...
    My question is when and how trace files are generated?
    Do you have idea???
    Thanks and Regards,
    Rushang Kansara
    Message was edited by:
    Rush

    also what content of my sql trace file should i
    consider for exacly tracing that "particuler part of
    application".
    Rushang
    Parse Count To Execute Ratio
    Take the numbers of parse count and divide it by numbers of time execute count if it is 1 then it means you are parsing the same statment everytime,If this ratio is 1 then it will latch the shared SQL area which will degrade the overall performance.Like if you execute a query which is using bind variable and this query is at yours front end level trigger (Forms) POST_QUERY then it will show you (parse count=execute count) which shows you are parsing for every triggering event which is bad ,for that you should put this seqeuel within PL/SQL procedure which cache the cursor and will turn in (parse count<Execute Count).
    Large Diffrence Between Elasped Time And CPU Time
    If this diffrence (Elapsed time[b]-CPU time)>1 then it means you are spending yours time in for waiting resources this waiting resources will in turn wait events e.g some one updated the row and dont realease by COMMIT or ROLBACK and the same span of time you want to update then you will see a lock in tkprof result in wait event section.If you read the data from hard disk (as first time you issue it reads from HD and then put into buffer cache during this reading a latch is grabed and will not let you read this data until you perform the alls read from HD to buffer cache this will also show you in wait events which is cache buffers chain
    Fetch Calls
    If yours Fetch calls=Rows then it means you are not using Bulk fetch and yours this code will take a lot of roundtrips which will in turn jam the network.
    Disk Count
    If every time yours disk count=current + query mode then you are reading alls block from disk alls the time ,usually oracle read once from disk and put it into SGA and should be found in SGA second time.
    And there is many more...depend on yors environemnt setup but above are common.
    As you said its reproducing the tkprof again and again ,make sure you terminate the session or you explicitly turn off the tracer by
    ALTER SESSION SET SQL_TRACE=FALSE Khurram

  • How to find trace file error in form

    hai all,
    i have big problem in my form in apps i open the form one error is ocuured,
    i got the trace file and check the error,
    PARSE ERROR #82:len=2903 dep=0 uid=173 oct=3 lid=173 tim=4265689973879 err=904 this is the trace file error meassage,
    how to find this error in form and also this is occured one select statement,how to find this select statement where can be used in form,
    i have one button ,when ever i press the button this error is ocuured,i check this button pl/sql procedure code but in this code not using that sql statement,
    if any one know to find the sql statement through trace file.
    plz give the replay as soon as possible.
    thank's

    The newest SQL Developer can converts the trace to readable format too, I'm not shure if you see the sql statement related to the error then.
    It seems you get ORA-00904 which says you use an invalid coumn in a dml statement.
    Normally such error should pop up in message - do you overwrite the message handling or use exception handling in you form which block this message?
    Easiest way to find this is to compile the form against the target database.
    If this does not give an error, you should check, if you use dynamic sql statements which are wrong.
    If you call database routines from your form, than this could be the errro cause too.

  • Get blocker from the (self) deadlock trace file

    Hi,
    Recently I had an issue on a 10.2.0.4 single instance database where deadlocks were occurring. The following test case reproduces the problem (I create three parent tables, one child table with indexed foreign keys to all three parent tables and a procedure which performs an insert into the child table in an autonomous transaction):
    create table parent_1(id number primary key);
    create table parent_2(id number primary key);
    create table parent_3(id number primary key);
    create table child( id_c number primary key,
                       id_p1 number,
                       id_p2 number,
                       id_p3 number,
                       constraint fk_id_p1 foreign key (id_p1) references parent_1(id),
                       constraint fk_id_p2 foreign key (id_p2) references parent_2(id),
                       constraint fk_id_p3 foreign key (id_p3) references parent_3(id)
    create index i_id_p1 on child(id_p1);
    create index i_id_p2 on child(id_p2);
    create index i_id_p3 on child(id_p3);
    create or replace procedure insert_into_child as
    pragma autonomous_transaction;
    begin
      insert into child(id_c, id_p1, id_p2, id_p3) values(1,1,1,1);
      commit;
    end;
    insert into parent_1 values(1);
    insert into parent_2 values(1);
    commit;And now the action that causes the deadlock:
    SQL> insert into parent_3 values(1);
    1 row created.
    SQL> exec insert_into_child;
    BEGIN insert_into_child; END;
    ERROR at line 1:
    ORA-00060: deadlock detected while waiting for resource
    ORA-06512: at "SCOTT.INSERT_INTO_CHILD", line 4
    ORA-06512: at line 1My question is: how can I determine which table the insert into CHILD was waiting on? It could be waiting on PARENT_1, PARENT_2, PARENT_3, a combination of them or even on CHILD if I tried to insert a duplicate primary key in CHILD. Since we have the full testcase we know that it was waiting on PARENT_3 (or better said, it was waiting for the "parent" transaction to perform a commit/rollback), but is it possible to determine that solely from the deadlock trace file? I'm asking that because to pinpoint the problem I had to perform redo log mining, pl/sql tracing with DBMS_TRACE and manual debugging on a clone of the production database which was restored to a SCN just before the deadlock occurred. So, I had to do quite a lot of work to get to the blocker table and if this information is already in the deadlock trace file, it would have saved me a lot of time.
    Below is the deadlock trace file. From the "DML LOCK" part I guess that the child table (tab=227042) holds a mode 3 lock (SX), all the other three parent tables have mode 2 locks (SS), but from this extract I can't see that parent_3 (tab=227040) is blocking the insert into child:
    Deadlock graph:
                           ---------Blocker(s)--------  ---------Waiter(s)---------
    Resource Name          process session holds waits  process session holds waits
    TX-00070029-00749150        23     476     X             23     476           S
    session 476: DID 0001-0017-00000003     session 476: DID 0001-0017-00000003
    Rows waited on:
    Session 476: obj - rowid = 000376E2 - AAA3biAAEAAA4BwAAA
      (dictionary objn - 227042, file - 4, block - 229488, slot - 0)
    Information on the OTHER waiting sessions:
    End of information on OTHER waiting sessions.
    Current SQL statement for this session:
    INSERT INTO CHILD(ID_C, ID_P1, ID_P2, ID_P3) VALUES(1,1,1,1)
    ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    3989eef50         4  procedure SCOTT.INSERT_INTO_CHILD
    391f3d870         1  anonymous block
            SO: 397691978, type: 36, owner: 39686af98, flag: INIT/-/-/0x00
            DML LOCK: tab=227042 flg=11 chi=0
                      his[0]: mod=3 spn=35288
            (enqueue) TM-000376E2-00000000  DID: 0001-0017-00000003
            lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x6
            res: 0x398341fe8, mode: SX, lock_flag: 0x0
            own: 0x3980df420, sess: 0x3980df420, proc: 0x39859c660, prv: 0x398341ff8
            SO: 397691878, type: 36, owner: 39686af98, flag: INIT/-/-/0x00
            DML LOCK: tab=227040 flg=11 chi=0
                      his[0]: mod=2 spn=35288
            (enqueue) TM-000376E0-00000000  DID: 0001-0017-00000003
            lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x6
            res: 0x3983386e8, mode: SS, lock_flag: 0x0
            own: 0x3980df420, sess: 0x3980df420, proc: 0x39859c660, prv: 0x3983386f8
            SO: 397691778, type: 36, owner: 39686af98, flag: INIT/-/-/0x00
            DML LOCK: tab=227038 flg=11 chi=0
                      his[0]: mod=2 spn=35288
            (enqueue) TM-000376DE-00000000  DID: 0001-0017-00000003
            lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x6
            res: 0x398340f58, mode: SS, lock_flag: 0x0
            own: 0x3980df420, sess: 0x3980df420, proc: 0x39859c660, prv: 0x398340f68
            SO: 397691678, type: 36, owner: 39686af98, flag: INIT/-/-/0x00
            DML LOCK: tab=227036 flg=11 chi=0
                      his[0]: mod=2 spn=35288
            (enqueue) TM-000376DC-00000000  DID: 0001-0017-00000003
            lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x6
            res: 0x39833f358, mode: SS, lock_flag: 0x0
            own: 0x3980df420, sess: 0x3980df420, proc: 0x39859c660, prv: 0x39833f368
          ----------------------------------------Thank you in advance for any comments,
    Jure

    Hi Jonathan,
    thank you very much for your reply which more than answers my question. I think it actually clears a lot of doubts I had about TX locks, since your mentioning of "undo segment header transaction table" pointed me in the right direction for further research on this topic (honestly, I didn't know what's "behind" TX locks). So if I understood correctly, to determine which table is the blocker (in the testcase presented above), you have to have some kind of history of executed SQL statements (e.g. by mining redo logs)?
    The statement you wrote:
    At this point, and with your example, the waiting session is waiting on a TX (transaction) lock - this means it has not idea (and no interest) in the actual data involved, it is merely waiting for an undo segment header transaction table slot to clear. and the example with the savepoint you gave, made me think of some of the consequences of that behaviour. That is probably the reason why it is not possible to get the "blocker" table from v$lock (although sometimes it's possible to get it from v$session.row_wait_obj#) when a session tries to change a row another session holds in exclusive mode, e.g.:
    create table t1 (id number);
    insert into t1 values (1);
    commit;
    Session 126:
    SID = 126> update t1 set id=2 where id=1;
    1 row updated.
    Session 146:
    SID = 146> update t1 set id=2 where id=1;
    {session hangs}
    In a separate session:
    SQL> SELECT   CASE
      2                  WHEN TYPE = 'TM'
      3                     THEN (SELECT object_name
      4                             FROM user_objects
      5                            WHERE object_id = l.id1)
      6               END object_name,
      7                  SID, TYPE, id1, id2, lmode, request, BLOCK
      8          FROM v$lock l
      9         WHERE SID IN (126, 146)
    10     ORDER BY SID, TYPE, 1
    11  /
    OBJECT_NAME    SID TY        ID1        ID2      LMODE    REQUEST      BLOCK
    T1             126 TM      68447          0          3          0          0
                   126 TX     262153       4669          6          0          1
    T1             146 TM      68447          0          3          0          0
                   146 TX     262153       4669          0          6          0The only thing I can tell from this output is that session 146 is trying to get a TX lock in exclusive mode, and session 126 is blocking it, the reason of the blocking being unknown from this view alone.
    Since I'd like to get a better understanding on the mechanics behind this (e.g. why the blocked session can't know the segment that is waiting for, since it has to go to the same segment's data block to find the address of the undo segment header transaction table slot? ; can we get the content/structure of the transaction table in the data block - probably by making a block dump?), do you have any source where a more in depth explanation what happens "behind the scenes" is available (perhaps in Oracle Core?)? Some time ago I found a link on your blog http://jonathanlewis.wordpress.com/2010/06/21/locks/ which points to Franck Pachot's article where he nicely explains the various locking modes: http://knol.google.com/k/oracle-table-lock-modes#. There I also found Kyle Hailey's presentation about locks http://www.perfvision.com/papers/09_enqueues.ppt where slide 23 nicely depicts what's going on when acquiring TX locks. Of course I'll try to search on my own, but any other source (especially from an authority like you) is more than welcome.
    Thank you again and regards,
    Jure

  • Record type variables in the SQL database trace file

    Hi,
    I turned on the trace with binds and waits in a ebusiness form and captured the database SQL trace file. It lists the values for the generic datatypes for the call, but does not list the values of record type variables. Is there a way to identify the values of record type variables? The below section lists the procedure call and the values passed. Thanks in advance.
    RPC CALL:PROCEDURE APPS.HZ_PARTY_SEARCH.FIND_PARTY_DETAILS(P_INIT_MSG_LIST IN VARCHAR2, P_RULE_ID IN NUMBER, P_PARTY_SEARCH_REC IN PARTY_SEARCH_REC_TYPE, P_PARTY_SITE_LIST IN PARTY_SITE_LIST, P_CONTACT_LIST IN CONTACT_LIST, P_CONTACT_POINT_LIST IN CONTACT_POINT_LIST
    , P_RESTRICT_SQL IN VARCHAR2, P_MATCH_TYPE IN VARCHAR2, P_SEARCH_MERGED IN VARCHAR2, X_SEARCH_CTX_ID OUT NUMBER, X_NUM_MATCHES OUT NUMBER, X_RETURN_STATUS OUT VARCHAR2, X_MSG_COUNT OUT NUMBER, X_MSG_DATA OUT VARCHAR2);
    RPC BINDS:
    bind 0: dty=1 bfp=2ae5927c13c8 flg=08 avl=01 mxl=01 val="T"
    bind 1: dty=6 bfp=2ae5927c13f0 flg=00 avl=02 mxl=22 val=8
    bind 2: dty=118 bfp=2ae593432e48 flg=00 avl=00 mxl=00 val=00
    bind 3: dty=251 bfp=2ae5929ac0b8 flg=00 avl=1944 mxl=00 val=00
    bind 4: dty=251 bfp=2ae592d85548 flg=00 avl=5336 mxl=00 val=00
    bind 5: dty=251 bfp=2ae592d84d58 flg=00 avl=4984 mxl=00 val=00
    bind 6: dty=1 bfp=2ae5927c1550 flg=08 avl=125 mxl=2000 val="exists (select 'x' from hz_parties where party_id =stage.party_id and party_type = 'ORGANIZATION') and party_id <>1002277174"
    bind 7: dty=1 bfp=2ae5927c1d50 flg=0a avl=00 mxl=00 val=""
    bind 8: dty=1 bfp=2ae5927c1d80 flg=08 avl=01 mxl=01 val="I"
    bind 9: dty=6 bfp=2ae5927c1da8 flg=02 avl=00 mxl=22 val=00
    bind 10: dty=6 bfp=2ae5927c1de0 flg=02 avl=00 mxl=22 val=00
    bind 11: dty=1 bfp=2ae5927c1e28 flg=0a avl=00 mxl=01 val=""
    bind 12: dty=6 bfp=2ae5927c1e50 flg=02 avl=00 mxl=22 val=00
    bind 13: dty=1 bfp=2ae5927c1e98 flg=0a avl=00 mxl=2000 val=""

    Hello,
    From the sounds of it, when you are adding a child the application is not maintaining the Company's reference to it. For instance, in a 1:M and M:1 relationship, the application seems to be setting only the M:1 part (child to parent) which will cause the database to be updated, but both sides need to be set to keep the cache in synch with the database.
    Setting the cache type to be none is not a good idea - it prevents any caching, which will hurt performance and object identity. What instead is recommended is disabling the shared cache using the
    toplink.cache.shared.<ENTITY>=false property. This still might not help though if the Company's reference to the child hasn't been set as mentioned above if you are reading Company from the same context you are adding the child.
    The Cache is described for TopLink Essentials in the blog at:
    http://weblogs.java.net/blog/guruwons/archive/2006/09/understanding_t.html
    Best Regards,
    Chris

  • Lost time in trace file

    There is anonimous block:
    begin
      execute immediate 'alter session set tracefile_identifier = ''TS'''; 
      dbms_monitor.session_trace_enable;
      some_proc(true);
    end;Procedure some_proc consists following code
    loop
      select val into i from a where par = 'Bar';
      if i = 'EXIT' then
        exit;
      end if;
      for cur in (select fld from t order by r) loop
        processing(cur);
      end loop;
    end loop;Tables A and t is very small tables. So table t is empty.
    As you can see, expected than will be works loop and select from very small table.
    I have executed the block, and it works about 477 seconds.
       select value
      2      from v$sesstat s
      3   natural
      4      join v$statname n
      5     where sid = sys_context('USERENV', 'SID')
      6       and name = 'CPU used by this session';
         VALUE
             2
    declare
      2    t date;
      3  begin
      4    execute immediate 'alter session set tracefile_identifier = ''TS''';
      5    dbms_monitor.session_trace_enable;
      6    come_proc(true);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:07:57.63
       select value
      2      from v$sesstat s
      3   natural
      4      join v$statname n
      5     where sid = sys_context('USERENV', 'SID')
      6       and name = 'CPU used by this session';
         VALUE
         45175But there is some strange moments:
    1. In tkprof report shows only 277.83 sec (whereas statistic "CPU usage" above is different and more appropriate, 451.75 sec.)
    declare
      t date;
    begin
      execute immediate 'alter session set tracefile_identifier = ''TS''';
      dbms_monitor.session_trace_enable;
      some_proc(true);
    end;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1    260.95     277.83          0         64          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        1    260.95     277.83          0         64          0           1
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 10757 
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       1        0.00          0.00
      SQL*Net message from client                     1       20.64         20.64
    SELECT VAL
    FROM
    A WHERE PAR = 'BAR'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute 1782640     29.01      28.20          0          0          0           0
    Fetch   1782640     32.78      31.77          0    5347922          0     1782640
    total   3565281     61.80      59.97          0    5347922          0     1782640
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 43     (recursive depth: 1)
    Rows     Row Source Operation
    1782640  INDEX RANGE SCAN A_UI (cr=5347922 pr=0 pw=0 time=31762812 us)(object id 530778)
    SELECT FLD
    FROM
    T ORDER BY R
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.01          0          0          0           0
    Execute 1782639     33.21      31.91          0          0          0           0
    Fetch   1782639     95.52      95.82          0   12478473          0           0
    total   3565279    128.74     127.75          0   12478473          0           0
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 43     (recursive depth: 1)
    Rows     Row Source Operation
          0  SORT ORDER BY (cr=12478473 pr=0 pw=0 time=103178656 us)
          0   PARTITION RANGE SINGLE PARTITION: 1 1 (cr=12478473 pr=0 pw=0 time=92028737 us)
          0    TABLE ACCESS FULL T PARTITION: 1 1 (cr=12478473 pr=0 pw=0 time=86376673 us)2. In raw trace very many rows with c=0. And somtimes there is rows with c=1000
    EXEC #9:c=0,e=13,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912283
    FETCH #9:c=0,e=42,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912345
    EXEC #8:c=0,e=12,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912395
    FETCH #8:c=0,e=13,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451912427
    EXEC #9:c=0,e=14,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912475
    FETCH #9:c=0,e=37,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912534
    EXEC #8:c=0,e=11,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912580
    FETCH #8:c=0,e=12,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451912612
    EXEC #9:c=0,e=13,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912659
    FETCH #9:c=0,e=39,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912718
    EXEC #8:c=0,e=16,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912807
    FETCH #8:c=0,e=14,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451912865
    EXEC #9:c=0,e=14,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912916
    FETCH #9:c=0,e=46,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451912982
    EXEC #8:c=0,e=12,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913040
    FETCH #8:c=0,e=13,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451913148
    EXEC #9:c=0,e=14,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913197
    FETCH #9:c=0,e=40,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913256
    EXEC #8:c=0,e=11,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913302
    FETCH #8:c=0,e=12,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451913334
    EXEC #9:c=0,e=14,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913381
    FETCH #9:c=0,e=39,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913440
    EXEC #8:c=0,e=12,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913487
    FETCH #8:c=0,e=19,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451913525
    EXEC #9:c=0,e=18,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913590
    FETCH #9:c=0,e=36,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913661
    EXEC #8:c=10000,e=12,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913710
    FETCH #8:c=0,e=13,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451913742
    EXEC #9:c=0,e=13,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913790
    FETCH #9:c=0,e=37,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913846
    EXEC #8:c=0,e=11,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913893
    FETCH #8:c=0,e=12,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451913924
    EXEC #9:c=0,e=18,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451913996
    FETCH #9:c=0,e=51,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451914077
    EXEC #8:c=0,e=18,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451914149
    FETCH #8:c=0,e=17,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=2,tim=5857451914207
    EXEC #9:c=0,e=14,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451914284
    FETCH #9:c=0,e=37,p=0,cr=7,cu=0,mis=0,r=0,dep=1,og=2,tim=5857451914347Questions:
    1. How do you think, lost time is time spent
    a. in PLSQL engine during context switch,
    b. or lost time is time spent in SQL processing where CPU time is less than minimum accurancy (0.01s)
    c. or time lost during write in trace file (trace overhead)?
    2. Value c=10000 is accumulated value? I think no, may be I am wrong?
    But if I right, and time of processing was smaller than 0.01s, CPU time in tkprof will equal to zero, right?
    And from this point of view, strange that CPU time and elapsed time is near.
    3. Write in trace file is included into "elapsed time" in tracefile steps, e.g. "execute" and "fetch"?
    In other words I want more deeply understand process of SQL processing and trace.

    What version of Oracle are you using?
    Can you post the entire contents of the trace file?

  • Explain Plan from TKPROF trace file.

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

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

  • How to change trace file location in Oracle Fusion Middleware

    Hi all,
    I would like to know how to change the location of the trace file in Oracle Fusion Middleware - Report Server 11g ?
    I notice there is logging.xml file in $ORACLE_HOME/config/ReportServerComponenent/logging.xml. In the xml file, it did specify the location of the diagnostic file and other log files.
    Is it the correct way to reconfigure the location of the log file? I havent try it though. :D
    Thanks.

    Hi Fleix,
    For additional instructions for Release 11i, see Note.167635.1 and Note.150168.1.
    For additional instructions for Release 11.0.3 and 10.7, see Note.148982.1 and Note.135715.1.
    a. Append the following to the end of the URL used to login to the Oracle Applications:
    ?play=&record=collect&log=/tmp/oracle.FRD.log
    ** Note: The self service login URL will not work for creating FRD trace files. You may need to talk to your technical team to get the URL that accesses the forms server directly.
    b. If the URL to logon to 11i applications is:
    http://machine:9603/dev60cgi/f60cgi
    Then the following label needs to be included:
    ?play=&record=collect&log=/tmp/'file_name'.frd
    For example to create frd for above url log in to application as
    http://machine:9603/dev60cgi/f60cgi?play=&record=collect&log=/tmp/4764802.992.frd
    c. Now log into the application and go directly to the form with the problem and perform the actions which generate the error.
    Once the error has been generated and cleared, immediately log out of the application so no additional diagnostics are captured.
    d. The diagnostics will be written to the file specifed after "log=". In the example, this would be /tmp/4764802.992.frd
    e. After reproducing the issue, log on the server side of the instance and go to the directory to /tmp (cd tmp)
    f. Retrieve the frd file: /tmp/4764802.992.frd
    This file contains all the details about built-in programs, triggers, procedures in a FORM
    Thanks,
    Anchorage :)

  • How to use forms trace file for performance tuning

    I am trying to use forms trace file in order to find cause of forms application performance problem.
    I have read the document B14032-03 where is described how to turn on tracing and how to convert binary trace file to xml or html format. However these xml/html files are useless because they only contain series of forms events, without possibility for grouping or sorting. Actually, they are like to database raw trace file. I need some tool, like tkprof for database trace, that will process xml/html file and generate some more useful format.
    Further, I have tried to load forms trace file into relational database tables in order to use SQL for performance problem investigation. I have followed procedure described in document A92175-01, but without success.
    Is there any way to process xml/html file with grouping, orderering or summing event duration or way to load either binary, xml or html trace file into structured data in database.

    Al-Salamu Alikum user630033
    It's not : elegant at all to thank people 4 No help,it's not their problem that u don't search enough, or u don't have access to db.
    We should always say thank ,or 'Jazak Allah Khiern' on both cases even they could or couldn't help u.
    Finally,i expect ' an appologize or even a thankful word ' and the kindness i am sure u had to publish the solution u found in order to share it with people who had same problem or at least to give them the info to get the appreciation or the thanksful word u deserve.
    Rem.Never give a bad feedback to people who tried to help u.
    Regards,
    Abdetu..

  • Getting trace file names for a conc program

    Hi All,
    We are using Oracle EBS 11i with Oracle 9i database.
    The Apps version is 11.5.9 and database version is Release 9.2.0.6.0.
    I am trying to trace a custom program which runs the pl/sql procedure.
    I have enabled the tracing in the custom program definition.
    This procedure has several blocks inside and also has many commits.
    Due to this the SID for the session changes frequently.
    Now my question is how can I get all the SIDs for this conc program and get the trace files for each SID.
    My goal is to get all the trace file generated for this conc program and use them for analysis.
    Any help is appreciated !
    Thanks,
    DR.

    Sending again with formatting.
    SELECT c.*, b.accounting_date,
              a.segment1
           || '.'
           || a.segment2
           || '.'
           || a.segment3
           || '.'
           || a.segment4
           || '.'
           || a.segment5 accrual_account
      FROM gl_code_combinations a,
           ARCHIVE.ap_ae_headers b,
           ARCHIVE.ap_ae_lines c,
           ARCHIVE.po_distributions d,
           ARCHIVE.ap_invoice_distributions e
    WHERE e.po_distribution_id IS NOT NULL
       AND d.po_distribution_id = e.po_distribution_id
       AND c.source_table = 'AP_INVOICE_DISTRIBUTIONS'
       AND c.source_id = e.invoice_distribution_id
       AND b.ae_header_id = c.ae_header_id
       AND b.accounting_date <= :b1
       AND a.code_combination_id = d.accrual_account_id
       AND a.segment3 = '3010'
    UNION ALL
    SELECT c.*, b.accounting_date,
              a.segment1
           || '.'
           || a.segment2
           || '.'
           || a.segment3
           || '.'
           || a.segment4
           || '.'
           || a.segment5 accrual_account
      FROM gl_code_combinations a,
           apps.ap_ae_headers b,
           apps.ap_ae_lines c,
           apps.po_distributions d,
           apps.ap_invoice_distributions e
    WHERE e.po_distribution_id IS NOT NULL
       AND d.po_distribution_id = e.po_distribution_id
       AND c.source_table = 'AP_INVOICE_DISTRIBUTIONS'
       AND c.source_id = e.invoice_distribution_id
       AND b.ae_header_id = c.ae_header_id
       AND b.accounting_date <= :b1
       AND a.code_combination_id = d.accrual_account_id
       AND a.segment3 = '3010'
    SQL>select * from table(dbms_xplan.display);
    | Id  | Operation                        |  Name                         | Rows  | Bytes | Cost  | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                 |                               |    20 |  7545 |  7708 |        |      |
    |   1 |  UNION-ALL                       |                               |       |       |       |        |      |
    |   2 |   NESTED LOOPS                   |                               |    19 |  7201 |   825 |        |      |
    |   3 |    NESTED LOOPS                  |                               |    19 |  6612 |   787 |        |      |
    |   4 |     NESTED LOOPS                 |                               |    93 | 28737 |   694 |        |      |
    |   5 |      NESTED LOOPS                |                               |   119 | 32130 |   456 |        |      |
    |*  6 |       FILTER                     |                               |       |       |       |        |      |
    |   7 |        REMOTE                    |                               |       |       |       | AJINNI | R->S |
    |*  8 |       FILTER                     |                               |       |       |       |        |      |
    |   9 |        REMOTE                    |                               |       |       |       | AJINNI | R->S |
    |* 10 |      FILTER                      |                               |       |       |       |        |      |
    |  11 |       REMOTE                     |                               |       |       |       | AJINNI | R->S |
    |* 12 |     FILTER                       |                               |       |       |       |        |      |
    |  13 |      REMOTE                      |                               |       |       |       | AJINNI | R->S |
    |* 14 |    TABLE ACCESS BY INDEX ROWID   | GL_CODE_COMBINATIONS          |     1 |    31 |     2 |        |      |
    |* 15 |     INDEX UNIQUE SCAN            | GL_CODE_COMBINATIONS_U1       |     1 |       |     1 |        |      |
    |  16 |   NESTED LOOPS                   |                               |     1 |   344 |  6883 |        |      |
    |  17 |    NESTED LOOPS                  |                               |     6 |  1878 |  6871 |        |      |
    |  18 |     NESTED LOOPS                 |                               |   572 |   156K|  5727 |        |      |
    |  19 |      NESTED LOOPS                |                               |   988 |   248K|  3751 |        |      |
    |* 20 |       TABLE ACCESS BY INDEX ROWID| AP_AE_HEADERS_ALL             |   978 | 17604 |   817 |        |      |
    |* 21 |        INDEX RANGE SCAN          | AP_AE_HEADERS_N3              | 17595 |       |    82 |        |      |
    |* 22 |       TABLE ACCESS BY INDEX ROWID| AP_AE_LINES_ALL               |     1 |   240 |     3 |        |      |
    |* 23 |        INDEX RANGE SCAN          | AP_AE_LINES_U2                |     8 |       |     2 |        |      |
    |* 24 |      TABLE ACCESS BY INDEX ROWID | AP_INVOICE_DISTRIBUTIONS_ALL  |     1 |    23 |     2 |      
    |* 25 |       INDEX UNIQUE SCAN          | AP_INVOICE_DISTRIBUTIONS_U2   |     1 |       |     1 |        |      |
    |* 26 |     TABLE ACCESS BY INDEX ROWID  | PO_DISTRIBUTIONS_ALL          |     1 |    32 |     2 |        |      |
    |* 27 |      INDEX UNIQUE SCAN           | PO_DISTRIBUTIONS_U1           |     1 |       |     1 |        |      |
    |* 28 |    TABLE ACCESS BY INDEX ROWID   | GL_CODE_COMBINATIONS          |     1 |    31 |     2 |        |      |
    |* 29 |     INDEX UNIQUE SCAN            | GL_CODE_COMBINATIONS_U1       |     1 |       |     1 |        |      |
    Predicate Information (identified by operation id):
       6 - filter(NVL("AP_AE_HEADERS_ALL_H"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
       8 - filter(NVL("AP_AE_LINES_ALL_H"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      10 - filter(NVL("AP_INVOICE_DISTRIBUTIONS_ALL_H"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      12 - filter(NVL("PO_DISTRIBUTIONS_ALL_H"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      14 - filter("A"."SEGMENT3"='3010')
      15 - access("A"."CODE_COMBINATION_ID"="PO_DISTRIBUTIONS_ALL_H"."ACCRUAL_ACCOUNT_ID")
      20 - filter(NVL("AP_AE_HEADERS_ALL"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      21 - access("AP_AE_HEADERS_ALL"."ACCOUNTING_DATE"<=:Z)
      22 - filter("AP_AE_LINES_ALL"."SOURCE_TABLE"='AP_INVOICE_DISTRIBUTIONS' AND
                  NVL("AP_AE_LINES_ALL"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      23 - access("AP_AE_HEADERS_ALL"."AE_HEADER_ID"="AP_AE_LINES_ALL"."AE_HEADER_ID")
      24 - filter("AP_INVOICE_DISTRIBUTIONS_ALL"."PO_DISTRIBUTION_ID" IS NOT NULL AND
                  NVL("AP_INVOICE_DISTRIBUTIONS_ALL"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      25 - access("AP_AE_LINES_ALL"."SOURCE_ID"="AP_INVOICE_DISTRIBUTIONS_ALL"."INVOICE_DISTRIBUTION_ID"
      26 - filter(NVL("PO_DISTRIBUTIONS_ALL"."ORG_ID",NVL(TO_NUMBER(DECODE(SUBSTRB(:B1,1,1),'
                  ',NULL,SUBSTRB(:B2,1,10))),(-99)))=NVL(TO_NUMBER(DECODE(SUBSTRB(:B3,1,1),' ',NULL,SUBSTRB(:B4
      27 - access("PO_DISTRIBUTIONS_ALL"."PO_DISTRIBUTION_ID"="AP_INVOICE_DISTRIBUTIONS_ALL"."PO_DISTRIB
      28 - filter("A"."SEGMENT3"='3010')
      29 - access("A"."CODE_COMBINATION_ID"="PO_DISTRIBUTIONS_ALL"."ACCRUAL_ACCOUNT_ID")
    Note: cpu costing is off
    67 rows selected.
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for