Database / Snowflake Interview Questions
What is the Snowflake Access History feature and how does it support audit and compliance?
Access History records every query that accessed specific database objects — tracking exactly which tables and columns were read or written, by which user, running which role, at what time. It is the foundation for data lineage auditing, regulatory compliance (GDPR, CCPA, HIPAA), and detecting over-privileged accounts.
The primary view is SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY. Key columns include:
QUERY_IDandQUERY_START_TIME— the query being audited.USER_NAMEandROLE_NAME— who ran the query.DIRECT_OBJECTS_ACCESSED— tables/views the SQL explicitly named.BASE_OBJECTS_ACCESSED— the underlying base tables behind any views, including column-level granularity.OBJECTS_MODIFIED— tables written to via DML/COPY.
Access History has a latency of up to 3 hours before records appear in the ACCOUNT_USAGE views. For compliance-sensitive queries, this means near-real-time auditing is not possible through this view alone — pair it with query history and login history for a fuller picture.
Practical use: run a weekly query across ACCESS_HISTORY and TAG_REFERENCES to produce a report of which users accessed columns tagged as sensitivity=high, satisfying GDPR Article 30 record-keeping requirements.
More Related questions...