My Oracle Support Banner

PARTIAL REDACTION DOES NOT REDACT THE "TIME" PART OF DATE-TIME DATA TYPE (Doc ID 2457125.1)

Last updated on OCTOBER 16, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Information in this document applies to any platform.

Symptoms

 When trying to partially redact a date-time data type.After applying
the redaction policy,only the Date part of the column value is getting
redacted while the Time part still remains the same.
 
Before Redaction:
=================

SQL> conn test1/test1
Connected.


SQL> select to_char(COL1,'DD-MON-YYYY HH24:MI:SS')"COL1",COL2 from
SCOTT.DRTEST;

COL1                               COL2
-------------------------------- ----------
04-APR-2016 00:00:00       rp
03-APR-2016 00:00:00       pj
06-APR-2016 00:00:00       vk
03-APR-2016 21:02:44       KP
04-APR-2016 21:02:44       MP


Creation of Redaction Policy
===============================

SQL> BEGIN
  2    DBMS_REDACT.ADD_POLICY(
  object_schema  => 'SCOTT',
  object_name    => 'DRTEST',
  policy_name    => 'TEST_POLICY',
  expression     => 'SYS_CONTEXT(''USERENV'',''SESSION_USER'') = ''TEST1''',
  column_name    => 'COL1',
  function_type  => DBMS_REDACT.PARTIAL,
  function_parameters => 'm12d6y1980h11m20s52');
END;
/   3    4    5    6    7    8    9   10   11

PL/SQL procedure successfully completed.


After Redaction:
==================

SQL> select to_char(COL1,'DD-MON-YYYY HH24:MI:SS')"COL1",COL2 from
SCOTT.DRTEST;

COL1                                COL2
-------------------------------- ----------
06-DEC-1980 00:00:00       rp
06-DEC-1980 00:00:00       pj
06-DEC-1980 00:00:00       vk
06-DEC-1980 21:02:44       KP
06-DEC-1980 21:02:44       MP

Changes

 As per the documentation,the "time" part can also be redacted.
https://docs.oracle.com/database/121/ASOAG/redaction_config.htm#ASOAG818

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.