SQL Logging for a specific session or table

Hi!
Don't know if this is the right place to ask, so sorry if it's wrong.
Is there any possibility to log all SQL activity which a specific session id is producing.
Using the Instance Manager I can only see the Latest SQL statement but no history.
Please help my poor soul...
Thanks in advance
Greets, Hansi

Hi Joel and everyone,
Thanks for your information.
But I like to say that, I wanted to store the text of these SQL TRACE files which belongs to different session, into my table SQL_TRACE (session_id, username, text).
As you said that we can use DBMS_SESSION.SET_SQL_TRACE (sql_trace True);
to enable the tracing of particular session.
I know TKPROF is the utility via which we can read these sql trace files.
For Example:
C:\ tkprof c:\SQL_TRACE\ora012929.trc c:\SQL_text\oratext.txt
With regards to this, how should we read the trace files for the users who logon to the database using the feature of logon trigger and then store the text of these sqltrace files of different users into the table SQL_TRACE (session_id, username, text).
I wanted to use my table for getting sqltrace info for Historical purpose.
It is my requirement.
Could you please give your suggestion about it?
Thanks
Jaffery.

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

  • Printing out message history log for a specific co...

    I'm using Skype for Windows v 6.1.0.129 on a W7 PC.
    Is there a way within Skype itself to:
    Printout a message history log for a specific contact?
    If there is, what is the navigational steps to accomplish this task.
    If not, what is the best 'work around'.
    Thxs!

    I have the same problem as I needed the log for my Fiancee Visa application.
    I have just found this software that collates the skype logs.
    I then highlighted the names and dates that I wanted and saved and printed it out.
    http://www.nirsoft.net/utils/skype_log_view.html
    Hope it helps.

  • Oracle SQL query for getting specific special characters from a table

    Hi all,
    This is my table
    Table Name- Table1
    S.no    Name
    1          aaaaaaaa
    2          a1234sgjghb
    3          a@3$%jkhkjn
    4          abcd-dfghjik
    5          bbvxzckvbzxcv&^%#
    6          ashgweqfg/gfjwgefj////
    7          sdsaf$([]:'
    8          <-fdsjgbdfsg
    9           dfgfdgfd"uodf
    10         aaaa  bbbbz#$
    11         cccc dddd-/mnm
    The output has to be
    S.no    Name
    3          a@3$%jkhkjn
    5          bbvxzckvbzxcv&^%#
    7          sdsaf$([]:'
    8          <-fdsjgbdfsg
    10         aaaa  bbbbz#$
    It has to return "Name" column which is having special characters,whereas some special chars like -, / ," and space are acceptable.
    The Oracle query has to print columns having special characters excluding -,/," and space
    Can anyone help me to get a SQL query for the above.
    Thanks in advance.

    You can achieve it in multiple ways. Here are few.
    SQL> with t
      2  as
      3  (
      4  select 1 id, 'aaaaaaaa' name from dual union all
      5  select 2 id, 'a1234sgjghb' name from dual union all
      6  select 3 id, 'a@3$%jkhkjn' name from dual union all
      7  select 4 id, 'abcd-dfghjik' name from dual union all
      8  select 5 id, 'bbvxzckvbzxcv&^%#' name from dual union all
      9  select 6 id, 'ashgweqfg/gfjwgefj////' name from dual union all
    10  select 7 id, 'sdsaf$([]:''' name from dual union all
    11  select 8 id, '<-fdsjgbdfsg' name from dual union all
    12  select 9 id, 'dfgfdgfd"uodf' name from dual union all
    13  select 10 id, 'aaaa  bbbbz#$' name from dual union all
    14  select 11 id, 'cccc dddd-/mnm' name from dual
    15  )
    16  select *
    17    from t
    18   where regexp_like(translate(name,'a-/" ','a'), '[^[:alnum:]]');
            ID NAME
             3 a@3$%jkhkjn
             5 bbvxzckvbzxcv&^%#
             7 sdsaf$([]:'
             8 <-fdsjgbdfsg
            10 aaaa  bbbbz#$
    SQL> with t
      2  as
      3  (
      4  select 1 id, 'aaaaaaaa' name from dual union all
      5  select 2 id, 'a1234sgjghb' name from dual union all
      6  select 3 id, 'a@3$%jkhkjn' name from dual union all
      7  select 4 id, 'abcd-dfghjik' name from dual union all
      8  select 5 id, 'bbvxzckvbzxcv&^%#' name from dual union all
      9  select 6 id, 'ashgweqfg/gfjwgefj////' name from dual union all
    10  select 7 id, 'sdsaf$([]:''' name from dual union all
    11  select 8 id, '<-fdsjgbdfsg' name from dual union all
    12  select 9 id, 'dfgfdgfd"uodf' name from dual union all
    13  select 10 id, 'aaaa  bbbbz#$' name from dual union all
    14  select 11 id, 'cccc dddd-/mnm' name from dual
    15  )
    16  select *
    17    from t
    18   where translate
    19         (
    20            lower(translate(name,'a-/" ','a'))
    21          , '.0123456789abcdefghijklmnopqrstuvwxyz'
    22          , '.'
    23         ) is not null;
            ID NAME
             3 a@3$%jkhkjn
             5 bbvxzckvbzxcv&^%#
             7 sdsaf$([]:'
             8 <-fdsjgbdfsg
            10 aaaa  bbbbz#$
    SQL>

  • Number of rows in a GTT for a specific session

    Hello
    Is it possible to see how many rows are in a global temporary table, with on commit preserve rows set, at any given time for a particular session? I have the feeling that the answer will be a resounding NO! based on what I know of MVCC etc etc but I'm holding out hope that there is some magical view somewhere that will give an indication - even if it is just to see the blocks being used by/assigned to a particular session/transaction for that table.
    The situation is that I have a long running process to debug and there is currently insufficient instrumentation in the code so I can't inspect v$session to find out what it is doing or any log tables. I can see from the wait events that it is reading from a GTT but ideally I'd like to know how many more blocks it has to read as I don't really want to kill it and start again - especially if it's only got a relatively small amount of processing to do.
    It's a long shot, but any ideas are appreciated.
    David

    I've used
    select * from v_$session_longs_ops where sofar <> totalworkto see how much data it's sorting and what not on global temporary tables. This only helps if it's doing a lot of work on that table and logging it in longops, but you might want to check and see if anything is there.

  • Enabling SQL Tracing for already connected session

    Hi,
    I've a requirement. i.e. my users are connected to db through schema making sessions( As multiple users are connected from single Schema). Now there are certian users which have to run batch jobs and I want to trace there SQL for tunning. I want to know how can I enable SQL tracing for specific user,session,id since it is difficult to trace exact user as multiple users are running the batch jobs.
    I have a strategy to enable tracing at schema level. Can I do this while users are connected and running quries. As normally first we enable the tracing and then run the quries.
    Kindly help me in working out this.
    Regards,
    Abbasi

    You didn't post your Oracle version, but maybe you have DBMS_MONITOR available to you.
    Hope this helps!

  • How can I perform data logging for a specific time??

    hello everyone,
    I am quite new in labview and I have a basic question regarding data logging. Currently I am using a cRIO9074 and doing some data logging for my test. The data logging it self works ok so far.
    But my problem is I would like to write my datas in a text file either for a specific time interval (ex)10 seconds) or for a specific amounts of data (ex)500 Samples). Can anyone give me some help regarding my problem?? Attached you can find my RT.vi 
    I would appreciate for anyhelp!
    Regards
    Yun 
    Attachments:
    BP250 Encoder Position & Velocity (Host).vi ‏92 KB

    Run your loggging program for that time. When your program terminates then it will write all the logged data so far in text file.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • Log for changes in the SAP table

    Hello All,
    I have a SAP table in which we want to log all the changes being made by the number of users like modifying some record or adding a new record.
    Now What I have done is in the SE11 under technical settings I have checked the checkbox which is "Log data changes", Needless to say I have the developer access key to the system.
    Now I want to test whether changes being made by me in the SAP table are logged somewhere or not I want to know where can we see the changes being logged made by me.
    Is there a tcode to see the changes being made in the table or a SAP table exists for this.
    Thanks,
    Mark

    Hi,
    BAL_OBJECT_SELECT --> To get the LOG for a object
    You can use below Tables/Structures
    DDPRT -->  Structure of ABAP/4 Dictionary logs
    DDPRTXT
    Regards
    Sudheer

  • How to write sql query for counting pairs from below table??

    Below is my SQL table structure.
    user_id | Name | join_side | left_leg | right_leg | Parent_id
    100001 Tinku Left 100002 100003 0
    100002 Harish Left 100004 100005 100001
    100003 Gorav Right 100006 100007 100001
    100004 Prince Left 100008 NULL 100002
    100005 Ajay Right NULL NULL 100002
    100006 Simran Left NULL NULL 100003
    100007 Raman Right NULL NULL 100003
    100008 Vijay Left NULL NULL 100004
    It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
    I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains  both left_leg and right_leg id, then it is called pair.)
    I know there are three pairs under id "100001" :-
    1.  100002 and 100003
    2.  100004 and 100005
    3.  100006 and 100007
        100008 will not be counted as pair because it does not have right leg..
     But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
    Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005

    Sounds like this to me
    DECLARE @ID int
    SET @ID = 100001--your passed value
    SELECT left_leg,right_leg
    FROM table
    WHERE (user_id = @ID
    OR parent_id = @ID)
    AND left_leg IS NOT NULL
    AND right_leg IS NOT NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Sharepoint full farm backup generates sql logs for search application differential backups

    We are running full farm backups for sharepoint. Backup completes normally but SQL logs are generated for differential backups for search service application.
    it says something like:
    Database differential changes were backed up: database: search_serv.......
    Thanks,
    Basit

    This can happen for a few reasons, such as is disk contention or network issues. Are you backing up to a shared directory on the SQL Server? If not, try that.
    Trevor Seward
    Follow or contact me at...
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Logging for a specific ACL line

    Hello, I'm currently evaluating rules on ASA.
    There are some rules applied, but some of the traffic does not match those rules. I created a rule allowing everything and I need to see what traffic is hitting this especific rule on line 3.
    Example:
    access-list OUTSIDE_IN line 1 extended permit tcp 10.1.16.0 255.255.255.0 10.153.224.0 255.255.240.0 eq 88
    access-list OUTSIDE_IN line 2 extended permit udp 10.1.16.0 255.255.255.0 10.153.224.0 255.255.240.0 eq domain
    access-list OUTSIDE_IN line 3 extended permit ip 10.1.16.0 255.255.255.0 10.153.224.0 255.255.240.0 log informational
    When I enable log, I see all the traffic, not the only one I wanted. There's a way to see only traffic coming on line 3?
    Regards

    Hi Marcos,
    You see all traffic because for lines for which no "log" keyword at ACL line end is added, it will still be logged, see:
    http://www.cisco.com/c/en/us/td/docs/security/asa/asa81/command/ref/refgd/a1.html#wp1564948
    ... If you enter the log keyword without any arguments, you enable system log message 106100 at the default level (6) and for the default interval (300 seconds). If you do not enter the log keyword, then the default system log message 106023 is generated...
    So what you can do is instead of "log informatioanl", put "log warnings" to log this ACL line 3 at syslog level 4 (warnings), and in addition to that decrease logging level that is visible for the method how you monitor logs, for example some of following lines (depending whether you monitor logs at syslog server, terminal, or from local buffer (show logg command):
    hostname(config)# logging trap warnings
    hostname(config)# logging enable
    hostname(config)# logging monitor warnings
    hostname(config)# terminal monitor
    hostname(config)# logging buffered warnings
    Also, before any significant changes to ASA configuration, migrations, software upgrades, etc., I always recommend testing the configuration with fw123test:
    http://www.networksea.com/fw123test/
    BR,
    Milan

  • How To Restric all kind of access to 2 specific tables in SQL Server for all Users.Instead of table we would like users to go through View.

    Hi All,
    I am looking at an Technical solution for Restricting the direct access some specific tables in my data base  to all the users(Except admins and few Service accounts). However views created on top of these tables would be exposed to all Users.
    Could any one help me with the best solution.
    Thanks in advance,
    Regards,
    Raja Suri

    Hello,
    You can try to create a new role "Client_User" in the database and deny access to the new role on the specify tables. And then add all user which you want to restricting the direct access the specific tables to the database role.
    For example:
    Use Database
    CREATE ROLE [Client_User] AUTHORIZATION db_securityadmin;
    DENY SELECT ON OBJECT::schema.table TO [Client_User] ;
    EXEC sp_addrolemember 'Client_User', 'username';
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How can I search the filter log for a specific string?

    I have messages appearing in a sub folder named "2014". The main folder is called "Archives" . I do not know how they ended up there. I read through all my filters, but see nothing that sends messages to that folder. I scroll through the filter log and do not see the message subjects that end up in that folder.
    Is there a way to use something like <edit><find> to look for a string?

    A selected message will be moved to the Archives folder if you press the "A" key. Some people find this annoying, but it's possible to disable this, and other, keystrokes. http://gsfn.us/t/40hkd

  • Change logs for Z table.

    Hi All,
    I am trying  to fetch the old value and new value for the z table field.Change log is activated for the Z table. but i dont know how to fetch the change logs.
    SCU3 is the standard transaction to see the change logs for all the tables.
    Is there any table where the change logs values are maintained?
    Does anyone know how to get the change log value?
    Thanks in advance.
    Regards,
    Amruta.

    Hello,
    If for a specific set of tables no change documents are triggered by SAP you can always setup your own Change Document Object with transaction SCDO.
    Of course you need to be careful with this transactions (how big is the table data, how many changes, etc...).
    Table logging is something else, they are stored in table DBTABLOG and can be analysed via SCU3.
    For table logging you need extra system parameters to be set, they are explained in SAP Note:
    Note 1916 - Logging table changes in R/3
    Pay attention with table logging because a lot of tables are logged in DBTABLOG once you activate the parameter, this can have a major impact on performance.
    To have an idea what other tables will be logged, check tcode SE16 on table DD09L and put an 'X' in field PROTOKOLL, result will be thousands of tables.
    In your specific scenario I think it is best you go for the change documents with SCDO.
    Wim Van den Wyngaert

  • Enable SQL Tracing for Session

    Hi,
    I know how to enable SQL tracing for a session created either through SQL*Plus or like similar tool, but I want to explore is there any way to can we enable sql tracing for a single session which is connected to database through an application.
    ssome time for testing purpose we have a requirement to enable tracing for that user which run batch Job. Now that particular user gets connected to database through application and i want to enable tracing right at that moment. How can I accomplish it.
    Regards,
    Ababsi

    If you don't want to identify database session you can try to create a logon trigger to enable tracing for all database sessions created by a specific Oracle user account. In the following example you need to replace UWCLASS with the Oracle user account for which you want to trace sessions:
    CREATE OR REPLACE TRIGGER trace_trig
    AFTER LOGON
    ON DATABASE
    DECLARE
    sqlstr VARCHAR2(200) := 'ALTER SESSION SET EVENTS ''10046 TRACE NAME CONTEXT FOREVER, LEVEL 12''';
    BEGIN
      IF (USER = 'UWCLASS') THEN
        execute immediate sqlstr;
      END IF;
    END trace_trig;
    /Reference:
    http://psoug.org/reference/system_trigger.html
    If you want to identify database session you need to query V$SESSION to retrieve SID and SERIAL# of the session you want to trace and then you can use DBMS_MONITOR. See examples in http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php
    Edited by: P. Forstmann on 15 janv. 2011 11:07

Maybe you are looking for