Home » RDBMS Server » Server Administration » trigger logon on database (10.2.0.4.0 solaris 10)
trigger logon on database [message #438648] Mon, 11 January 2010 07:00 Go to next message
knight
Messages: 111
Registered: January 2009
Senior Member
user 'app_read' has read only privileges to all tables of user 'applic'

user app_read accesses tables as applic.table_name

I have created foll trigger to avoid prefixing scehma name



create or replace trigger logon_trig
after logon on database

begin
    if user in ('APP_READ') then
        execute immediate 'alter session set current_schema=APPLIC';
    end if;
end;



this is working fine,,,,
i want to know if creating logon triggers has any disadvantages.

or is there any better way to do it.
Re: trigger logon on database [message #438649 is a reply to message #438648] Mon, 11 January 2010 07:03 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is the way to do it but if it is just for app_read change "after logon on database" to "after logon on app_read.schema" then you don't have to test the schema and the trigger is only executed for app_read.

Regards
Michel
Re: trigger logon on database [message #438651 is a reply to message #438648] Mon, 11 January 2010 07:15 Go to previous message
knight
Messages: 111
Registered: January 2009
Senior Member
makes sense,,,,
thanx a lot michel,,,,
Previous Topic: Database server slow
Next Topic: Connection log for bequeath connection
Goto Forum:
  


Current Time: Wed Sep 28 00:36:39 CDT 2016

Total time taken to generate the page: 0.10071 seconds