只是想知道是否有一个日志/审计表来保存信息,比如哪些用户创建/更改/删除了密钥或索引等?
答案 0 :(得分:1)
默认跟踪捕获DDL更改。下面是一个收集这些信息的例子。
--Object:Created and Object:Altered events from default trace
SELECT
te.name AS EventName
,tt.StartTime as st
,tt.DatabaseName
,tt.ObjectName
FROM sys.traces AS t
CROSS APPLY [fn_trace_gettable](t.path, DEFAULT) AS tt
JOIN sys.trace_events AS te ON
te.trace_event_id = tt.EventClass
WHERE
tt.EventClass in (46,164)
AND tt.EventSubClass = 0
ORDER BY st DESC;