Sql trace for forms sessions

Q1.How can you trace the session of forms?

c:\ifrun60 module=<formname> userid=scott/tiger
statistics=yes
This will do a alter session set sql_trace=true in the background.

Similar Messages

  • Automize SQL TRACE for a selected session

    Hi,
    Should I automize the process of SQL Tracing for a particular session of our choice?
    Let’s say when there are several sessions, and we want to select the particular session for SQL TRACING, then the SQL tracing for that session enable via running a routine.
    I used AFTER LOGON trigger for enabling SQL trace, but using this approach enable SQL TRACING all the sessions.
    My Logon Trigger for enabling SQL Tracing:
    create or replace trigger LOGON_SQL_TRACE
    after logon on database
    begin
    execute immediate
    'alter session set sql_trace=true';
    end;
    I want to use a perfect routine that first get the sid, serial# or username etc. from V$session, V$process or else, and then enable the SQL TRACING for the selected session.
    Like SYS.DBMS.SYSTEM.SET_SQL_TRACE_IN_SESSION package is available for doing that or may be some others as well.
    But how should we use these packages or other SQL tracing commands in a routine, which we can use for, enable SQL Tracing implicitly.
    Any ideas will be great.
    Bill

    SYS.DBMS.SYSTEM.SET_SQL_TRACE_IN_SESSION is just fine.
    You can get the SID and SERIAL# from v$session; you just have to know the username, osmachine, the OS process, ...
    Fred

  • How to set SQL trace in OCI session ?

    Hello,
    In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal.
    However, if I cannot change the code of this OCI client, is there a way to set SQL trace for that single session alone, without changing the C code? Say, through an environment variable, configuration file, etc.?
    Thanks.

    I am not aware of a way to selectively enable the server-side tracing without modifying the client code.
    There is client tracing available by setting the environment variable EVENT_10842 as follows:
    "server=<>;user=<>;stmt=<>;level=<>;interval=<>"
    e.g.
    setenv EVENT_10842 "server=inst1,inst2;user=scott,system;stmt=all;level=15"
    Where:
    "server" is a comma separated list or "all"
    "user" is a comma separated list or "all"
    "stmt" can be INSERT,UPDATE,DELETE,SELECT or "all"
    The following levels are supported:
    1 - Trace all server attach and server detach calls for servers listed in "server" attribute of the environment variable.
    2 - Trace all session begin, logon, session end, logoff calls for the users listed in "user" attribute of the environment variable.
    3 - Trace all prepare, execute, fetch calls for the specified statement types listed in "stmt" attribute of environment variable.
    4 - Trace all Bind, Define, Describe calls.
    5 - Trace all OCI LOB calls
    7 - Get statistical info on all connection pooling /connection related calls
    8 - Get statistical info on all session info
    9 - Get statistical info on all handle info
    10 - Get statistical info on time taken in execute and fetch calls
    11 - Get statistical info on transaction related calls
    15 - Trace all calls with statistical info.

  • Enable Trace for the Session Loggied in..

    Hi All,
    How to enable trace for the session logged in with out db bounce.
    after enable how to stop and how to get the trace file in readable format.
    Please suggest
    Thanks
    Mano

    Trace a session.
    1)Logout all sessions from the database
    2)Login to application (ensure that only one session is available)
    3)sqlplus trace/trace
    Schema which has privilege to trace the session
    4)check the sid and serial# of the session from v$session
    Use the following query
    SQL> select username,to_char(logon_time,'DD-MON-YYYY HH:MI:SS') from v$session where username='<db username>' order by logon_time;
    SQL>exec sys.dbms_system.set_sql_trace_in_session(sid,serial#,TRUE);
    5)now execute the report/transaction.
    6)once the activity is over
    SQL>exec sys.dbms_system.set_sql_trace_in_session(sid,serial,FALSE);
    7)Now the trace file will be available in the udump folder of the database ip
    Userid/password: trace/trace
    The trace wil be available in /oracle/admin/orcl/udump
    8)To find the name of the trace file use the below query
    select spid from v$process where addr=(select paddr from v$session where sid=<enter the SID>);
    This will give the name of the file
    If you are not able to identify the trace file then please remove all files in udump before starting trace.
    9) ftp the trace fil to ur local pc and issue the tkprof command
    TKPROF <trace file (like D:\orcl_8853.trc)> D:\trace.txt explain=Oracle username/password (application user) sort=(prsela,exeela,fchela)
    This will give trace file in readable format(you need to have 10g client on your pc for tkprof to work)

  • No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n

    No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n.
    IN ST05 I set a filter for ME21N and executed transaction to create a Purchase Order and then checked
    ST05 but there is  NO insert for EKKO or EKPO??
    How Do I find in which columns of EKKO and EKPO data is inserted in ST05?
    Edited by: DeepakNandikanti on Apr 28, 2010 8:27 AM

    Hi,
    I tried in my system and I can see INSERT statement on EKKO and EKPO tables. What exactly you are looking for? Some one else might have switched on the trace at the same time. Can you try again and see.
    ST05=>Switch on trace
    ME21N=>Create PO.
    ST05=>Switch off and display trace.
    In trace list search for EKKO and EKPO.
    Column names are not shown in the trace list. It is the SQL trace and column list is generated dynamically like :A0, :A1....
    @ Suhas,
    That might be because the tables are updated via BAPIs ... Do you think SAP uses direct update statements on the DB tables ??
    I didn't get above statement. Is there any other way of updation that happens when using BAPI? I believe that, even in case of BAPI there will be update task FMs called during database update. Please correct if i got it wrong.
    Thanks,
    Vinod.

  • SQL trace for Background jobs

    Hi
    Can anyone suggest how to find the SQL trace for background jobs.
    Thanks in advance.
    Regards
    D.Vadivukkarasi

    Hi
    Check the transaction ST05.
    Plz Reward Points if helpful

  • SQL TRACE for WEB deployed report

    When I put
    Alter Session Set sql_trace=TRUE
    into the BEFORE Parameter Form trigger...
    I get a trace file showing data on the one SQL in that trigger.
    There is no TRACE output of the main query or any of the PL/SQL in the Program Units.
    The report is invoked from company-wide intra-net.
    I think it is Oracle Apps running in Linux server.
    What am I doing wrong?
    PS
    I cannot execute this report from Report Builder.

    Hello,
    Just a remark : if you are using Reports 9.0.4 / 10.1.2, you don't have to modify the reports , you can activate the SQL trace with the parameter SQLTRACE=YES
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/cmdline/common/cla_sqltrace.htm
    Regards

  • SQL Trace for schema level

    Hi
    Database 10.1.0.4
    Sql trace file which I have used but didn't get the trace file. I have tried to get per session Id but not able to get the trace file, when ever user logged into application, virtually 6 user get lgged in and you never know about user. So I have desided to capture for schema
    I have used this for tracing
    SQL> ALTER SESSION SET sql_trace=TRUE;
    SQL> ALTER SESSION SET sql_trace=FALSE;
    Or
    SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => TRUE);
    SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => FALSE);
    or
    SQL> EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid=>123, serial#=>1234, sql_trace=>TRUE);
    SQL> EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid=>123, serial#=>1234, sql_trace=>FALSE);
    I want to get trace file for schema, can anyone suggest how do I get trace file at schema level.
    Thanks for help

    Hi,
    Using instance-level tracing by setting the init.ora/spfile... parameter SQL_TRACE=TRUE, all processes against the instance will create their own trace files. This particular method of tracing should be used with care since it creates a great deal of overhead against the system. In addition, the default value for this parameter is FALSE.
    Cheers
    Legatti

  • SQL TRACE FOR THIRD PART TOOL

    Hi,
    Should we use the Logon trigger for SQL TRACING,for the third party tool?
    How should we manage SQL tracing and then read this trace file using
    TKPROF for that specific session that is using the third party tool?
    I wanted that whenever this third party tool connect to database with any user, the sql tracing will start for that specific seesion and then read the sqltrace for that session using TKPROF.
    Any ideas/exmp will be great.
    Regards
    CLEE

    Should we use the Logon trigger for SQL TRACING,for the third party tool?
    Yes you can use like
    CREATE OR REPLACE TRIGGER af_sess_Logon
    After logon on database
    Begin
    if ( user='SCOTT') then
    execute immediate 'alter session set sql_trace=true';
    End if;
    End;
    sql tracing will start for that specific seesion and then read the sqltrace for that session using TKPROF.
    for tkprof you can user command line
    or use host in sql
    kuljeet pal singh

  • SQL Trace for ODS Scripts

    Hi,
    How can I turn on SQL Tracing for ODS Transfer scripts?
    Best regards,
    Johan

    Hi Johan,
    If SAP Note 1289112 is not the case, please clarify what "ODS Transfer" means.
    Regards,
    Sergiy

  • How to see SQL TEXT for inactive sessions.

    Hi,
    I have SID where the session have been completed.I wanna know,what the session has done.
    Is there any sessions which has SQL TEXT of inactive sessions.
    Thanks.Plz help me.

    Hi,
    As others already suggested, try this SQL below:
    select sess.sid,
           sess.serial#,
           sess.username,
           sql_text
    from v$sqlarea sqlarea, v$session sess
    where sess.prev_hash_value = sqlarea.hash_value
       and sess.prev_sql_addr  = sqlarea.address
       and sess.username is not null
       and sess.status='INACTIVE';   Cheers
    Legatti

  • Help in sql trace for vf03

    Hi,
      i was tracing the sql statments present in vf03 transaction for the invoice no.'s with accounting document over all status as not clear.
    i want to know the flow of the sql statements right from the user giving the invoice no. as input to the document flow window to know from where and how it is picking the accounting doucment over all processing status
    waiting for ur replies
    regards,
    maqsood

    Hi
    You should look at the code of std fm RV_ORDER_FLOW_INFORMATION, here you can see all selects the system does.
    Anyway the tables are VBFA (document flow), VBUK and VBUP. But you can't find that information here, because it's only in accounting not in sales.
    So perhaps the abap code you're looking for it's this:
    if vbrk-vbeln <> vbfa_tab-vbeln.
        perform vbrk_ermitteln using vbfa_tab-vbeln.
        check sy-subrc = 0.
        check xvbrk-rfbsk = 'C' or  xvbrk-rfbsk = 'J'.
        read table xdoc_num with key vbeln = vbfa_tab-vbeln
                            binary search.
        tabix_xdoc = sy-tabix.
        if sy-subrc = 0.
          check xdoc_num-not_found is initial.
        else.
          refresh xbkpf.
          call function 'FI_DOCUMENT_READ'
               exporting
                    i_awtyp     = 'VBRK'
                    i_awref     = vbfa_tab-vbeln
                    i_awsys     = vbrk-logsys
                    i_bukrs     = vbrk-bukrs
                    i_gjahr     = vbrk-gjahr
               tables
                    t_bkpf      = xbkpf
                    t_bseg      = xbseg
               exceptions
                    wrong_input = 1
                    not_found   = 2.
          describe table xbkpf lines sy-tabix.
          if sy-tabix ne 0.
    Delete documents from other fiscal year
            if sy-tabix > 1.
              CALL FUNCTION 'FI_PERIOD_DETERMINE'
                EXPORTING
                  i_budat        = vbrk-fkdat
                  i_bukrs        = vbrk-bukrs
                IMPORTING
                  e_gjahr        = da_gjahr
                  e_poper        = da_poper
                EXCEPTIONS
                  fiscal_year    = 1
                  period         = 2
                  period_version = 3
                  posting_period = 4
                  special_period = 5
                  version        = 6
                  posting_date   = 7
                  OTHERS         = 8.
              IF sy-subrc = 0.
                CONCATENATE da_gjahr da_poper INTO vbrk-gjahr.
              loop at xbkpf where gjahr ne vbrk-gjahr.
                delete xbkpf index sy-tabix.
              endloop.
              ENDIF.
            endif.
            loop at xbkpf.
              clear l_xdoc_num-status.
              move 'BKPF'      to l_xdoc_num-awtyp.
              move xbkpf-bukrs to l_xdoc_num-bukrs.
              move xbkpf-belnr to l_xdoc_num-docnr.
              move xbkpf-cpudt to l_xdoc_num-cpudt.
              move xbkpf-gjahr to l_xdoc_num-gjahr.
              l_xdoc_num-vbeln = vbfa_tab-vbeln.
              l_xdoc_num-logsys = vbrk-logsys.
              clear l_xdoc_num-not_found.
              loop at xbseg where bukrs eq xbkpf-bukrs
                            and   belnr eq xbkpf-belnr
                            and   gjahr eq xbkpf-gjahr
                            and   ( koart eq 'D' or koart eq 'K' ).
              endloop.
              if sy-subrc ne 0.
                l_xdoc_num-status = 'C'.
              else.
                loop at xbseg where not augbl is initial
                              and   ( koart eq 'D' or koart eq 'K' ).
                endloop.
                if not sy-subrc is initial.
      SET STATUS TO 'No items are cleared'
                  l_xdoc_num-status = 'A'.
                else.
                  loop at xbseg where augbl is initial
                                and   umskz ne 'A'
                                and   vorgn ne 'AZUM'
                                and   ( koart eq 'D' or koart eq 'K' ).
                  endloop.
                  if not sy-subrc is initial.
      Set status to 'All items are cleared'
                    l_xdoc_num-status = 'C'.
                  endif.
                endif.
    Otherwise: If there are customer/vendor positions where AUGBL is
    filled and some other ones where AUGBL is blank then set status
    to 'Partially cleared'
                if l_xdoc_num-status is initial.
                  l_xdoc_num-status = 'B'.
                endif.
              endif.
              append l_xdoc_num.
            endloop.
            insert lines of l_xdoc_num into xdoc_num index tabix_xdoc.
    This is extracted from include LV05CF01
    Max

  • Equivalent Sql function for Forms NAME_IN() built in

    Please let me know, is there any equivalent Sql function equivalent to Forms Name_in() built in. Thanks.

    What would such a function do in pure SQL? Or are you asking if you can refer to Forms variables in SQL that you issue from Forms?
    The answer to the first question I will delay until you define what it is that you want to do. The answer to the second question is that there is no way to do that. The database has no way of knowing how to resolve references to variables defined in client side PLSQL.

  • SQL Tracing for session started from Java code

    I am working with Oracle 10g on Solaris 9. I am facing a problem when trying to enable SQL Trace for Oracle sessions initiated from Weblogic server. I am querring V$SESSION to get the SID and SERIAL# of those sessions and then using DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(<sid>, <serial#>, TRUE); from the SQLPlus (using sys login). But the trace file is not being generated in UDUMP even after some queries are fired from the application. But when I am using the same procedure to turn SQL Trace on for SQLPlus sessions or SQLDeveloper sessions, they are just working fine.
    Can anyone please help me out?

    Please help.....
    There is already a thread
    Problem with SQL_Trace for a Session
    but there is no solution there.

  • Retrieving SID (Session Id ) for a Oracle Forms Session

    Hi
    I am using financials after a break of couple of years and things have changed. I am trying to trace a form .So I set trace from the menu.Then I open the form Query , do other activities and close the form.Then I go to the Unix server and examine the Trace file by TKPROF. However the SQL Selects dont appear in the Trace.
    So I am wondering if there is a concept of Session for a Web application(Which is normally stateless). But I understand that the Forms Application runs as an applet in the browser.Does Oracle maintain single session for an EBS login until logout- or does it open a new session whenever you open a form or do a query. I am not exactly sure - I checked some documenation but still am unclear. Also if it is maintaining a connected state how can I determine the session ID SID (So I can query v$session and associated tables for information I am interested in).

    AFAIK, the forms interface maintains the same database session. The database session gets created when you first use the forms interface and gets terminated when you exit the forms interface. Pl see this related thread on how to trace a forms session - Doing a Trace on the ARXADLMT Approval Limits form No Select statement i
    HTH
    Srini

Maybe you are looking for