Using v$session
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Using v$session

Hybrid View

  1. #1
    Join Date
    Mar 2001
    Posts
    82
    Hi,

    I would like to track user logons to a system we have in place. Can I use v$session in a procedure in order to populate a table which will store user logon times?

    If so, do I need to have DBA privileges, and are there other restrictions?

    Thanks

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You should look at a the LOGON trigger. ( [url]http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/statem6d.htm#2064212[/url] )

    This trigger will fire every time somebody logs into the database. You can capture their information from there. There is also a logoff trigger where you can capture information.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Jeff suggestion is totaly valid. Hovewer if it is only users logon times you are interesting in then you should consider turning auditing on.

    Just set AUDIT_TRAIL=DB in your init.ora, bounce the database and you are all set. If you don't specify anything particular to audit, the database will by default log all user logons/logoffs.

    This option definitely brings less overhead then any other solution.

    HTH,
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    I've forgot to mention in my previous post:

    Do not try to find the solution to your problem in direction: "puting trigger on V$SESSIN or something similar...". You can't create trigger on any object owned by SYS, no way....
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

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



Click Here to Expand Forum to Full Width