只是想知道是否存在用于保存信息的日志/审核表,例如哪些用户已创建/更改/删除了键或索引等?
The default trace captures DDL changes. Below is an example to glean some of this information.
--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;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.