D DBMS_REDACT
The DBMS_REDACT
package provides an interface to Oracle Data Redaction, which enables you to redact data that is returned from queries issued by low-privileged users or an application.
This chapter contains the following topics:
See Also:
-
Oracle Database Data Redaction Guide regarding using Data Redaction to protect sensitive data
D.1 DBMS_REDACT Overview
Data redaction provides a way to define redaction policies for an
application. Oracle Data Redaction provides functionality to redact data that is returned
from user SELECT
queries in an application. The redaction takes place in
real time.
SYS_CONTEXT
or XS_SYS_CONTEXT
values. This
redaction process does not require that the queried data be static or unchanging, or for
the entire data set to be redacted at one time in an off-line manner. Oracle Database
redacts the data only for the rows specified by the user's query, not the data for the
entire column. The redaction takes place immediately before the data is returned to the
querying user or application.
D.2 DBMS_REDACT Security Model
If the querying user has the EXEMPT REDACTION POLICY
privilege, redaction will not be performed. If the user does not have the EXEMPT
REDACTION POLICY
privilege, the policy expression will be evaluated in the
current user's environment. If the policy expression evaluates to TRUE
,
then redaction will be performed, otherwise no redaction will be performed.
You must have the EXECUTE
privilege on the DBMS_REDACT
package, as well as the ADMINISTER REDACTION POLICY
system or schema privilege, to execute its subprograms. Procedures in the interface are executed with privileges of the current user.
D.3 DBMS_REDACT Constants
The DBMS_REDACT
package defines several constants for specifying parameter values.
Table D-1 Values for function_type Parameter of DBMS_REDACT.ADD_POLICY
Constant | Value | Type | Description |
---|---|---|---|
|
|
|
Redact to fixed values |
|
2 |
|
Partial redaction, redact a portion of the column data |
|
4 |
|
Random redaction, each query results in a different random value |
|
|
|
Regular expression based redaction |
|
|
|
Regular expression based redaction that preserves the
width of a column that uses a regular expression; designed for
applications that use the |
|
|
|
Returns a null value as a redacted value |
|
|
|
No redaction |
Table D-2 Values for action Parameter of DBMS_REDACT.ALTER_POLICY
Constant | Value | Type | Description |
---|---|---|---|
|
|
|
Add a column to the redaction policy |
|
|
|
Drop a column from the redaction policy |
|
|
|
Modify the expression of a redaction policy (the expression evaluates to a |
|
|
|
Modify a column in the redaction policy to change the redaction |
|
|
|
Set a description for the redaction policy |
|
|
|
Set a description for the redaction performed on the column |
D.4 DBMS_REDACT Operating Procedures
The following table presents the relationship between the type of redaction function and its parameters, based on the datatype of the column being redacted. Examples of the various format strings are provided, showing how to perform some commonplace redaction for a string datatype (in this case, a Social Security Number (SSN)), a DATE
datatype, and various examples of redaction for the number datatype.
Table D-3 Data Redaction Function Types
function_type | function_parameters | Examples |
---|---|---|
|
- |
- |
|
- |
- |
DBMS_REDACT.NULLIFY |
- |
- |
|
A comma-separated list, containing the following five fields (with no spaces after the commas delimiting the fields):
See Table D-4. |
|
|
|
The |
|
|
The |
|
|
The value |
|
|
The value |
|
|
The value |
|
The |
- |
|
A comma-separated list, containing the following three fields (with no spaces after the commas delimiting the fields):
See Table D-4. |
|
|
|
- |
|
A list, containing the following five fields (concatenated so that there is no space between the fields):
See Table D-4. |
|
|
|
- |
|
- |
- |
|
- |
- |
|
- |
- |
Table D-4 Format Descriptors with Component Field Names and Delimiters
Datatype | Format Descriptor for Partial redaction |
---|---|
Character |
|
Number |
|
Datetime |
|
D.5 Summary of DBMS_REDACT Subprograms
This table lists and briefly describes the DBMS_REDACT
package subprograms.
Table D-5 DBMS_REDACT Package Subprograms
Subprogram | Description |
---|---|
Defines a Data Redaction policy for a table or view |
|
Alters a Data Redaction policy for a table or view |
|
Applies a Data Redaction named policy expression to a redacted column |
|
Creates a Data Redaction named policy expression |
|
Disables a Data Redaction policy |
|
Drops a Data Redaction policy |
|
Drops a Data Redaction named policy expression |
|
Enables a Data Redaction policy |
|
Modifies the default displayed values for a Data Redaction policy for full redaction |
|
Updates a Data Redaction named policy expression |
D.5.1 ADD_POLICY Procedure
This procedure defines a Data Redaction policy for a table or view.
Syntax
DBMS_REDACT.ADD_POLICY ( object_schema IN VARCHAR2 := NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2, column_name IN VARCHAR2 := NULL, function_type IN BINARY_INTEGER := DBMS_REDACT.FULL, function_parameters IN VARCHAR2 := NULL, expression IN VARCHAR2, enable IN BOOLEAN := TRUE, regexp_pattern IN VARCHAR2 := NULL, regexp_replace_string IN VARCHAR2 := NULL, regexp_position IN BINARY_INTEGER := 1, regexp_occurrence IN BINARY_INTEGER := 0, regexp_match_parameter IN VARCHAR2 := NULL, policy_description IN VARCHAR2 := NULL, column_description IN VARCHAR2 := NULL);
Parameters
Table D-6 ADD_POLICY Procedure Parameters
Parameter | Description |
---|---|
|
Schema owning the table or view, current user if |
|
Name of table or view on which to add a Data Redaction policy |
|
Name of policy |
|
[Optional] Name of one column to which the redaction policy applies. If you must redact more than one column, use the ALTER_POLICY Procedure to add the additional columns. |
|
Type of redaction function to use. Possible values are: - - - - - - - See Table D-1 for an overview of the meanings of these values, and for some examples of their use. |
|
Parameters to the redaction function. The possible values depend on
the value of the Use If the - - - - - Redacting parameters for partial character redacting. For character datatypes, a comma-separated list containing these fields:
For number datatypes, a comma-separated list containing these fields:
For datetime datatypes, the format is a packed string (no spaces or commas) containing the following sequence of fields. Please note that each field can consist of one or more characters, and the field length depends on whether redacting is required. The one-character fields are used to specify that no redaction of that component of the datetime value is to take place. The longer fields indicate a specific time or date to use as the redacted value of that component of the datetime value.
An example is For partial character and number-redacting shortcuts, see Oracle Database Data Redaction Guide. |
|
Default boolean expression for the table or view. If this expression is used, then redaction takes place only if this policy expression evaluates to The following functions are supported:
See Oracle Database Data Redaction Guide for more information about these supported functions |
|
Boolean value that determines whether the Data Redaction policy is enabled on creation. The default value is |
|
Regular expression pattern up to 512 bytes. Use only if the See Oracle Database SQL Language Reference for more information and examples on using regular expression patterns. |
|
Replacement string (up to 4000 characters in length) with up to 500 back-references to subexpressions in the form Use only if the |
|
Integer counting from 1, specifies the position where the search must begin. The default is 1. Use only if the |
|
Use only if the |
|
Changes the default matching behavior, possible values are a combination of 'i', 'c', 'n', 'm', 'x' Use only if the See Oracle Database SQL Language Reference for more information and examples on using regular expression match parameters. |
|
Description of redaction policy |
|
Description of the column being redacted |
Exceptions
-
ORA-28060
- A Data Redaction policy already exists on this column. -
ORA-28061
- This object cannot have a Data Redaction policy defined on it. -
ORA-28062
- The policy expression is too long. -
ORA-28063
- The policy expression is empty. -
ORA-28064
- The redaction function is not valid. -
ORA-28066
- Invalid columncolumn
. -
ORA-28067
- Missing or invalid column name. -
ORA-28069
- A Data Redaction policy already exists on this object. -
ORA-28073
- The columncolumn_name
has an unsupported datatype or attribute. -
ORA-28074
- Thefield_name
field of the redaction parameters is not valid.The field can be any of the following:
-
REDACT_PARTIAL_INPUT_FORMAT
-
REDACT_PARTIAL_OUTPUT_FORMAT
-
REDACT_PARTIAL_MASKCHAR
-
REDACT_PARTIAL_MASKFROM
-
REDACT_PARTIAL_MASKTO
-
REDACT_PARTIAL_DATE_MONTH
-
REDACT_PARTIAL_DATE_DAY
-
REDACT_PARTIAL_DATE_YEAR
-
REDACT_PARTIAL_DATE_HOUR
-
REDACT_PARTIAL_DATE_MINUTE
-
REDACT_PARTIAL_DATE_SECOND
See Table D-3 and Table D-4 for examples of the field contents and field ordering.
-
-
ORA-28075
- The data redaction policy expression had an error. -
ORA-28076
- Empty role name specified asSYS_SESSION_ROLES
attribute. -
ORA-28077
- The specified role namerole_name
forSYS_SESSION_ROLES
exceeds the maximum length. -
ORA-28078
- A regular expression parameter is missing or invalid. -
ORA-28082
- The parameter parameter is invalid (where the possible values arefunction_parameters
,column_description
, andpolicy_description
). -
ORA-28085
- The input and output lengths of the redaction do not match. -
ORA-28086
- The data redaction policy expression had an error -
ORA-28087
- The policy expression has an unsupported (use of)operator <operator>
. -
ORA-28088
- The policy expression has an unsupported PL/SQL functionfunction_name
. -
ORA-28089
- InvalidSYS_CONTEXT
namespace <namespace>
in policy expression. -
ORA-28090
- Unsupported nesting of functionfunction_name
within functionfunction_name
in policy expression. -
ORA-28091
- Unsupported use of PL/SQL functionfunction_name
in policy expression. -
ORA-28092
- The parameterparameter_name
with valuevalue
has an error. ORA-28096
- The parameterparameter_name
is unexpected forADD_POLICY
.-
ORA-28097
- A data redaction policy cannot be applied to an object owned bySYS
. -
ORA-28104
- Input value forparameter
is not valid.
Usage Notes
If you specify 1=1
for the expression parameter, then it is always
TRUE
, which causes the redaction to be performed as long as the querying
user is not exempt from the Oracle Data Redaction policy. Specifying 1=1
for the expression parameter will improve Data Redaction performance because Oracle Database
will not evaluate the policy expression.
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
See Operating Procedures for more information regarding function types and function parameters with related examples.
A Data
Redaction named policy expression that has been applied to a redacted column takes
precedence over the expression defined in the expression
parameter. To find
redacted columns that are affected by named policy expressions, query the
REDACTION_EXPRESSIONS
data dictionary view.
Example
Partial redaction policy:
BEGIN DBMS_REDACT.ADD_POLICY( object_schema => 'hr', object_name => 'employees', column_name => 'employee_id', policy_name => 'redact_emp_id_nums', function_type => DBMS_REDACT.PARTIAL, function_parameters => '7,1,5', expression => '1=1'); END;
Full redaction policy:
BEGIN DBMS_REDACT.ADD_POLICY( object_schema => 'hr', object_name => 'employees', column_name => 'employee_id', policy_name => 'redact_emp_ids', function_type => DBMS_REDACT.FULL, expression => 'SYS_CONTEXT(''SYS_SESSION_ROLES'',''CLERK'') = ''FALSE'''); END;
D.5.2 ALTER_POLICY Procedure
This procedure alters an existing Data Redaction policy for a table or view.
It alters the policy in one or more of the following ways:
-
By changing the policy expression
-
By changing the type of redaction for a specified column
-
By changing the parameters to the redaction function for a specified column
-
By adding a column to the redaction policy (the redaction type and any parameters must be specified).
-
By removing a column from the redaction policy
-
By changing the description of the policy
-
By changing the description of the column
Syntax
DBMS_REDACT.ALTER_POLICY ( object_schema IN VARCHAR2 := NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2, action IN BINARY_INTEGER := DBMS_REDACT.ADD_COLUMN, column_name IN VARCHAR2 := NULL, function_type IN BINARY_INTEGER := DBMS_REDACT.FULL, function_parameters IN VARCHAR2 := NULL, expression IN VARCHAR2, regexp_pattern IN VARCHAR2 := NULL, regexp_replace_string IN VARCHAR2 := NULL, regexp_position IN BINARY_INTEGER := 1, regexp_occurrence IN BINARY_INTEGER := 0, regexp_match_parameter IN VARCHAR2 := NULL, policy_description IN VARCHAR2 := NULL, column_description IN VARCHAR2 := NULL);
Parameters
Table D-7 ALTER_POLICY Procedure Parameters
Parameter | Description |
---|---|
|
Schema owning the table or view, current user if |
|
Name of table or view on which to alter a Data Redaction policy |
|
Name of policy limited to 30 bytes |
|
Action to take. For more information see Table D-2. |
|
(Optional) Name of one column to which the redaction policy applies. Required for the following actions:
|
|
Type of redaction function to use. Possible values are: - - - - - - - If the If the If the See Table D-1 for an overview of the meanings of these values, and for some examples of their use. |
|
Parameters to the redaction function. Use only if function_type is If the - If the - If the - If the
For number datatypes, a comma-separated list containing these fields:
For datetime datatypes, the format is a packed string (no spaces or commas) containing the following sequence of fields. Please note that each field can consist of one or more characters, and the field length depends on whether redacting is required. The one-character fields are used to specify that no redaction of that component of the datetime value is to take place. The longer fields indicate a specific time or date to use as the redacted value of that component of the datetime value.
An example is For partial character and number-redacting shortcuts, see Oracle Database Data Redaction Guide. |
|
Default boolean expression for the table or view. Redaction takes place only if this
policy expression evaluates to The following functions are supported:
|
|
Regular expression pattern up to 512 bytes. Use only if the See Oracle Database SQL Language Reference for more information and examples on using regular expression patterns. |
|
Replacement string (up to 4000 characters in length) with up to 500 back-references to subexpressions in the form Use only if the |
|
Integer counting from 1, specifies the position where the search must begin. Use only if the |
|
Use only if the |
|
Changes the default matching behavior, possible values are a combination of 'i', 'c', 'ic', 'iq', 'n', 'm', 'x'. The behavior of this parameter is the same for this function as for
the Use only if the See Oracle Database SQL Language Reference for more information and examples on using regular expression match parameters. |
|
Description of redaction policy |
|
Description of the column being redacted |
Exceptions
-
ORA-28060
- A data redaction policy already exists on this column. -
ORA-28061
- This object cannot have a data redaction policy defined on it. -
ORA-28062
- The policy expression is too long. -
ORA-28063
- The policy expression is empty. -
ORA-28064
- The redaction function is not valid. -
ORA-28066
- Invalid columncolumn
. -
ORA-28067
- Missing or invalid column name. -
ORA-28068
- The objectobject
does not have a Data Redaction policy. -
ORA-28069
- A Data Redaction policy already exists on this object. -
ORA-28070
- The columncolumn
does not have a Data Redaction policy. -
ORA-28071
- The action is not valid. -
ORA-28072
- The specified policy name is incorrect. -
ORA-28073
- The columncolumn_name
has an unsupported datatype or attribute. -
ORA-28074
- Thefield_name
field of the redaction parameters is not valid.The field can be any of the following:
-
REDACT_PARTIAL_INPUT_FORMAT
-
REDACT_PARTIAL_OUTPUT_FORMAT
-
REDACT_PARTIAL_MASKCHAR
-
REDACT_PARTIAL_MASKFROM
-
REDACT_PARTIAL_MASKTO
-
REDACT_PARTIAL_DATE_MONTH
-
REDACT_PARTIAL_DATE_DAY
-
REDACT_PARTIAL_DATE_YEAR
-
REDACT_PARTIAL_DATE_HOUR
-
REDACT_PARTIAL_DATE_MINUTE
-
REDACT_PARTIAL_DATE_SECOND
See Table D-3 and Table D-4 for examples of the field contents and field ordering.
-
-
ORA-28075
- The data redaction policy expression had an error. -
ORA-28076
- Empty role name specified asSYS_SESSION_ROLES
attribute. -
ORA-28077
- The specified role namerole_name
forSYS_SESSION_ROLES
exceeds the maximum length. -
ORA-28078
- A regular expression parameter is missing or invalid. -
ORA-28082
- The parameter parameter is invalid (where the possible values arefunction_parameters
,column_description
, andpolicy_description
). -
ORA-28085
- The input and output lengths of the redaction do not match. -
ORA-28086
- The data redaction policy expression had an error -
ORA-28087
- The policy expression has an unsupported (use of)operator <operator>
. -
ORA-28088
- The policy expression has an unsupported PL/SQL functionfunction_name
. -
ORA-28089
- InvalidSYS_CONTEXT
namespace <namespace>
in policy expression. -
ORA-28090
- Unsupported nesting of functionfunction_name
within functionfunction_name
in policy expression. -
ORA-28091
- Unsupported use of PL/SQL functionfunction_name
in policy expression. -
ORA-28092
- The parameterparameter_name
with valuevalue
has an error. ORA-28095
- The parameterparameter_name
is unexpected forACTION <action>
forALTER_POLICTY
.-
ORA-28097
- A data redaction policy cannot be applied to an object owned bySYS
. -
ORA-28104
- Input value forparameter
is not valid.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
See Operating Procedures for more information regarding Function Types and Function Parameters with related examples.
A Data
Redaction named policy expression that has been applied to a redacted column takes
precedence over the expression defined in the expression
parameter. To find
redacted columns that are affected by named policy expressions, query the
REDACTION_EXPRESSIONS
data dictionary view.
Examples
BEGIN DBMS_REDACT.ALTER_POLICY( object_schema => 'HR', object_name => 'EMPLOYEES', policy_name => 'redact_emp_id_nums', action => DBMS_REDACT.DROP_COLUMN, column_name => 'EMAIL'); END;
D.5.3 APPLY_POLICY_EXPR_TO_COL Procedure
This procedure associates an Oracle Data Redaction named policy expression with a redacted column from a table or view.
Syntax
DBMS_REDACT.APPLY_POLICY_EXPR_TO_COL ( object_schema IN VARCHAR2 := NULL, object_name IN VARCHAR2, column_name IN VARCHAR2, policy_expression_name IN VARCHAR2 := NULL);
Parameters
Table D-8 APPLY_POLICY_EXPR_TO_COL Procedure Parameters
Parameter | Description |
---|---|
|
Name of the schema that contains the redacted column. If omitted, then the current schema is used. |
|
Name of the object (table or view) that contains the redacted column |
|
Name of the redacted column to which the policy expression is applied |
|
If |
Exceptions
-
ORA-28061
- This object cannot have a data redaction policy defined on it. -
ORA-28066
- Invalid columncolumn_name
. -
ORA-28067
- Missing or invalid column name. -
ORA-28068
- The object object does not have a Data Redaction policy. -
ORA-28070
- The columncolumn_name
does not have a Data Redaction policy. -
ORA–28082
- The parameter parameter is invalid. -
ORA-28092
- The parameter parameter with value value has an error.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
You can find existing Data Redaction policy expressions by querying the REDACTION_EXPRESSIONS
data dictionary view. To find columns that have been redacted, query the REDACTION_COLUMNS
data dictionary view.
Example
BEGIN DBMS_REDACT.APPLY_POLICY_EXPR_TO_COL( object_schema => 'OE', object_name => 'CUSTOMERS', column_name => 'INCOME_LEVEL', policy_expression_name => 'oe_redact_pol'); END;
D.5.4 CREATE_POLICY_EXPRESSION Procedure
This procedure creates an Oracle Data Redaction named policy expression.
Syntax
DBMS_REDACT.CREATE_POLICY_EXPRESSION ( policy_expression_name IN VARCHAR2, expression IN VARCHAR2, policy_expression_description IN VARCHAR2 := NULL);
Parameters
Table D-9 CREATE_POLICY_EXPRESSION Procedure Parameters
Parameter | Description |
---|---|
|
Name of the policy expression |
|
Definition of the policy expression. |
|
Description of the policy expression |
Exceptions
-
ORA–28082
- The parameter parameter is invalid. -
ORA-28092
- The parameter parameter with value value has an error.
Usage Notes
If the expression parameter is 1=1
, then it is always
TRUE
, which causes the redaction to be performed as long as the querying
user is not exempt from the Oracle Data Redaction policy. Specifying this parameter as
1=1
will improve Data Redaction performance because Oracle Database will
not evaluate the policy expression.
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
See APPLY_POLICY_EXPR_TO_COL Procedure for how to apply policy expressions to table columns.
After you create a policy expression, you can associate it with a redacted table or view column by running the DBMS_REDACT.APPLY_POLICY_EXPR_TO_COL
procedure. To find existing redacted columns, query the REDACTION_COLUMNS
data dictionary view.
Example
BEGIN DBMS_REDACT.CREATE_POLICY_EXPRESSION( policy_expression_name => 'oe_redact_pol', expression => 'SYS_CONTEXT(''USERENV'',''SESSION_USER'') = ''OE'''), policy_expression_description => 'Enables policy for user OE '); END;
D.5.5 DISABLE_POLICY Procedure
This procedure disables a Data Redaction policy.
Syntax
DBMS_REDACT.DISABLE_POLICY ( object_schema IN VARCHAR2 := NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2);
Parameters
Table D-10 DISABLE_POLICY Procedure Parameters
Parameter | Description |
---|---|
|
Schema owning the table or view, current user if |
|
Name of table or view for which to disable a Data Redaction policy |
|
Name of policy to be disabled |
Exceptions
ORA_28061
- This object cannot have a Data Redaction policy defined on it.-
ORA-28068
- The objectobject
does not have a Data Redaction policy. -
ORA-28072
- The specified policy name is incorrect. -
ORA-28080
- The policy was already disabled. ORA_28104
- Input value forpolicy-name
is not valid.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
Examples
BEGIN DBMS_REDACT.DISABLE_POLICY ( object_schema => 'hr', object_name => 'employees', policy_name => 'redact_emp_ids'); END;
D.5.6 DROP_POLICY Procedure
This procedure drops a Data Redaction policy by removing a redaction policy from the table or view.
Syntax
DBMS_REDACT.DROP_POLICY ( object_schema IN VARCHAR2 := NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2);
Parameters
Table D-11 DROP_POLICY Procedure Parameters
Parameter | Description |
---|---|
|
Schema owning the table or view, current user if |
|
Name of table or view from which to drop a Data Redaction policy |
|
Name of policy to be dropped |
Exceptions
ORA_28061
- This object cannot have a Data Redaction policy defined on it.-
ORA-28068
- The objectobject
does not have a Data Redaction policy. -
ORA-28072
- The specified policy name is incorrect. ORA_28104
- Input value forpolicy-name
is not valid.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
Examples
BEGIN DBMS_REDACT.DROP_POLICY ( object_schema => 'hr', object_name => 'employees', policy_name => 'redact_emp_ids'); END;
D.5.7 DROP_POLICY_EXPRESSION Procedure
This procedure drops a named policy expression.
Syntax
DBMS_REDACT.DROP_POLICY_EXPRESSION ( policy_expression_name IN VARCHAR2);
Parameters
Table D-12 DROP_POLICY_EXPRESSION Procedure Parameters
Parameter | Description |
---|---|
|
Name of the policy expression |
Exceptions
-
ORA–28082
- The parameter parameter is invalid. -
ORA-28092
- The parameter parameter with value value has an error.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
You can find existing Data Redaction policy expressions by querying the REDACTION_EXPRESSIONS
data dictionary view.
Example
BEGIN DBMS_REDACT.DROP_POLICY_EXPRESSION( policy_expression_name => 'oe_redact_pol'); END;
D.5.8 ENABLE_POLICY Procedure
This procedure re-enables a Data Redaction policy.
Syntax
DBMS_REDACT.ENABLE_POLICY ( object_schema IN VARCHAR2 := NULL, object_name IN VARCHAR2, policy_name IN VARCHAR2);
Parameters
Table D-13 ENABLE_POLICY Procedure Parameters
Parameter | Description |
---|---|
|
Schema owning the table or view, current user if |
|
Name of table or view on which to enable a Data Redaction policy |
|
Name of policy to be enabled |
Exceptions
-
ORA-28068
- The objectobject
does not have a Data Redaction policy. -
ORA-28071
- The action is not valid. -
ORA-28072
- The specified policy name is incorrect. -
ORA-28079
- The policy was already enabled.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
Examples
BEGIN DBMS_REDACT.ENABLE_POLICY ( object_schema => 'hr', object_name => 'employees', policy_name => 'redact_emp_ids'); END;
D.5.9 UPDATE_FULL_REDACTION_VALUES Procedure
This procedure modifies the redacted output that will be displayed when
querying a column having a Data Redaction policy where the function_type
is
DBMS_REDACT.FULL
. Restart the database instance to apply these
changes.
Syntax
DBMS_REDACT.UPDATE_FULL_REDACTION_VALUES ( number_val IN NUMBER := NULL, binfloat_val IN BINARY_FLOAT := NULL, bindouble_val IN BINARY_DOUBLE := NULL, char_val IN CHAR := NULL, varchar_val IN VARCHAR2 := NULL, nchar_val IN NCHAR := NULL, nvarchar_val IN NVARCHAR2 := NULL, date_val IN DATE := NULL, ts_val IN TIMESTAMP := NULL, tswtz_val IN TIMESTAMP WITH TIME ZONE := NULL, blob_val IN BLOB := NULL, clob_val IN CLOB := NULL, nclob_val IN NCLOB := NULL, boolean_val IN BOOLEAN := NULL);
Parameters
Table D-14 UPDATE_FULL_REDACTION_VALUES Procedure Parameters
Parameter | Description |
---|---|
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
|
Modifies the default value for columns of the |
Example D-1 Change the Current Value for Columns That Use the NUMBER
Data
Type
-
EXEC DBMS_REDACT.UPDATE_FULL_REDACTION_VALUES (number_val => 7);
-
Close the PDB:
ALTER PLUGGABLE DATABASE <pdb_name> CLOSE IMMEDIATE;
-
Re-open the PDB:
ALTER PLUGGABLE DATABASE <pdb_name> OPEN;
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
D.5.10 UPDATE_POLICY_EXPRESSION Procedure
This procedure updates an Oracle Data Redaction named policy expression.
Syntax
DBMS_REDACT.UPDATE_POLICY_EXPRESSION ( policy_expression_name IN VARCHAR2, expression IN VARCHAR2, policy_expression_description IN VARCHAR2 := NULL);
Parameters
Table D-15 UPDATE_POLICY_EXPRESSION Procedure Parameters
Parameter | Description |
---|---|
|
Name of the policy expression |
|
Definition of the policy expression |
|
Description of the policy expression |
Exceptions
-
ORA–28082
- The parameter parameter is invalid. -
ORA-28092
- The parameter parameter with value value has an error.
Usage Notes
See DBMS_REDACT Security Model for a list of the required privileges for this procedure.
You can find existing policy expressions by querying the REDACTION_EXPRESSIONS
data dictionary view.
Example
BEGIN DBMS_REDACT.UPDATE_POLICY_EXPRESSION( policy_expression_name => 'oe_redact_pol', expression => 'SYS_CONTEXT(''USERENV'',''SESSION_USER'') != ''OE'''), policy_expression_description => 'Updates policy expression for oe_redact_pol'); END;