Redacting Multiple Columns
You can redact more than one column in a Data Redaction policy.
-
Adding Columns to a Data Redaction Policy for a Single Table or View
You can redact columns of different data types, using different redaction types and named policy expressions, for one table or view.
-
Example: Redacting Multiple Columns
The
DBMS_REDACT.ALTER_POLICYprocedure can redact multiple columns.
Adding Columns to a Data Redaction Policy for a Single Table or View
You can redact columns of different data types, using different redaction types and named policy expressions, for one table or view.
-
Connect to the PDB as a user who has the
EXECUTEprivilege on theDBMS_REDACTPL/SQL package and theADMINISTER REDACTION POLICYsystem or schema privilege. -
Create the policy for the first column that you want to redact by using
DBMS_REDACT.ADD_POLICY. -
Use the
DBMS_REDACT.ALTER_POLICYprocedure to add the next column to the policy.As necessary, set the
action,column_name,function_type, andfunction_parameters(or the parameters that begin withregexp_) parameters to define the redaction for the new column, but do not change theobject_schema,object_name,policy_name, orexpressionparameters. These parameters remain unchanged for newly redacted columns. -
Create named policy expressions and apply them to the redacted column.
If a named policy expression is not applied to the column, the default policy expression from
DBMS_REDACT.ADD_POLICYwill apply.
Related Topics
Example: Redacting Multiple Columns
The DBMS_REDACT.ALTER_POLICY procedure can redact multiple columns.
Redacting Multiple Columns
shows how to add a column to an existing Data Redaction policy. In this example, the action parameter specifies that a new column must be added, using DBMS_REDACT.ADD_COLUMN. The name of the new column, card_num, is set by the column_name parameter.
BEGIN
DBMS_REDACT.ALTER_POLICY(
object_schema => 'mavis',
object_name => 'cust_info',
policy_name => 'redact_cust_user_ids',
action => DBMS_REDACT.ADD_COLUMN,
column_name => 'card_num',
function_type => DBMS_REDACT.FULL);
END;
/