18.6 Design Guidelines for Analytics with Oracle Deep Data Security
Analytical queries process only the data authorized by your data grants. To ensure your grouping, ordering, and aggregations yield accurate results, follow these guidelines.
- Separate access rules from analytical logic: Define all
access boundaries within your data grants. Always place analytical
operations (such as window functions, aggregates,
PIVOT, andQUALIFY) in the query that reads the object, never in the data-grant predicate itself. - Secure all referenced objects: Configure data grants for every object that an analytical query references. This includes tables and views used in joins and subqueries.
- Authorize critical operational columns: Ensure the end
user has authorization to access any columns required for grouping, joining,
partitioning, ordering, or mathematical calculations. If these structural
columns are masked as
NULL, they can unintentionally skew the analytical results. - Preserve standard
NULLbehavior during calculations: Allow Oracle SQL to apply its normalNULLsemantics to unauthorized values during query execution. If a report requires a display substitute, such as'REDACTED'or0forNULL, apply it only in the final, outermostSELECTlist. - Clarify statistical and approximate results: Masked
NULLvalues are often ignored by statistical functions. Whenever a calculation's actual input size might differ from the overall row count, display the number of contributing non-NULLvalues—for example, by pairingCOUNT(column)orREGR_COUNTalongsideCOUNT(*)—so users understand exactly how much data factored into the result.