2.8 Comparison of Full, Partial, Regexp, Random, and Nullify Redaction Based on Data Types

The full, partial, regular expression, random, and nullify data redaction styles affect the Oracle built-in, ANSI, user-defined, and Oracle supplied types in different ways.

2.8.1 Oracle Built-in Data Types Redaction Capabilities

Oracle Data Redaction handles the Oracle built-in data types depending on the type of Data Redaction policies that are used.

Table 2-1 describes the Oracle Data Redaction support for Oracle built-in data types.

Table 2-1 Redaction Support for Oracle Built-in Data Types

Column Data Type Full Redaction Partial Redaction Regexp Redaction Random Redaction Nullify Redaction

BFILE

No

No

No

No

No

BINARY_DOUBLE

Yes

Yes

No

Yes

Yes

BINARY_FLOAT

Yes

Yes

No

Yes

Yes

BLOB

Yes

No

No

No

Yes

BOOLEAN

Yes

No

No

Yes

Yes

CHAR

Yes

Yes

Yes

Yes

Yes

CLOB

Yes

No

Yes

No

Yes

DATE

Yes

Yes

No

Yes

Yes

FLOAT

Yes

Yes

No

Yes

Yes

FLOAT

Yes

Yes

No

Yes

Yes

INTERVAL DAY TO SECOND

No

No

No

No

No

INTERVAL YEAR TO MONTH

No

No

No

No

No

LONG RAW

No

No

No

No

No

NCHAR

Yes

Yes

Yes

Yes

Yes

NCLOB

Yes

No

Yes

No

Yes

NUMBER

Yes

Yes

No

Yes

Yes

NVARCHAR2

Yes

Yes

Yes

Yes

Yes

RAW

No

No

No

No

No

ROWID

No

No

No

No

No

TIMESTAMP

Yes

Yes

No

Yes

Yes

TIMESTAMP WITH LOCAL TIME ZONE

Yes

Yes

No

Yes

Yes

TIMESTAMP WITH TIME ZONE

Yes

Yes

No

Yes

Yes

UROWID

No

No

No

No

No

VARCHAR2

(Including long VARCHAR2 such as VARCHAR2(20000))

Yes

Yes

Yes

Yes

Yes

2.8.2 ANSI Data Types Redaction Capabilities

Oracle Data Redaction converts ANSI data types in specific ways, depending on the type of redaction that the Data Redaction policy has.

Table 2-2 compares how the full, partial, regular expression, random, and nullify redaction styles work for ANSI data types, with regard to how they are converted and their support status.

Table 2-2 Redaction Support for the ANSI Data Types

Data Type How Converted Full Redaction Partial Redaction Regexp Redaction Random Redaction Nullify Redaction

CHARACTER(n),

CHAR(n)

Converted to CHAR(n)

Yes

Yes

Yes

Yes

Yes

CHARACTER VARYING(n),

CHAR VARYING(n)

Converted to VARCHAR2(n)

Yes

Yes

Yes

Yes

Yes

NATIONAL CHARACTER(n),

NATIONAL CHAR(n),

NCHAR(n)

Converted to NCHAR(n)

Yes

Yes

Yes

Yes

Yes

NATIONAL CHARACTER VARYING(n),

NATIONAL CHAR VARYING(n),

NCHAR VARYING(n)

Converted to NVARCHAR2(n)

Yes

Yes

Yes

Yes

Yes

NUMERIC[(p,s)]

DECIMAL[(p,s)]

Converted to NUMBER(p,s)

Yes

Yes

No

Yes

Yes

INTEGER,

INT,

SMALLINT

Converted to NUMBER(38)

Yes

Yes

No

Yes

Yes

FLOAT,

DOUBLE PRECISION

Converted to FLOAT(126)

Yes

Yes

No

Yes

Yes

REAL

Converted to FLOAT(63)

Yes

Yes

No

Yes

Yes

GRAPHIC,

LONG VARGRAPHIC,

VARGRAPHIC,

TIME

No conversion

No

No

No

No

No

2.8.3 Built-in and ANSI Data Types Full Redaction Capabilities

For full redaction, the default redacted value depends on whether the data type is Oracle built-in or ANSI.

Table 2-3 shows the default settings for both Oracle built-in and ANSI data type columns that use full redaction.

Table 2-3 Default Settings and Categories for Columns That Use Full Redaction

Data Type Default Redacted Value Data Type Category

CHARACTER

Single space (“ “)

Oracle built-in

CHARACTER(n),

CHAR(n)

Single space (“ “)

ANSI

CHARACTER VARYING(n),

CHAR VARYING(n)

Single space (“ “)

ANSI

NATIONAL CHARACTER(n),

NATIONAL CHAR(n),

NCHAR(n)

Single space (“ “)

ANSI

NATIONAL CHARACTER VARYING(n),

NATIONAL CHAR VARYING(n),

NCHAR VARYING(n)

Single space (“ “)

ANSI

NUMBER

Zero (0)

Oracle built-in

NUMERIC[(p,s)]

DECIMAL[(p,s)]

Zero (0)

Oracle built-in

INTEGER,

INT,

SMALLINT

Zero (0)

ANSI

FLOAT,

DOUBLE PRECISION

Zero (0)

ANSI

REAL

Zero (0)

ANSI

DATE-TIME

01–01–01 or 01–01–01 01:00:00

Oracle built-in

BLOB

Oracle’s raw representation of [redacted]

Foot 1

Oracle built-in

CLOB

[redacted]

Oracle built-in

NCLOB

[redacted]

Oracle built-in

Footnote 1

If you have changed the character set, then you may need to invoke the DBMS_REDACT.UPDATE_FULL_REDACTION_VALUES procedure to set the value to the raw representation in the new character set, as follows:

DECLARE
 new_red_blob BLOB;
BEGIN
 DBMS_LOB.CREATETEMPORARY(new_red_blob, TRUE);
 DBMS_LOB.WRITE(new_red_blob, 10, 1, UTL_RAW.CAST_TO_RAW('[redacted]'));
 dbms_redact.update_full_redaction_values(
  blob_val      => new_red_blob);
DBMS_LOB.FREETEMPORARY(new_red_blob);
END;
/

After you run this procedure, restart the database.

See also Altering the Default Full Data Redaction Value for more information about using the DBMS_REDACT.UPDATE_FULL_REDACTION_VALUES procedure.

2.8.4 User-Defined Data Types or Oracle Supplied Types Redaction Capabilities

Several data types are not supported by Oracle Data Redaction.

Oracle Data Redaction does not support user-defined data types or Oracle supplied types, such as anytype types, JSON types, VECTOR types, XML types, and Oracle Spatial types.