Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: logon trigger for special user

Re: logon trigger for special user

From: Sybrand Bakker <sybrandb_at_hccnet.nl>
Date: Wed, 03 Nov 2004 20:39:31 +0100
Message-ID: <8ucio0tn875m900urgubrha2rjpermi590@4ax.com>


On 3 Nov 2004 05:06:55 -0800, Kitty.Stockfisch_at_web.de (Kitty) wrote:

>I have to create a trigger which fires every time special users are
>connecting into database. When one of these users is connected, the
>trigger has to insert session_ID, date and table_name (name of the
>table, this special user is logged on) in a table named Log_on_table.
>My problem is that I don't know how to get the session_id and the
>table_name.
>
>CREATE OR REPLACE Trigger Log_on_Trigger
>AFTER LOGON Database
>Begin
> If (sys.login_user in (‘user1', ‘user2') then
> INSERT INTO Log_on_table (??session_ID??, sysdate,
>??table_name??)
> End If
>End
>
>I have not tested this code jet, so I don't know if it works
>correctly.
>
>Thanks for helping me!!!!

1 user don't log on to a table
2 look up the sys_context('userenv','sessionid') in your manual

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Nov 03 2004 - 13:39:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US