Menu

1 / 2

How to Audit Only Critical Operations Like DROP TABLE in GBase 8a

DEV Community·Michael·6 months ago
#JnGNFcDV
#gbase#database#security#software#audit
Reading 0:00
15s threshold

GBase 8a’s audit log can capture virtually every SQL operation. To keep logs lean and focused on security, you can configure a policy that records only high‑risk actions — like DROP TABLE — using the CREATE AUDIT POLICY command. This post shows you exactly how to set it up in a gbase database .

What the Audit Log Can Record

The audit framework covers all major SQL categories:

DDL : CREATE , ALTER , DROP (including DROP_TABLE , DROP_DB ), TRUNCATE , RENAME_USER

DML : SELECT , INSERT , DELETE , UPDATE , LOAD , MERGE

DCL & Users : GRANT , REVOKE , CREATE_USER , DROP_USER

OTHERS : any SQL not explicitly listed

Step‑by‑Step: Record Only High‑Risk Operations

1. Enable Audit Logging to a Table

SET GLOBAL log_output = 'table' ; SET GLOBAL audit_log = 1 ;

-- Verify SHOW VARIABLES LIKE '%audit_log%' ; SHOW VARIABLES LIKE '%log_output%' ;

Enter fullscreen mode

Exit fullscreen mode

2. Create an Audit Policy (the key part)

Use CREATE AUDIT POLICY and list the exact commands you want to capture.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.