Implement fine-grained auditing and Virtual Private Database (VPD)


Using Secure Session-Based Application Context
SQL> connect sys@anardb as sysdba
Create user scott .
SQL> GRANT CREATE SESSION TO scott IDENTIFIED BY tiger;
SQL> ALTER USER scott DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE temp;
SQL> GRANT CONNECT, RESOURCE TO scott;
Test SYS_CONTEXT
SQL> SET serveroutput ON
SQL> SET serveroutput ON
SQL> BEGIN
DBMS_OUTPUT.put_line (SYS_CONTEXT (‘userenv’,’current_user’));
END;
/
SCOTT
PL/SQL PROCEDURE successfully completed.
SQL> BEGIN
DBMS_OUTPUT.put_line(SYS_CONTEXT(‘userenv’,’session_user’));
END;
/
SCOTT
PL/SQL PROCEDURE successfully completed
SQL> EXEC DBMS_OUTPUT.put_line(SYS_CONTEXT(‘userenv’,’session_user’));
SCOTT
PL/SQL PROCEDURE successfully completed.
SQL> SELECT SYS_CONTEXT(‘userenv’,’ip_address’) FROM DUAL;
Grant Privileges for Secure Session-Based Application Context
SQL> CONNECT SYS@anardb AS SYSDBA
SQL> GRANT CREATE ANY CONTEXT TO scott;
SQL> GRANT ADMINISTER DATABASE TRIGGER TO scott;
SQL> GRANT SELECT_CATALOG_ROLE TO scott
SQL> GRANT SELECT ON hr.employees TO scott;
SQL> GRANT SELECT ON oe.orders TO scott;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: