Forum Stats

  • 3,875,935 Users
  • 2,266,996 Discussions
  • 7,912,379 Comments

Discussions

Data Masking SSN with Uniqueness

User_SPNIA
User_SPNIA Member Posts: 1 Green Ribbon

I am trying to mask SSNs using encrypt.  I have the SSN set at the primary key and the ADM discovers the key.

When I run the generated script, it drops the primary key, then masks then tries to re-create the primary key, but all of the SSNs are no longer discreet.

How do I enforce the primary key or unique constraint during masking?

EXECUTE IMMEDIATE 'ALTER TABLE "' || c.owner || '"."' ||

        c.table_name ||

'" DROP CONSTRAINT "' || c.constraint_name || '"';

  END LOOP;

END;

DROP INDEX "LOWEJ"."NATIONAL_ID"        <--------------------------------------------------------------------

DROP TABLE "LOWEJ"."SIS_MASK$DMASK" PURGE

Table or view already dropped, continuing

ALTER TABLE "LOWEJ"."SIS_MASK" RENAME TO "SIS_MASK$DMASK"

begin

  if mgmt$mask_util.is_move_dmask then

    EXECUTE IMMEDIATE 'ALTER TABLE

"LOWEJ"."SIS_MASK$DMASK" MOVE  '||mgmt$mask_util.get_tbps_clause_dmask||'';

ALTER TABLE "LOWEJ"."SIS_MASK" LOGGING  NOPARALLEL

DROP TABLE "LOWEJ"."SIS_MASK$DMASK" PURGE

CREATE UNIQUE INDEX "LOWEJ"."NATIONAL_ID" ON "LOWEJ"."SIS_MASK"

("NATIONAL_ID")

  PCTFREE 10 INITRANS 2 LOGGING

  STORAGE(INITIAL 65536 NEXT

1048576 MINEXTENTS 1 MAXEXTENTS 2147483645

  PCTINCREASE 0 FREELISTS 1 FREELIST

GROUPS 1 BUFFER_POOL DEFAU

LT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)

  TABLESPACE "USERS"

ERROR executing steps

ORA-12801: error signaled in parallel query server P003

ORA-01452: cannot CREATE

UNIQUE INDEX; duplicate keys found           <------------------------------------------------------------------------------------------------------------------------

errorExitOraError!