Altering Transparent Sensitive Data Protection Policies
The DBMS_TSDP_PROTECT.ALTER_POLICY procedure can alter a TSDP policy.
When you alter a transparent data protection policy, you must define how the Data Redaction settings must change, and then apply these changes to the transparent sensitive data protection policy itself.
You can find a list of existing policies and their protection definitions by querying the DBA_TSDP_POLICY_FEATURE data dictionary view.
- To alter a transparent sensitive data protection policy, use the
DBMS_TSDP_PROTECT.ALTER_POLICYprocedure.
For example, to alter an existing transparent sensitive data protection policy:
DECLARE
redact_feature_options SYS.DBMS_TSDP_PROTECT.FEATURE_OPTIONS;
policy_conditions SYS.DBMS_TSDP_PROTECT.POLICY_CONDITIONS;
BEGIN
redact_feature_options ('expression') :=
'SYS_CONTEXT(''USERENV'',''SESSION_ USER'') =''APPUSER''';
redact_feature_options ('function_type') := 'DBMS_REDACT.PARTIAL';
redact_feature_options ('function_parameters') := '9,1,6';
policy_conditions(DBMS_TSDP_PROTECT.DATATYPE) := 'NUMBER';
policy_conditions(DBMS_TSDP_PROTECT.LENGTH) := '22';
DBMS_TSDP_PROTECT.ALTER_POLICY ('redact_partial_cc',
redact_feature_options, policy_conditions);
END;
/
In this example:
-
redact_feature_options SYS.DBMS_TSDP_PROTECT.FEATURE_OPTIONScreates the variableredact_feature_options, which uses theFEATURE_OPTIONSdata type. -
policy_conditions SYS.DBMS_TSDP_PROTECT.POLICY_CONDITIONScreates the variablepolicy_conditions, which uses thePOLICY_CONDITIONSdata type. -
redact_feature_options ... redact_feature_optionswrites the Data Redaction policy settings to theredact_feature_optionvariable. This example applies the Data Redaction policy to the userAPPUSER, defines the policy as a partial data redaction for number data types. See Oracle Database Advanced Security Guide for information about how thefunction_parametersparameter works for this case. -
policy_conditions ... policy_conditionswrites the TSDP policy conditions to thepolicy_conditionsvariable (that is, the data type and length) for the protectedNUMBERdata type column. -
DBMS_TSDP_PROTECT.ALTER_POLICY ...executes theDBMS_TSDP_PROTECT.ALTER_POLICYprocedure, which alters theredact_partial_ccTSDP policy to use the definitions set in theredact_feature_optionsandpolicy_conditionsvariables.