Skip to main content

Dg Schema

PK Protect utilizes target data storage for storing masking task metadata and their status, generated during the task execution.

When a masking task is executed, Dg schema gets created. The DgSecureMaskerIDP creates the following masking objects i.e., Masker Metadata Tables, Procedures, and Scalar UDF Functions in the schema. These objects help the IDP during masking task execution and only store metadata such as column details that need to be masked, masking options, status and errors occur during the task if any. The Dg schema is created for all the databases except Salesforce.

For some specific databases, these objects are created.

  1. Oracle: This object is created within the Oracle user account that is used for creating masking connection.

  2. Postgres, SQL Server, Snowflake, Redshift: These objects are created in Dg schema under the database that is used for creating masking connection. You can edit the schema name in RDBMS > Static Masking > Tasks/Templates Definition screen under “Package schema” option.

  3. MySQL, Teradata: These objects are created in the database that has been specified while creating masking connection.

The Package Schema setting enables the user to store the masking task metadata and status generated while the task is running. This setting is available in the RDBMS > Static Masking > Tasks/Templates Definition screen listed under +Show Advanced Options. You can enter the name of the schema using this option. The default value of the Package Schema is set to DG.

Following are the masking objects created under Dg schema:

Masker Metadata Tables

These tables are created by the DgSecureMaskerIDP when a masking task is executed.

It uses Dg schema to save the task parameters and to keep track of masking tasks and their status during the task execution.

In procedures, accessing task definitions and other global data from tables are more convenient than passing all the data through parameters. These tables also assist Database Administrators to monitor the task state from the database.

Following are the tables created in Dg schema that stores the masking related information:

  1. DGSQL:  This table logs the queries that are used in the masking task. 

  2. DG_COLUMNS: This table saves the masking task definition and metadata related to columns that are a part of masking tasks.

  3. DG_ERROR_LOG: This table logs the errors generated during the execution of a masking task.  

  4. DG_PROCESS_CONTROL: This table stores multiple flags for the masking task status.  

  5. DG_RECREATE_INDEX: This table contains metadata related to constraints that needs to be enabled/disabled. 

  6. DG_RECREATE_TRIGGER: This table contains metadata related to triggers that needs to be enabled/disabled.

  7. DG_RE_ENABLE: This table contains metadata related to constraints that needs to be enabled/disabled during execution of a masking task.

  8. DG_SCHEDULEDJOBS: Masking on multiple tables is done in batches. This table contains metadata of tables that are a part of masking tasks.  

  9. DG_STATUS_MESSAGE: This table contains status messages and high-level logs from masking task.

  10. DG_TABLES: This table saves the masking task definition and metadata related to tables that are a part of masking tasks.

  11. DG_WATERMARK: This table includes encrypted text of fully qualified column names which has been masked. 

  12. DG_WORKER_LOG: This table contains metadata related to tables that are in-queue or have already been masked. It also saves the number of rows masked, once the task has been completed.

  13. Country_XDGM: This table stores the referenced data for Random-Country masking option. The values are picked from this table, and it will update the column that is masked using Random-Country masking option.

Similarly, there are other XDGM tables that stores referenced data for other Random Masking options which can be used to update the column that needs to be masked.

Procedures

Procedures are created in Dg schema by the DgSecureMaskerIDP during the execution of masking task. These procedures contain the logic that processes data and is passed through the multiple parameters. It contains set of instructions/steps that helps in executing the task. Procedures are created in the following databases: Oracle, SQL Server, Postgresql, MySQL, and DB2.

Given below are the sample procedure names in Oracle:

CODE
DG_FIND_PK_FK , DG_FINDK_PK, DG_CLEAR_CONSTRAINTS,
DG_UPDATE_DEPEND_COLUMNS,  DG_PRECHECKS,
DG_CREATE_WORKERS, DG_ERROR_HANDLING,
DG_GET_COLUMNS_BY_TABLE, DG_GET_TABLES
DG_GET_TABLES_BYID, DG_INSERT_COLUMN_COLLATION,
DG_INSERT_ORDINAL, DG_INSERT_ROWCOUNT,
DG_INSERT_TABLE_ID, DG_MAIN_COMPLETE,
DG_UPDATE_COLUMN_STATUS, DG_UPDATE_COLUMN_STATUS_BY_TAB,
DG_UPDATE_LNK_COL_COUNT, DG_UPDATE_STATUS,
DG_UPDATE_STATUS_ALL, DG_UPDATE_TABLE_STATUS,
DG_UPDATE_WORKER_ROWS, DG_UPDATE_WORKER_STATUS,
DG_UPDATE_WORKER_STATUS_BY_TAB, DG_WRITE_DEBUG_LOG,
DG_WRITE_ERROR_LOG, FIND_PK_FK, DG_DROP_ALL_TEMP_TABLES  

 
Scalar UDF Functions

These functions are created by the DgSecureMaskerIDP in the Dg schema when a masking task is executed. These functions are used to create masking query that takes original data as input and returns masked data as output.

There are two types of functions:

  1. PL/SQL: These functions are written in PL/SQL language.

  2. External: These functions are written in java, python or .net language.

 

Given below is the sample update query in SQL language:

CODE
UPDATE "table name" SET "column 1" = fpm(column1, key), " column 2" = date();

Given below is the sample for External Function:

CODE
REPLACE FUNCTION DG_FPM  
   ( 
    columnvalue VARCHAR(32000) , 
    keepnull VARCHAR(500) , 
    newid BIGINT, 
    datatype VARCHAR(500) , 
    scale1 INTEGER, 
    precision1 INTEGER)  
    RETURNS VARCHAR(32000) 
    SPECIFIC DG_FPM  
    LANGUAGE JAVA  
    NO SQL 
    NO EXTERNAL DATA 
    PARAMETER STYLE JAVA  
    DETERMINISTIC  
    CALLED ON NULL INPUT EXTERNAL NAME

  'dgMaskingFunctionsLib: com.dataguise.maskingengine.MaskingFunctions.DG_FM 
  (java.lang.String, java.lang.String, long, java.lang.String, int, int) 
   returns java.lang.String'; 

 

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.