Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
Data Masking SSN with Uniqueness

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!