Skip to content

Commit 50bb6c6

Browse files
committed
update comments
1 parent f340b23 commit 50bb6c6

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

ssisdb history cleanup.sql

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
USE ssisdb
2-
GO
3-
--default log retention is 180 days. For frequently-running SSIS packagse, this could generate 100Gb+ data in months
4-
--But changing the log retention time frame drastically could cause the built-in sprocs to try and delete 100Gb+ at once
5-
--Instead, step down the retention in small chunks. This could still take HOURS to complete and block other SSIS jobs
6-
-- from logging, so recommended to create a maintainence window and stop SSISDB jobs from executing.
1+
/*
2+
Default log retention is 180 days. For frequently-running SSIS packages, this could generate 100Gb+ data in months
3+
But changing the log retention time frame drastically could cause the built-in sprocs to try and delete 100Gb+ at once
4+
Instead, step down the retention in small chunks. This could still take HOURS to complete and block other SSIS jobs
5+
from logging, so recommended to create a maintainence window and stop SSISDB jobs from executing.
6+
The script calls two stored procedure which are called by the SQL Agent job [SSIS Server Maintenance Job] at midnight by default.
77
8-
--FYI: a bug in [internal].[cleanup_server_retention_window] prevents large deletes from succeeding.
9-
--You'll see error message: "A cursor with the name 'execution_cursor' does not exist. [SQLSTATE 34000] (Error 16916)."
10-
--More info: https://feedback.azure.com/forums/908035-sql-server/suggestions/37360864-ssis-server-maintenance-job-fails
11-
--Fixed version is in comment block below. Careful!
8+
FYI: a bug in [internal].[cleanup_server_retention_window] may prevent some large deletes from succeeding.
9+
You'll see error message: "A cursor with the name 'execution_cursor' does not exist. [SQLSTATE 34000] (Error 16916)."
10+
More info: https://feedback.azure.com/forums/908035-sql-server/suggestions/37360864-ssis-server-maintenance-job-fails
11+
Fixed version is in comment block below. Careful!
1212
13+
*/
14+
USE ssisdb
15+
GO
1316

1417
declare @current int, @desired int
1518

@@ -30,12 +33,15 @@ BEGIN
3033
END
3134

3235
/*
33-
--bugfix
36+
--Potential needed bugfix for SQL 2017
37+
--don't copy-replace this, it might be different on your version of SQL!
38+
--Look for the comment below "This line moved"
39+
3440
USE [SSISDB]
3541
GO
3642
3743
38-
ALTER PROCEDURE [internal].[cleanup_server_retention_window]
44+
CREATE PROCEDURE [internal].[cleanup_server_retention_window]
3945
WITH EXECUTE AS 'AllSchemaOwner'
4046
AS
4147
SET NOCOUNT ON
@@ -202,7 +208,7 @@ AS
202208
CLOSE execution_cursor
203209
TRUNCATE TABLE #deleted_ops
204210
END
205-
DEALLOCATE execution_cursor
211+
DEALLOCATE execution_cursor --This line moved
206212
DROP TABLE #deleted_ops
207213
END
208214

toolbox.zip

171 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)