User access to another schema in Oracle: Alternative to public synonyms

26 03 2009

Consider that there are 2 users in your database having their own schemas, but second user having less permission is required to work on the first schema. Possible solutions :

1 . To  create public/private synonyms

2. Use schema name in the queries.

3. Modify user session to point the first schema. Create a trigger on login.

CREATE OR REPLACE TRIGGER &app_user..APP_USER_LOGON AFTER LOGON ON &app_user..SCHEMA DECLARE

BEGIN

            EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = '|| UPPER('&owner_user');

   EXCEPTION

     WHEN OTHERS THEN raise_application_error(-20001, 'Error: ' || SQLERRM );

END ;







Follow

Get every new post delivered to your Inbox.