MMBE sql trace

I have a problem. MMBE runs fast on all materials except for one. Based on the sql trace comparison, I found, for that material, the table "EKBE" is also included in the select stmts unlike for other materials, and the fetch / open commands takes a lot of time for that "EKBE" table. Digging furthur, that select statement occurs in the function module: MMPUR_EKBE_ARRAY_READ. But I searched the websites regarding this, yet to no avail. Please help.

SELECT * FROM "EKBE" WHERE "MANDT" = :A0 AND "EBELN" = :A1 AND "EBELP" = :A2 OR "MANDT" = :A3 AND "EBELN" = :A4 AND "EBELP" = :A5 OR "MANDT" = :A6 AND "EBELN" = :A7 AND "EBELP" = :A8 OR "MANDT" = :A9 AND "EBELN" = :A10 AND "EBELP" = :A11 OR "MANDT" = :A12
AND "EBELN" = :A13 AND "EBELP" = :A14
This is the sql statement seen in the beginning of sql trace list, taking lot of time when running MMBE.
Why is that, the phrase "MANDT" = :A0 AND "EBELN" = :A1 AND "EBELP" = :A2 being repeated many times in the sql statement?
At the end of the sql trace list, the sql statement SELECT * FROM "EKBE" WHERE "MANDT" = :A0 AND "EBELN" = :A1 AND "EBELP" = :A2 runs pretty fast.
Please help.

Similar Messages

  • In SQL Trace how to see which statement getting more time .

    Hi Expart,
    In SQL Trace (T-code ST05) . I am running the standard transaction . how to see which statement
    running more time and less time . suppose one statement running more time so how resolve the
    performance .
    Plz. reply me
    Regards
    Razz

    > The ones in 'RED' color are the statement which are taking a lot of time and you need to
    > optimise the same.
    No, that is incorrect, the red ones show only the ones which need several hundret milliseconds in one execution. This can even be correct for hard tasks. And there are lots of problem, which you will not see
    I have said everything here:
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    Go to 'Tracelist' -> Summarize by SQL statements', this is the view which you want to see!
    I summarizes all executions of the same statement.
    There are even the checks explained, the slow ones are the one which need a lot of time per record!
    See MinTime/Rec > 10.000 microseconds.
    Check all number of records, executions, buffer, identicals.
    The SE30 Tipps and Tricks will not help much.
    Siegfried

  • Sql trace

    Hi All,
    I am new to this ABAP field..
    I know how to do SQL trace ....But what I am not getting is " <b>HOW CAN WE TELL FROM THE OUTPUT OF SQL TRACE, THAT THIS IS THE CAUSE OF SLOW PERFORMANCE OF A REPORT</b>" Based on what are we determining the performance?
    Can Anybody help me here pls?............
    Kelly

    Hi Kelly,
    if you really have no idea, why a report is slow, then you have to start with SE30 (runtime analysis).
    There are three bargraphs: ABAP / database / system.
    System should be more or less nothing.
    If ABAP is bigger than database: have a look at slow abap-statements (normally operations with internal tables: read, delete, loop where,...); classic reason: to much reads without binary search / sorted table / hashed table use.
    If database is bigger than ABAP: have a look at your SQL statements. If you can see already forgotten key fields, fine - otherwise SQL trace will bring help in analyzing.
    A SQL trace itself says nothing about overall performance (which is done by runtime analysis), only about database part. But 'normally' programmers have their ABAP-part in control and struggle only with slow selects: that's the reason, why often SQL trace is used immediately.
    I hope, this brings a little bit light in your question,
    regards,
    Christian

  • Create sql trace files on client machine

    Hi
    oracle creates sql trace files on server side, what are possible and best ways of sharing those files with end users? is it possible to create them on client side instead?

    Dbb wrote:
    Hi
    Hi
    oracle creates sql trace files on server side,
    Yes
    what are possible and best ways of sharing those files with end users?
    Using shared directory. Use the parameters dump to point to it
    is it possible to create them on client side instead?
    No
    . :-) any help with my english is wellcome :-) .does this mean sharing user_dump destination at linux level and then mounting it from client machines ( win xp )?is there any doc on this?

  • How to look at the SQL trace in Oracle

    Hi,
    How do we look for the SQL trace in Oracle?
    With SQL trace I mean all the SQL statements being executed in Oracle database ( including select ).
    Thanks........

    Thanks for a quick reply nbellam. I wonder if there is a way to find out the date and time when the sql was executed?

  • Analysing details of SQL trace and runtime analysis for a report.

    Hi,
    I am trying to tune the performance of a Z ABAP report for target group export. A brief overview of what is done in the report is the retrieval of BP details present in the Target group including BP general, address, marketing attributes, person responsible and contact person details. As the target groups can be quite huge (around 6000 BPs), the report gives performance issues. I want to understand on how to analyse the details which I obtained from the run time analysis and SQL trace and on how to take it forward.
    Any inputs in this regard would be helpful.
    Thanks in advance,
    Anushree

    In Runtime analysis Look for
    ABAP -  In your ABAP code
    DATABASE  -  It shows the performance of your SELECT statements in your program.
    Just check how much % it is showing for both.
    Check for following in your code.
    1) Avoid SELECT *
    2) Clear internal tables values which are not required at the ending of program, as it saves memory
    etc.

  • Unable to generate SQL trace file on a 10.2.0.1.0 database

    Hello,
    I am unable to generate SQL trace files on a 10.2.0.1.0 database (OS is Win2003 server 64 bits).
    First I tried the way I used to do it on older databases (8i and 9i) :
    execute dbms_system.set_sql_trace_in_session(sid, serial#, true);
    I got no error, but no file was created in the user dump dest directory.
    Then I've been searching and I've tried other things :
    - I changed the user_dump_dest parameter
    - I changed the tracefiles_public parameter value to "true", by modifying the init.ora file
    - I tried another package :
    exec dbms_monitor.session_trace_enable(139)
    Nothing worked, I can't create any trace file...
    Does anyone have an idea about this issue ?
    thank you for you help !
    Antoine

    Hello,
    thank you all for replying.
    I have 2 instances on this machine, and I've just realized that with the other one I have no problem to generate sql trace files as usual.
    But why the hell is it impossible on the first instance ? What difference between the 2 instances can explain this ?
    This is pretty weird...
    Otherwise I am experiencing serious performance problems on the instance where I can't creat trace files, there must be something wrong with it, but I can't figure it out
    regards,
    Antoine

  • What is SQL Trace and How to Use it .

    Dear Experts .
    1.) May You Please tell me What is the Purpose of SQL-Trace and How to use it ?
    2.) What is purpose of T-codes SE30 and ST22 ?
    Please it is urgent ...
    Regards :  Rajneesh

    Hi
    SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
    The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
    The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
    To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
    Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing. 
    STEPS
    Run time analysis transaction SE30
    In Transaction SE30, fill in the transaction name or the program name which needs to be analyzed for performance tuning.
    For our case, let this be “ZABAP_PERF_TUNING”
    After giving the required inputs to the program, execute it. After the final output list has been displayed, PRESS the “BACK” button.
    On the original SE30 screen, now click on “ANALYZE” button.
    The percentage across each of the areas ABAP/ Database/System shows the percentage of total time used for those areas and load on these areas while running the program . The lesser the database load faster the program runs.
    SQL Trace – ST05
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test  Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter.
    Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data: PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • Can I set up SQL Trace or Audit to connect to servers

    I have a server (2003) with SQL (2005) on it. 
    If i install MS SQL Management Studio 2012 on my PC, can I audit what SQL on that server is doing by connecting to it from the PC ?
    Or would it be better to set up SQL Trace on the server itself ?
    Thanks
    Pete

    So if I install SSMS 2012 on my PC, I can connect to the databases on different servers from 1 place. 
    Yes, as long as there is network connection.  In SSMS open up the Registered Servers window and register all servers:
    http://technet.microsoft.com/en-us/library/ms188231.aspx
    Related thread:
    http://social.msdn.microsoft.com/forums/sqlserver/en-US/8209ad2c-6efd-49d6-9605-b7f348eb56bb/how-to-connect-sql-database-on-different-network
    Setting up server-side tracing:
    http://www.sqlusa.com/bestpractices/createtrace/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Finding SQL trace and Log trace in SAP ME

    Dear Experts,
    I am new to SAP ME SDK 2.0  development. After depolying the ME with changes.If an error occurs as "An internal error occurred; contact technical support". Where should I check for the traces like SQL trace or og trace.
    Thanks in advance,
    Eswaraiah M.

    Hello,
    Log records are written to NW log and can be viewed in NW log viewer.
    Konstantin

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

  • OCCI/ODBC application sql trace failure...

    Hi,
    I was doing the sql*net trace for an OCCI/ODBC Application writen in c++. I have an InstantClient on my PC. I was trying to access the Oracle through my C++ program to
    compare the performance of OCCI and ODBC.
    I was using the Oracle 10g(ver10.2.0.1.0 ), Oracle instant cilent(win32-10.2.0.3-20061115), and VS 8.0.
    TNSNAMES.ora:
    ORCL =  
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    (SID = ORCL)
    LISTENER.ORA:(It was created by net manager.)
    SID_LIST_LISTENER =
      (SID_LIST =
      (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (ORACLE_HOME = F:\oracle\product\10.1.0\Db_3)
      (SID_NAME = ORCL)
    LISTENER =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = HOST_NAME)(PORT = 1521))
    The sqlnet.ora file was writen to trace the client sql. Fortunately, my C++ program can access the oracle and get my result back successfully. In the same time, the trace files
    can be created, but when using the tkprof tool to explain it, it comes to the file with useless information.
    One of the *.trc file explaind by tkprof tool:
    Sort options: default
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    Trace file: ora21763.trc
    Trace file compatibility: 8.00.04
    Sort options: default
    1 session in tracefile.
    0 user SQL statements in trace file.
    0 internal SQL statements in trace file.
    0 SQL statements in trace file.
    0 unique SQL statements in trace file.
    327 lines in trace file.
    Finally, I got TNS-12518 TNS-12564 error. I tried to add DIRECT_HANDOFF_TTC_LISTENER=OFF, but it didnt work. I traced the listener, the error occured in the listener.trc "
    ntt2err: soc 464 error " and " nsbequeath: error reading REDIR/NSE msg".
    I just cann't get the right trace file and cann't sovle the two errors(TNS-12518 TNS-12564). Can somebody give me some advices, please.

    Hi,
    The TKPROF facility accepts as input an SQL trace file generated when SQL Trace has been turned on for the system or a session, not a SQL*NET trace file. A SQL*Net trace file is a dump of raw data packets and communications at the SQL*NET layer. If you want to get performance statistics from SQL beign executed by your application, then you need to turn on SQL Trace not SQL*MET tracing.
    To enable SQL trace at the system level, you need to execute:
    alter system set SQL_TRACE=TRUE
    The NS-12518 TNS-12564 normally means you are running into some sort of resource deletion issue. This can be caused by various things. Make sure you are properly cleaning up and closing sessions in your application.
    Are you performing some sort of stress test or have you just written a Multi-threaded test harness that executes different types of SQL with OCCI/ODBC?
    HTH
    J.B.

  • Generate Sql Trace in oracle reports

    Hi,
    My Reports version is 10.1.2.0.2 and I would like to see the trace files of the sql queries that are executed while generating a report using rwbuilder.
    I tried using a Formula column, with
    SRW.DO_SQL('ALTER SESSION SET SQL_TRACE=TRUE');
    return(1);
    Also, I enable system level trace to capture anything and everything that is being fired into DB from reports.
    I tried,
    ksh rwthinclient.sh report=$REPORT_FILE_PATH/Journal.rdf server=$REPORT_SERVER userid=$ORAUSERID/$ORAPASSWD@$REPORT_DATABASE destype=cache desformat=pdf TRACEFILE=ver1.trc TRACEOPTS=trace_all TRACEMODE=trace_replace RUN_DATE=$CurDate;
    I do not get trace at all. Kindly help me out.

    Hi,
    Maybe have a look at this MOS note: Running SQL*Trace on an Applications Report [ID 1019231.6]
    Regards Peter

  • SQL Trace in Oracle

    Hello,
    I am a Software Engineer using Oracle 9i Client. We have a website which is using ASP at front-end,Oracle as a back-end and some dll which is created in VC++. This dll will interact with oracle. When the ASP pages gets executed, it will execute the dll which in turn execute the oracle SQL's. So, I want to see SQL statements which are executed in Oracle. This type of feature is available in MS SQL Server 2000 tool called Profiler.
    Thanks
    Golak Saha
    Software Engineer

    Hi,
    Maybe have a look at this MOS note: Running SQL*Trace on an Applications Report [ID 1019231.6]
    Regards Peter

  • Explain plan not displayed in sql trace file

    Hello,
    I don't understand why in sql trace file, after tkprof transformation, for several queries the explain plan is displayed and for several queries, no explain plan is displayed.
    How can I have the explain plan for all queries?
    Thanks for your help.

    Was this a trace started on an already running task? Was the trace stopped before the task completed? Did the trace file reach its set size limit before the task compled?
    In all three cases above you would have cursors that were not closed and stats information not written to the trace file resulting in incomplete data for some SQL.
    HTH -- Mark D Powell --

Maybe you are looking for