Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Question Unanswered: How can I trace SQL-Statements with vlaues of BIND-variables?

    I traced all queries of an application. After that I produced a SQL-file with TKPROF (parameter: "record="). Unfortunatly the values of BIND-variables are not visible. Is there another way to trace sql-statements, where the values of the bind-variables are recorded? Big Thanks!

  2. #2
    Join Date
    Apr 2004
    Posts
    9
    The easiest way is to set a DBMS_OUTPUT<variable>
    however, you can use the DBMS_DEBUG package but this is hardwork.

    Alternitivly you could used Jdeveloper, this lets you step through code and put a watch on a variable bit like java or VB.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    alter session set events '10046 trace name context forever, level 12'
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    Here is some dynamic sql to do this.
    I run this as sysdba whenever I need to trace sessions that
    the application is running.

    either cut/paste or spool this output to trace sessions:
    PHP Code:
    select 
    'Execute sys.dbms_system.set_ev('||sid||','||serial#||',10046, 12, '''');'
    from v$session
    where username 
    username
    and program like 'JDBC%'
    to shut off the tracing:
    PHP Code:
    select 
    'Execute sys.dbms_system.set_sql_trace_in_session('||sid||','||serial#||',FALSE);'
    from v$session
    where username 
    username
    and program like 'JDBC%'
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •