Read-Only User Accounts
LeasePak Documentation Suite NETSOL website
Oracle 19c Server

Oracle 19c Server

Read-Only User Accounts

Previous  

A read-only user account is a database account that can select from and query LeasePak tables, but cannot run Data Manipulation Language commands (insert, update, delete) or Data Definition Language commands (create, alter, drop) on the tables. In other words, a read-only user account has read access to LeasePak tables, but does not have write access.

Information note:   LeasePak software does not require the existence of a read-only user account. After creating a LeasePak database, you may wish to create one or more read-only user accounts for performing ad hoc querying on the database outside of the LeasePak software.

Creating a Read-Only User Account

To create a read-only user account for a LeasePak database:
  1. Log on the DBMS host as the Oracle software owner.
  2. Enter at the Unix prompt:
    % sqlplus / as sysdba
  3. Change the current container to the PDB by entering at the sqlplus prompt:
    SQL> alter session set container = PDB_name;
  4. Ensure the current container is the PDB:
    SQL> show con_name
  5. Create the read-only user account:
    SQL> create user user_name identified by "password";
  6. Grant create session to the user:
    SQL> grant create session to user_name;
  7. Grant the LeasePak database's read-only role to the user:
    SQL> grant msir_LPdatabase_name to user_name;
  8. Make the read-only role a default role for the user:
    SQL> alter user user_name default role msir_LPdatabase_name;
  9. Create a logon trigger for the user which will set the current schema for the session to the LeasePak database:
    SQL> create or replace trigger user_name._logon after logon on user_name..schema
    begin
        execute immediate 'alter session set current_schema = LPdatabase_name';
    end;
    /