SQL Trace and Bind Values

I need to capture bind values in SQL Trace. I am running Oracle 9.2.0.8. I will be running my queries from an application, not SQL Plus. I can use a after log on trigger to turn on trace. Has anyone done this with success? Are there any other ways to do this at the server level?
Thank you for your input
David

Hello David,
it is such easy ... you wouldn't believe it.
Have a look at the pl/sql procedure "dbms_system.set_ev", with this one you can do this on session level: http://www.oracleadvice.com/Tips/dbms_system.htm#SET_EV
There are also some other possibilities... but this should hit your question..
To turn on:
SQL> exec dbms_system.set_ev(<SID>, <SERIAL>, 10046, 12, '');
To turn off:
SQL> exec dbms_system.set_sql_trace_in_session(<SID>, <SERIAL>, FALSE);
Regards
Stefan

Similar Messages

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

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

  • Sql trace and tkprof result

    When I use sql trace and tkprof. After I use tkprof, I get the result statistics. However, I don't understand one point that I see many queries which I didn't run. I mean how come these queries executed? and by who?
    thanks

    some could be recursive sql statemets run by oracle. Post some example what you are running and what you are seeing?
    The SQL statements can be listed in a TKPROF report in the order of how much resource they used, if desired. Also, recursive SQL statements issued by the SYS user to manage the data dictionary can be included or excluded.
    How to Use and Understand the TKPROF utility

  • 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

  • Reg : SQL Trace and ECAT

    Hi Floks ,
    Any body knowing The SQL trace analysis and Ecat tool .send me how to work on this issues .Please send me with snap shot it's will help to who don't know how to utilize this tools.
    thanks,
    suresh

    Hi suresh,
    Check these links.
    SQL trace
    http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
    Go to st05 and activate trace, go back and run your transaction or report again go to st05 deactivate trace and click display trace here you can find information with this you can performence analysis, database tables, fields etc.
    ECAT
    eCATT stands for extended Computer Aided Test Tool (eCATT) which is built is testing tool to test SAP system. By using testing tool we can test the entire business process, and we can also use this tool with a third party testing tool (I am not covering this topic). Execution of every test script ends with a log, which explains the results of the test script.
    By using eCATT we can do following operations,
    ·        Test transactions, reports, and scenarios
    ·        Call BAPIs and function modules
    ·        Test remote systems
    ·        Check authorizations (user profiles)
    ·        Test updates (database, applications, GUI)
    ·        Test the effect of changes to customizing settings
    ·        Check system messages
      For more information go to
    http://help.sap.com/saphelp_erp2004/helpdata/en/2a/121e3bd711bb04e10000000a114084/frameset.htm
    To develop a test script in eCATT we need to follow the following steps,
    1. Creating Test Scripts.
    2. Creating Test Data Containers[16] .
    3. Understanding System Data Containers[17] .
    4. Executing Test Configurations.
    There is a very good web blog on eCATT in sdn.com which explains eCATT with necessary screen shots.
    To read document click here Blog on eCATT
    http://www.sapdevelopment.co.uk/testing/ecatt.htm

  • SQL Trace and TKprof

    Hello,
    Can someone tell me what is SQL trance and TKprof?
    when we will apply and what need of this?
    why i should give alter session set sql trace = true?
    if someone could give me an idea of what is a TKprof do, would be apprecaited.

    if someone could give me an idea of what is a TKprof doThe doc has an idea : http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#PFGRF01010
    Nicolas.

  • Monitor database job-find out current statement and bind values

    Hi all,
    we have a job running on one of our databases which sometimes runs for a very long time.
    Sometimes it it is necessary to kill that job because it is blocking normal work.
    Therefore it is important to find out the current statements the job is processing in order to avoid too much trouble after killing.
    Job processing is a chain of several procedures that insert, update, delete from different tables dependant on initital user input.
    Database is 10203 on solaris 10. Job was created with dbms_job (no em job).
    Is there any way to find out the job's current statement and relevant bind values?
    FJH

    http://www.orafaq.com/wiki/SQL_Trace

  • INSTR and bind values

    Hi everybody,
    I would like to search for a certain string in a varchar2 type column using the INSTR function.
    Is it possible to use bind variables this way ?
    bind2 varchar2(50) := 'mysearch';
    if instr(bind1, bind2 ) <> 0 then
    I also tried to use regexp_instr or regexp_like but it still does not find my bind2 string in the bind1 variable.
    Thank you for your help
    Jean-michel, Nemours, France

    Hi, Jean-Michel,
    Are you sure the problem has anything to do with how you're using INSTR? Maybe you're not using the values you think you're using. Display them right before calling INSTR, like this:
    dbms_output.put_line (      vcurlignesawr.output
                   || ' = vcurlignesawr.output, '
                   ||     trouve
                   || ' = trouve before calling INSTR'
    if instr(vcurlignesawr.output,trouve) != 0 then
    user11986785 wrote:Here is the sql I am using :
    +...cursor lignesawr(baseid in NUMBER,snap_debut in NUMBER,snap_fin in NUMBER) is+
    SELECT output, rownum r FROM table(DBMS_WORKLOAD_REPOSITORY.awr_report_text (baseid, 1, snap_debut,snap_fin));
    TYPE Lignes IS TABLE OF VARCHAR2(50);
    TYPE TabLignes IS TABLE OF Lignes INDEX BY binary_integer;
    recherches TabLignes;
    +...+
    for vcurlignesawr in lignesawr(baseid,snap_debut,snap_fin) loop
    What values do you want to use inside the cursor? You defined the cursor with 3 parameters (baseid, snap_debut and snap_fin). Those names are only used inside the cursor definition; they have nothing to do with any variables anywhere else, including the code that opens the cursor. If you open the cursor like this:
    for vcurlignesawr in lignesawr(x, 5, x+5) loopthen, when it runs, it will do this
    SELECT  output
    ,      rownum     r
    FROM      table ( DBMS_WORKLOAD_REPOSITORY.awr_report_text ( x       -- the parameter baseid
                                              , 1
                                        , 5       -- the parameter snap_debut
                                        , x + 5  -- the parameter snap_fin
               );You have to pass values to the cursor. You can have local variables that have the same names (baseid, snap_debut and snap_fin), but I don't recommend it, because they would be completely separate variables, and people reading the code would get confused about which variable was meant at any time.
    ... Sorry for the bad display.
    How is it possible to display the code properly ?Whenever you post formatted text on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    This site normally doesn't display the &lt;&gt; inequality operator.  Use the other, equivalent inequality operator, !=, when posting here.  For example:if instr (vcurlignesawr.output, trouve) != 0 then

  • Using Sql Result and Limit Value in Prompt OBIEE 11.1.1.5

    Dear Gurus,
    I have prompt hierarchy like this:
    Year
    Quarter
    Month
    Which are using limit value (Quarter depend on Year, Month depend on Quarter), but I have issue because appear null also in those prompt
    I have checked my database, view, repository there are not null.
    My questions is, how to remove null in prompt when sql result can't use together with limit value, I don't know how to remove it using column filter.
    NB:I already using presentation variable in sql result in order to remove null and using constraint, but it show nothing in prompt view unless we press apply button.
    So I don't use this
    Please help, kindly appreciated
    JOE
    Edited by: JoeSSI on Mar 27, 2012 2:03 AM

    Hi,
    Can you edit your prompt here you can find show option then select SQL Result please modify statement like below.
    SELECT your column name FROM subject area where your column name is not null
    Go--> Edit your prompt--> Show--> Select Sql result---> change statement like above.
    Second way.
    Go to physical layer then double click your column name here you can find *"nullable"* option please check that.
    Go--> Physical Layer--> Extract table --> select your column name-->double click your column name--> here you can find option like Nullable please check it.
    Award points it is useful.
    Thanks,
    Satya

  • SQL*Loader and timestamp values

    I'm loading timestamp values (among other data) from a text file into Oracle using SQL*Loader.
    The data I load is formatted like the following:
    2008/11/13 23:55:21.366
    2008/11/13 23:55:22.782
    2008/11/13 23:55:25.879
    Hence my control file look like this:
    TSTAMP TIMESTAMP "YYYY/MM/DD HH24:MI:SS.FF",
    The timestamp data in the input file are in UTC, however I load into a column that is of type "TIMESTAMP(3)", i.e. in server time. This is on purpose. I do not want the data to be in UTC when I look at them.
    Therefore after the load I have to manually do
    UPDATE mytable
    SET tstamp = tstamp + (tstamp - sys_extract_utc(tstamp));
    This update-after-loading actually takes quite some time due to the amount of records. I would like to avoid it and instead do it as part of the load. Is this possible somehow?
    I'm on Oracle 10.2.
    Thanks.

    Hi
    What about setting a special Time Zone in your database?
    You have two options when setting which time zone the database belongs to. You can either qualify it as a displacement from GMT/UTC in the format of 'hh:mm' or you can specify it as a name that has an entry in the V$TIMEZONE table.
    select tzname,tzabbrev from V$TIMEZONE_NAMES;
    select DBTIMEZONE from dual;
    ALTER database SET TIME_ZONE = 'Denmark/Copenhagen';
    select SESSIONTIMEZONE from dual;
    select CURRENT_TIMESTAMP from dual;
    See that link
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref319
    Edited by: Hub on Dec 7, 2008 3:58 PM

  • Differences between sql id and hash value

    Hello All,
    I have read the following from Tom's web site. Ask Tom &amp;quot;What is a child cursor&amp;quot;
    Dear Tom,
    Appreicate your services to the oracle community.
    What is the column combinations which is leading to SQL_ID.  is SQL_ID = hash_value + address ?  Regards Lalitha
    Followup   August 28, 2012 - 1pm UTC:
    sql id = hash( sql statement )
    hash value is maintained for backward compatibility, sqlid is a new, better hash.
    I am just wondering what did he mean when he said "hash value is maintained for backward compatibility, sqlid is a new, better hash."?
    If both of them are the output of hash function, could someone please explain clearly what is the differences between SQL_ID and HASH_VALUE?
    Thanks for your help.

    SQL_ID is just a fancy representation of hash value | Tanel Poder&amp;#039;s blog: IT &amp;amp; Mobile for Geeks and Pro…
    Regards
    Jonathan Lewis

  • SQL SELECT and Return values

    I have a simple SELECT statement in a Stored Proc that
    queries 2 tables in
    SQL Server 2000 using a join. My problem is I want to return
    values based on
    the outcome of the query eg. if a row is returned then return
    1, or return 2
    if no rows are found. I have tried various ways to implement
    this and they
    always work fine in Query Analyser but in Dreamweaver MX2004
    either return
    no return values ( or at least they are not displayed on my
    page ) or the
    return values are inconsistent. I am using a DW Command.
    I know this is DW and not my code as Query Analyser produces
    the correct
    values every time. Can anyone tell me what code I can use
    that is DW
    friendly please.
    Thanks.

    I read your note with a great degree of sympathy but no
    solutions. I was having the same trouble with access tables after 4
    years of trouble free connections. It may not be relevant but the
    solutions for my problem was a Server software SP release. Details
    are:
    Following the avalanche of hints and tips I am pleased to
    report that there is a problem with Dreamweaver MX and MX2004 when
    connecting to Access databases running on Windows Server 2003 SP1.
    Whilst it is covered in the knowledge base I note that others in
    the forum are having similar difficulties with Sequel connections
    and unable to retrieve failures.
    There is a "fix" - SP2DBFix1.0.2.mxp - for my problem and I
    cannot be alone in experiencing this.
    And just in case anyone from Adobe is reading this, you
    should have written to all your registered and paid up members
    informing us of this problem when WS2003 SP1 was released!
    Hope this helps.

  • SQL_TEXT and Bind Value

    Hi everybody
    I'm looking for the SYS objects that contain SQL_TEXT binded parameters value.
    e.g. :
    In SQL Statement >
    SELECT * FROM MyTab where ThisColumn = :1
    I'm looking for value of ':1' !
    Regards.
    AL

    Is this what you are looking for?
    SQL> desc v$sql_bind_data
    Name                                      Null?    Type
    CURSOR_NUM                                         NUMBER
    POSITION                                           NUMBER
    DATATYPE                                           NUMBER
    SHARED_MAX_LEN                                     NUMBER
    PRIVATE_MAX_LEN                                    NUMBER
    ARRAY_SIZE                                         NUMBER
    PRECISION                                          NUMBER
    SCALE                                              NUMBER
    SHARED_FLAG                                        NUMBER
    SHARED_FLAG2                                       NUMBER
    BUF_ADDRESS                                        RAW(4)
    BUF_LENGTH                                         NUMBER
    VAL_LENGTH                                         NUMBER
    BUF_FLAG                                           NUMBER
    INDICATOR                                          NUMBER
    VALUE                                              VARCHAR2(4000)
    SQL>

  • Inserting field text into sql query and comparing values to another table

    I have an issue in Visual Web Developer 2010 that I need help with.
    The code below is a Gridview Sql query where I'm extracting PART_NUMBER from various tables.  I would like to add the table name in a separate field named Table.  The end result should appear as follows:
    PART_NUMBER     Table
    010-0075-06       Resistors (or Capacitors, etc.)
    Sql query:
    SELECT     PART_NUMBER
    FROM         Capacitors
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Connectors
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Diodes
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         ICs
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Inductors
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Misc
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Relays
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Resistors
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Switches
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Transformers
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         Transistors
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    UNION
    SELECT     PART_NUMBER
    FROM         [Crystals and Oscillators]
    EXCEPT
    SELECT     PART_NUMBER
    FROM         [CIS Manufacturer Parts]
    ORDER BY PART_NUMBER
    I have a separate table (CIS Manufacturer Parts) that contains manufacturer data for the above parts.  Multiple manufacturer rows can exist.  The connection between tables in the PART_NUMBER field.  What I would like to do is make this query
    add the table name to the gridview output listing only parts without manufacturer data and the table they can be found in.
    This is a lot for a newbie so I will appreciate any help, thanks!

    Hello Bulldog248,
    Thank you for your post.
    Your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Payment terms---date and insatllement

    hello SAP gurus, the issue is that we select payment terms when we create sales and order , and we want it to be printed under , 1st installment date and amount , 2nd installement date and amout , 3rd installemnt date and amount. Any suggestions or h

  • Exporting a PDF file

    How do I make a PDF folder of multiple PDF documents in order to export it to an internet site with the goal of creating a printed booklet? I have new MacG5 desktop using Yosemite OS 10.10.1.

  • X6 not automatically connecting to in-built hands ...

    Hi, has anyone else had the problem where the phone won't automatically connect to the inbuilt hands free kit?  We have a Kluger KX-S - our previous phone Nokia 6300 had no problems whats so ever - any ideas?  thanks

  • HP DV6 2030 SD recovery failure

    Hello I have a nearly three year old HP DV6 2030 SD and for several reasons I wanted to reinstall all software. Directly after buying (december 2009)  I made the three rescue DVD's and a system recovery DVD, and just to check, I then reinstalled the

  • Please help! JDK for Mac

    Hello, I'm wondering if anyone could help me (probably anyone because it is such an easy problem). I've been developing simple applications in Windows 95 using a simple text editor and MD dos as a compiler. Now I've moved to an Apple (using OS 9.1) a