Archiv pro štítek: trace

Čtení informací z default trace

Z default trace je možné vyčíst spoustu zajímavých událostí.

Database Data File Autogrow
Database Data File AutoShrink
Database Database Mirroring State Change
Database Log File Autogrow
Database Log File AutoShrink
Errors and Warnings ErrorLog
Errors and Warnings Hash Warning
Errors and Warnings Missing Column Statistics
Errors and Warnings Missing Join Predicate
Errors and Warnings Sort Warnings
Full text FT:Crawl Aborted
Full text FT:Crawl Started
Full text FT:Crawl Stopped
Objects Object:Altered
Objects Object:Created
Objects Object:Deleted
Performance Plan Guide Unsuccessful
Security Audit Audit Add DB User Event
Security Audit Audit Add Login to Server Role Event
Security Audit Audit Add Member to DB Role Event
Security Audit Audit Add Role Event
Security Audit Audit Addlogin Event
Security Audit Audit Backup/Restore Event
Security Audit Audit Change Audit Event
Security Audit Audit Change Database Owner
Security Audit Audit Database Scope GDR Event
Security Audit Audit DBCC Event
Security Audit Audit Login Change Property Event
Security Audit Audit Login Failed
Security Audit Audit Login GDR Event
Security Audit Audit Schema Object GDR Event
Security Audit Audit Schema Object Take Ownership Event
Security Audit Audit Server Alter Trace Event
Security Audit Audit Server Starts And Stops
Server Server Memory Change
SELECT 
	d.StartTime,
	d.LoginName,
	d.HostName,
	d.ApplicationName,
	d.DatabaseName,
	d.ObjectName,
	d.textData,
	te.name
FROM sys.traces t
CROSS APPLY
fn_trace_gettable(t.path,default) d
LEFT JOIN sys.trace_events te ON d.EventClass = te.trace_event_id
WHERE is_default = 1
ORDER BY d.StartTime