Large Objects

Masking Large Objects requires some additional consideration regarding the potentially very large size of each value.

Many of DataVeil's masks involve complex transformations and calculations that work effectively for regular data that is relatively short (such as names, card numbers, etc), however, these masks usually do not scale well for values that are each thousands of bytes long or longer.

Therefore, the following recommendations are for when you are masking a column that has a significantly large number of rows (e.g. more than a million) and the average length of each value is more than approximately 1,000 bytes.


Character Large Objects (CLOBs)

Unless you have specific requirements to the contrary, it is recommended to use one of the masks below to mask an Oracle CLOB or SQL Server varchar(MAX) data type:

* Sentences mask. Use an explicit length range up to approximately 400 characters. Longer than this could cause significantly slower masking times.

* User SQL Value mask. You can specify something as simple as a repeating character. This will be much faster than the Sentences mask mentioned above.

The examples below show how to specify a replacement string consisting of 'X' for the same length as the original value. Note, these use the DataVeil macro #_column_name to automatically load the correct column name in whichever column's User SQL Value mask this is used. You could also define the mask as a Mask Component for reuse among many columns.

For Oracle:  RPAD(TO_CLOB('X'), DBMS_LOB.GETLENGTH(#_column_name), TO_CLOB('X'))

For SQL Server:  REPLICATE('X', LEN(#_column_name))

Alternatively, you could generate shorter replacement values, such as the examples below that will generate only 1000 character values.

For Oracle:  RPAD(TO_CLOB('X'), 1000, TO_CLOB('X'))

For SQL Server:  REPLICATE('X', 1000)


Binary Large Objects (BLOBs)

Unless you have specific requirements to the contrary, it is recommended to use a User SQL Value mask to mask large binary type field. This mask could either set the value to NULL or to use a non-sensitive value from a lookup table that you have prepared.