Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6721dc1

Browse files
Updated Scripts to remove High Page Splits
Updated Scripts to remove High Page Splits
1 parent 745ae8a commit 6721dc1

13 files changed

+6847
-7964
lines changed

‎.vs/SQLDBA-SSMS Solution/v15/.ssms_suo

-2.5 KB
Binary file not shown.

‎OlaHallengren.com/DatabaseBackup.sql

Lines changed: 0 additions & 1914 deletions
This file was deleted.

‎OlaHallengren.com/Index-Defrag-UpdateStats-Analysis.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
USE Staging
1+
USE DBA
22
go
33

44
SET NOCOUNT ON;
55

6-
declare @FragmentationLevel1 int = 50
6+
declare @FragmentationLevel1 int = 20
77

88
-- Code for IndexOptimize_Modified
99
select db_name(ips.database_id) as DbName,

‎OlaHallengren.com/MaintenanceSolution.sql renamed to ‎OlaHallengren.com/MaintenanceSolution-Without-Jobs.sql

Lines changed: 6377 additions & 5792 deletions
Large diffs are not rendered by default.

‎OlaHallengren.com/OlaHallengren.com.ssmssqlproj

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Items>
44
<LogicalFolder Name="Connections" Type="2" Sorted="true">
55
<Items>
6-
<ConnectionNode Name="(local):CORPORATE\adwivedi">
6+
<ConnectionNode Name="(local):MSI\ajayd">
77
<Created>2019年09月21日T21:08:14.4331443+05:30</Created>
88
<Type>SQL</Type>
99
<Server>(local)</Server>
@@ -15,7 +15,7 @@
1515
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
1616
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
1717
</ConnectionNode>
18-
<ConnectionNode Name="LOCALHOST:CORPORATE\adwivedi">
18+
<ConnectionNode Name="LOCALHOST:MSI\ajayd">
1919
<Created>2019年10月08日T00:14:40.2341836+05:30</Created>
2020
<Type>SQL</Type>
2121
<Server>LOCALHOST</Server>
@@ -39,7 +39,7 @@
3939
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
4040
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
4141
</ConnectionNode>
42-
<ConnectionNode Name="TUL1CIPCNPDB1:CORPORATE\adwivedi">
42+
<ConnectionNode Name="TUL1CIPCNPDB1:MSI\ajayd">
4343
<Created>2019年10月31日T21:51:37.4157116+05:30</Created>
4444
<Type>SQL</Type>
4545
<Server>TUL1CIPCNPDB1</Server>
@@ -51,7 +51,7 @@
5151
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
5252
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
5353
</ConnectionNode>
54-
<ConnectionNode Name="TUL1CIPEDB2:CORPORATE\adwivedi">
54+
<ConnectionNode Name="TUL1CIPEDB2:MSI\ajayd">
5555
<Created>2019年11月08日T12:05:52.8740508+05:30</Created>
5656
<Type>SQL</Type>
5757
<Server>TUL1CIPEDB2</Server>
@@ -63,7 +63,7 @@
6363
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
6464
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
6565
</ConnectionNode>
66-
<ConnectionNode Name="TUL1CIPXDB13:CORPORATE\adwivedi">
66+
<ConnectionNode Name="TUL1CIPXDB13:MSI\ajayd">
6767
<Created>2019年11月08日T12:14:19.8748039+05:30</Created>
6868
<Type>SQL</Type>
6969
<Server>TUL1CIPXDB13</Server>
@@ -75,7 +75,7 @@
7575
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
7676
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
7777
</ConnectionNode>
78-
<ConnectionNode Name="TUL1CIPXDB20:CORPORATE\adwivedi">
78+
<ConnectionNode Name="TUL1CIPXDB20:MSI\ajayd">
7979
<Created>2019年11月10日T19:55:56.9233912+05:30</Created>
8080
<Type>SQL</Type>
8181
<Server>TUL1CIPXDB20</Server>
@@ -92,26 +92,20 @@
9292
<LogicalFolder Name="Queries" Type="0" Sorted="true">
9393
<Items>
9494
<FileNode Name="[IndexOptimize_Modified].sql">
95-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPXDB20:True</AssociatedConnectionMoniker>
96-
<AssociatedConnSrvName>TUL1CIPXDB20</AssociatedConnSrvName>
95+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
96+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
9797
<AssociatedConnUserName />
9898
<FullPath>[IndexOptimize_Modified].sql</FullPath>
9999
</FileNode>
100-
<FileNode Name="DatabaseBackup.sql">
101-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:sqla:False:sa</AssociatedConnectionMoniker>
102-
<AssociatedConnSrvName>sqla</AssociatedConnSrvName>
103-
<AssociatedConnUserName>sa</AssociatedConnUserName>
104-
<FullPath>DatabaseBackup.sql</FullPath>
105-
</FileNode>
106100
<FileNode Name="Get-Log-File-Size-Used.sql">
107101
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
108102
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
109103
<AssociatedConnUserName />
110104
<FullPath>Get-Log-File-Size-Used.sql</FullPath>
111105
</FileNode>
112106
<FileNode Name="Index-Defrag-UpdateStats-Analysis.sql">
113-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
114-
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
107+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:LOCALHOST:True</AssociatedConnectionMoniker>
108+
<AssociatedConnSrvName>LOCALHOST</AssociatedConnSrvName>
115109
<AssociatedConnUserName />
116110
<FullPath>Index-Defrag-UpdateStats-Analysis.sql</FullPath>
117111
</FileNode>
@@ -121,11 +115,11 @@
121115
<AssociatedConnUserName />
122116
<FullPath>Maintainence - Delete files older than 72 hours.sql</FullPath>
123117
</FileNode>
124-
<FileNode Name="MaintenanceSolution.sql">
118+
<FileNode Name="MaintenanceSolution-Without-Jobs.sql">
125119
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:LOCALHOST:True</AssociatedConnectionMoniker>
126120
<AssociatedConnSrvName>LOCALHOST</AssociatedConnSrvName>
127121
<AssociatedConnUserName />
128-
<FullPath>MaintenanceSolution.sql</FullPath>
122+
<FullPath>MaintenanceSolution-Without-Jobs.sql</FullPath>
129123
</FileNode>
130124
<FileNode Name="Ola Update Stats Formula.sql">
131125
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:LOCALHOST:True</AssociatedConnectionMoniker>

‎OlaHallengren.com/Queries-Used.sql

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-- https://ola.hallengren.com/sql-server-backup.html
22

3-
EXECUTE audit_archive..IndexOptimize
3+
EXECUTE dbo.IndexOptimize
44
/* Update Stats */
5-
@Databases = 'geneva_warehouse',
5+
@Databases = 'ALL_DATABASES',
66
@FragmentationLow = NULL,
77
@FragmentationMedium = NULL,
88
@FragmentationHigh = NULL,
@@ -57,4 +57,29 @@ EXEC DBA.dbo.[DatabaseBackup]
5757
@DirectoryStructure = NULL, /* Do not create directory structure */
5858
@BackupType = 'DIFF',
5959
@FileExtensionDiff = 'diff',
60-
@Compress = 'Y'
60+
@Compress = 'Y'
61+
62+
63+
use DBA
64+
go
65+
66+
/* IndexOptimize [DBA] with @TimeLimit = 3.5 Hour */
67+
EXECUTE dbo.IndexOptimize_Modified
68+
@Databases = 'DBA', -- Multiple databases can also be passed here
69+
@TimeLimit = 5400, -- 3.5 hours
70+
@FragmentationLow = NULL,
71+
@FragmentationMedium = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
72+
@FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
73+
@FragmentationLevel1 = 20,
74+
@FragmentationLevel2 = 30,
75+
@MinNumberOfPages = 1000,
76+
@SortInTempdb = 'Y', /* Enable it when [Cosmo] production Server since [tempdb] & [Cosmo] database are on separate disks */
77+
@MaxDOP = 4, /* Default = 3 on Cosmo server */
78+
--@FillFactor = 70, /* Recommendations says to start with 100, and keep decreasing based on Page Splits/Sec value of server. On Cosmo server, Page Splits/sec are very high. Avg 171 page splits/sec for Avg 354 Batch Requests/sec */
79+
@LOBCompaction = 'Y',
80+
@UpdateStatistics = 'ALL',
81+
@OnlyModifiedStatistics = 'Y',
82+
@Indexes = 'ALL_INDEXES', /* Default is not specified. Db1.Schema1.Tbl1.Idx1, Db2.Schema2.Tbl2.Idx2 */
83+
--@Delay = 120, /* Introduce 300 seconds of Delay b/w Indexes of Replicated Databases */
84+
@LogToTable = 'Y'
85+
,@forceReInitiate = 0

‎OlaHallengren.com/[IndexOptimize_Modified].sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
USE [DBA]
22
GO
33

4-
ALTER PROCEDURE [dbo].[IndexOptimize_Modified] @Databases nvarchar(max) = NULL,
4+
CREATE PROCEDURE [dbo].[IndexOptimize_Modified] @Databases nvarchar(max) = NULL,
55
@FragmentationLow nvarchar(max) = NULL,
66
@FragmentationMedium nvarchar(max) = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
77
@FragmentationHigh nvarchar(max) = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /