Skrypt dzięki uprzejmości Igora Yaremenko 🙂 — create event session CREATE EVENT SESSION [Database_Growth_Watchdog] ON SERVER ADD EVENT sqlserver.database_file_size_change ( ACTION ( sqlserver.client_app_name , sqlserver.client_hostname , sqlserver.database_name , sqlserver.session_nt_username , sqlserver.sql_text , sqlserver.username ) WHERE ( [database_id] = ( 2 ))) ADD TARGET package0.event_file ( SET filename = N’D:\Temp\Database_Growth_Wathdog.xel’, max_file_size =Czytaj dalej / Read more
Tag: autogrowth
Autogrowth events – skrypt na detale rozrostu MDF / NDF i LDF z default trace’a
Znalezione na stronie The SQL Guy by Norm Enger USE [master]; GO BEGIN TRY IF ( SELECT CONVERT(INT, value_in_use) FROM sys.configurations WHERE name = 'default trace enabled’ ) = 1 BEGIN DECLARE @curr_tracefilename VARCHAR(500); DECLARE @base_tracefilename VARCHAR(500); DECLARE @indx INT; SELECT @curr_tracefilename = path FROM sys.traces WHERE is_default = 1;Czytaj dalej / Read more