Tuesday 11 April 2017

Step by Step Create read only user in oracle

Step1:

[oravis@qb ~]$ sqlplus / as sysdba



SQL> Create user db_admin identified by db_admin
         default tablespace APPS_TS_TX_DATA
         temporary tablespace temp
         quota 0M on APPS_TS_TX_DATA;

         User created.

Step2:


SQL>  Create role r_role;
          Grant create session to r_role;
          Grant connect to r_role;
          Grant select any table to r_role;
          Grant execute any procedure to r_role;
          Grant create trigger to r_role;
          Role created.

Step3:


SQL> Grant r_role to qlik;

         Grant succeeded.

Step4:


SQL> conn db_admin/db_admin;
          Connected.

Step5:


SQL>  Create trigger rlogin_trigger
           After logon on db_admin.schema
           Begin
           Execute immediate 'Alter session set current_schema = apps';
           End;  

           Trigger created.

Step6:


SQL>  Revoke create trigger from r_role;

           Revoke succeeded.

  
  

         



No comments: