Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Posts
    20

    Unanswered: how do I activate trace

    how do I activate trace for other session as DBA to capture activities ( like SQL etc )
    Do I need to restart the instance?
    Any other way to do it without restart ?
    Thanks!

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    While in SQL*Plus, simply issue

    SQL> ALTER SESSION SET SQL_TRACE = TRUE;

    and execute statement you want to trace. Exit SQL*Plus, go to the directory that holds trace files (it can be found (when connected as SYS) using

    SQL_SYS> SHOW PARAMETER USER_DUMP_DEST

    In there, from the command prompt, issue command

    OS> TKPROF trc_file.trc output_file.txt EXPLAIN=username/password

    and read output_file.txt using some text editor.

    Read more about the whole concept here.

  3. #3
    Join Date
    Jun 2006
    Posts
    20

    how do I do for other session

    how do I do for other session?
    This is only for my session.
    Thanks!

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    As SYS,

    SQL> ALTER SYSTEM SET SQL_TRACE = TRUE

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    PHP Code:
    /*  Log in as SYS                                  */
    /* To trace a remote session just paste the output */
    /* into your sqlplus session.                      */

    select
    'execute sys.dbms_system.set_ev('|| sid ||','|| serial# ||',10046,12, '''');'
    from v$session
    where username 
    =  '&&username';


    /* to turn off: */

    select
    'execute sys.dbms_system.set_sql_trace_in_session('|| sid ||'  ,'|| serial# ||',FALSE);'
    from v$session
    where username 
    =  '&&username'
    - 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
  •