If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Access v$session in a trigger failed

Hi, everyone

I tried to crearte a trigger to monitor user log on event. In this trigger body I have a 'select ... from v$session' statement. When I create this trigger under system schema, I got a warning: Triggger created with compilation errors. With 'show errros', I saw 'table or view doesn't exist'. when replacing v$session with dual, the trigger can be created without problem. Creating the trigger under sys, there is no errors.

So there must be somthing I'm missing about accessing v$session like views in the trigger body.

The problem is that you have access to v$session through a role and therefore cannot create any objects such as triggers, views or procedures which access it. Try logging on as SYS and giving a direct grant select to the user.