Creating a redaction policy when using partial redaction
In this recipe, you will implement partial redaction on columns of two different types: Number
and Varchar2
. Partial redaction means that only part (hence the name partial) of the data in a specified column will be masked (redacted), whereas the other part of the data will be visible to the user - for instance, the first 12 digits of credit card number will be redacted, whereas other 4 digits will be visible.
How to do it...
- Log in to database as a user who has a DBA role (for instance,Â
zoran
):$ sqlplus zoran/oracle
- Create a test table and insert some data in it:
SQL> create table tbl (a number); SQL> insert into tbl values (123456); SQL> insert into tbl values (234567); SQL> insert into tbl values (345678); SQL> commit;
- Create role (that is going to be used in redaction policy) and userÂ
usr1
as the first test user:SQL> create role myrole; SQL> create user usr1 identified by oracle1; SQL>...