Disabling and Enabling an Oracle Data Redaction Policy
You can disable and then reenable Oracle Data Redactions policies as necessary.
-
Disabling an Oracle Data Redaction Policy
The
DBMS_REDACT.DISABLE_POLICYprocedure disables Oracle Data Redaction policies. -
Enabling an Oracle Data Redaction Policy
The
DBMS_REDACT.ENABLE_POLICYprocedure enables Oracle Data Redaction policies.
Disabling an Oracle Data Redaction Policy
The DBMS_REDACT.DISABLE_POLICY procedure disables Oracle Data Redaction policies.
You can find the names of existing Data Redaction policies and whether they are enabled by querying the POLICY_NAME and ENABLE columns of the REDACTION_POLICIES view. However, as long as the policy still exists, you cannot create another policy for that table or view, even if the original policy is disabled. In other words, if you want to create a different policy on the same column in the same table, then you must drop the first policy before you can create and use the new policy.
-
Connect to the PDB as a user who has the
EXECUTEprivilege on theDBMS_REDACTPL/SQL package and theADMINISTER REDACTION POLICYsystem or schema privilege. -
Run the
DBMS_REDACT.DISABLE_POLICYprocedure, using the following syntax:DBMS_REDACT.DISABLE_POLICY ( object_schema IN VARCHAR2 DEFAULT NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2);In this specification:
-
object_schema: Specifies the schema of the object on which the Data Redaction policy will be disabled. If you omit this setting (or enterNULL), then Oracle Database uses the name of the current schema. -
object_name: Specifies the name of the table or view to be used for the Data Redaction policy. -
policy_name: Specifies the name of the policy to be disabled.
For example:
BEGIN DBMS_REDACT.DISABLE_POLICY ( object_schema => 'mavis', object_name => 'cust_info', policy_name => 'redact_cust_user_ids'); END; / -
Enabling an Oracle Data Redaction Policy
The DBMS_REDACT.ENABLE_POLICY procedure enables Oracle Data Redaction policies.
Immediately after you create a new policy, you do not need to enable it; the creation process handles that for you. To find the names of existing Data Redaction policies and whether they are enabled, you can query the POLICY_NAME and ENABLE columns of the REDACTION_POLICIES view. After you run the procedure to enable the policy, the enablement takes effect immediately.
-
Connect to the PDB as a user who has the
EXECUTEprivilege on theDBMS_REDACTPL/SQL package and theADMINISTER REDACTION POLICYsystem or schema privilege. -
Run the
DBMS_REDACT.ENABLE_POLICYprocedure, using the following syntax.DBMS_REDACT.ENABLE_POLICY ( object_schema IN VARCHAR2 DEFAULT NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2);In this specification:
-
object_schema: Specifies the schema of the object on which the Data Redaction policy will be enabled. If you omit this setting (or enterNULL), then Oracle Database uses the name of the current schema. -
object_name: Specifies the name of the table or view to be used for the Data Redaction policy. -
policy_name: Specifies the name of the policy to be enabled.
For example:
BEGIN DBMS_REDACT.ENABLE_POLICY ( object_schema => 'mavis', object_name => 'cust_info', policy_name => 'redact_cust_user_ids'); END; / -