Skip to content

Commit 8a1518b

Browse files
author
Ajay Dwivedi
committed
Removed any word related to my current organization
Removed any word related to my current organization
1 parent d9f9dbe commit 8a1518b

File tree

105 files changed

+519
-7664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+519
-7664
lines changed
10 KB
Binary file not shown.

Backup-Restore/3) Generate - Restore Script - BackupHistory.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DECLARE @Databases nvarchar(max) = 'Staging';
1616
*/
1717

1818
-- Input 07
19-
DECLARE @p_Destination_ServerName VARCHAR(125) = 'TUL1CIPXDB17';
19+
DECLARE @p_Destination_ServerName VARCHAR(125) = 'YourDbServerName';
2020
-- Input 08
2121
DECLARE @p_Destination_BackupLocation VARCHAR(255) = 'F:\backups\';
2222
-- Input 09
@@ -241,7 +241,7 @@ FROM msdb.dbo.backupmediafamily AS bmf
241241
INNER JOIN msdb.dbo.backupset AS bs ON bmf.media_set_id = bs.media_set_id
242242
WHERE bs.is_snapshot = 0 AND bs.database_name IN (SELECT DatabaseName FROM @tmpDatabases d WHERE d.Selected = 1)
243243
-- Get all backups on/after Latest Full Backup
244-
AND bs.backup_start_date >= (select max(bsi.backup_start_date) FROM msdb.dbo.backupmediafamily AS bmfi INNER JOIN msdb.dbo.backupset AS bsi ON bmfi.media_set_id = bsi.media_set_id where bsi.is_snapshot = bs.is_snapshot AND bsi.database_name = bs.database_name and bsi.type = 'D' --and bmfi.physical_device_name not like '\\Ann1vespdb01\%'
244+
AND bs.backup_start_date >= (select max(bsi.backup_start_date) FROM msdb.dbo.backupmediafamily AS bmfi INNER JOIN msdb.dbo.backupset AS bsi ON bmfi.media_set_id = bsi.media_set_id where bsi.is_snapshot = bs.is_snapshot AND bsi.database_name = bs.database_name and bsi.type = 'D' --and bmfi.physical_device_name not like '\\Sqlpdb01\%'
245245
)
246246
)
247247
SELECT *

Backup-Restore/Backup-Restore.ssmssqlproj

+8-32
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,6 @@
2727
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
2828
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
2929
</ConnectionNode>
30-
<ConnectionNode Name="TUL1CIPCNPDB1:CORPORATE\adwivedi">
31-
<Created>2019-10-09T16:13:05.9153233+05:30</Created>
32-
<Type>SQL</Type>
33-
<Server>TUL1CIPCNPDB1</Server>
34-
<UserName />
35-
<Authentication>Windows Authentication</Authentication>
36-
<InitialDB />
37-
<LoginTimeout>30</LoginTimeout>
38-
<ExecutionTimeout>0</ExecutionTimeout>
39-
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
40-
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
41-
</ConnectionNode>
42-
<ConnectionNode Name="TUL1CIPXDB20:CORPORATE\adwivedi">
43-
<Created>2019-10-09T22:29:39.1977294+05:30</Created>
44-
<Type>SQL</Type>
45-
<Server>TUL1CIPXDB20</Server>
46-
<UserName />
47-
<Authentication>Windows Authentication</Authentication>
48-
<InitialDB>DBA</InitialDB>
49-
<LoginTimeout>30</LoginTimeout>
50-
<ExecutionTimeout>0</ExecutionTimeout>
51-
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
52-
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
53-
</ConnectionNode>
5430
</Items>
5531
</LogicalFolder>
5632
<LogicalFolder Name="Queries" Type="0" Sorted="true">
@@ -68,8 +44,8 @@
6844
<FullPath>2) Script Out DB Permissions in case of DB Refresh.sql</FullPath>
6945
</FileNode>
7046
<FileNode Name="3) Generate - Restore Script - BackupHistory.sql">
71-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
72-
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
47+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:LOCALHOST:True</AssociatedConnectionMoniker>
48+
<AssociatedConnSrvName>LOCALHOST</AssociatedConnSrvName>
7349
<AssociatedConnUserName />
7450
<FullPath>3) Generate - Restore Script - BackupHistory.sql</FullPath>
7551
</FileNode>
@@ -122,8 +98,8 @@
12298
<FullPath>Get-LatestBackups.sql</FullPath>
12399
</FileNode>
124100
<FileNode Name="Jobs-Enable-Disable-TSQL.sql">
125-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
126-
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
101+
<AssociatedConnectionMoniker />
102+
<AssociatedConnSrvName />
127103
<AssociatedConnUserName />
128104
<FullPath>Jobs-Enable-Disable-TSQL.sql</FullPath>
129105
</FileNode>
@@ -146,8 +122,8 @@
146122
<FullPath>Query - Restore History.sql</FullPath>
147123
</FileNode>
148124
<FileNode Name="RevLogin-Script.sql">
149-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPXDB20:True</AssociatedConnectionMoniker>
150-
<AssociatedConnSrvName>TUL1CIPXDB20</AssociatedConnSrvName>
125+
<AssociatedConnectionMoniker />
126+
<AssociatedConnSrvName />
151127
<AssociatedConnUserName />
152128
<FullPath>RevLogin-Script.sql</FullPath>
153129
</FileNode>
@@ -164,8 +140,8 @@
164140
<FullPath>ScriptOut - RESTORE With REPLACE - Single Db.sql</FullPath>
165141
</FileNode>
166142
<FileNode Name="v0.0 - Move Data and Log Files.sql">
167-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
168-
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
143+
<AssociatedConnectionMoniker />
144+
<AssociatedConnSrvName />
169145
<AssociatedConnUserName />
170146
<FullPath>v0.0 - Move Data and Log Files.sql</FullPath>
171147
</FileNode>

Baselining/Agent Operator [Ajay Dwivedi].sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ GO
33
EXEC msdb.dbo.sp_add_operator @name=N'Ajay Dwivedi',
44
@enabled=1,
55
@pager_days=0,
6-
@email_address=N'ajay.dwivedi@tivo.com'
6+
@email_address=N'ajay.dwivedi@contso.com'
77
GO

Baselining/Baselining.ssmssqlproj

+4-28
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,13 @@
2727
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
2828
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
2929
</ConnectionNode>
30-
<ConnectionNode Name="TUL1MDUTWDS1:CORPORATE\adwivedi">
31-
<Created>2019-09-13T15:00:34.5134664+05:30</Created>
32-
<Type>SQL</Type>
33-
<Server>TUL1MDUTWDS1</Server>
34-
<UserName />
35-
<Authentication>Windows Authentication</Authentication>
36-
<InitialDB />
37-
<LoginTimeout>30</LoginTimeout>
38-
<ExecutionTimeout>0</ExecutionTimeout>
39-
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
40-
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
41-
</ConnectionNode>
42-
<ConnectionNode Name="TUL1MDUTWDS2:CORPORATE\adwivedi">
43-
<Created>2019-09-13T15:03:49.9757548+05:30</Created>
44-
<Type>SQL</Type>
45-
<Server>TUL1MDUTWDS2</Server>
46-
<UserName />
47-
<Authentication>Windows Authentication</Authentication>
48-
<InitialDB />
49-
<LoginTimeout>30</LoginTimeout>
50-
<ExecutionTimeout>0</ExecutionTimeout>
51-
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
52-
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
53-
</ConnectionNode>
5430
</Items>
5531
</LogicalFolder>
5632
<LogicalFolder Name="Queries" Type="0" Sorted="true">
5733
<Items>
5834
<FileNode Name="Agent Operator [Ajay Dwivedi].sql">
59-
<AssociatedConnectionMoniker />
60-
<AssociatedConnSrvName />
35+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
36+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
6137
<AssociatedConnUserName />
6238
<FullPath>Agent Operator [Ajay Dwivedi].sql</FullPath>
6339
</FileNode>
@@ -92,8 +68,8 @@
9268
<FullPath>DBA - Start DataCollector.sql</FullPath>
9369
</FileNode>
9470
<FileNode Name="Export-Excel.sql">
95-
<AssociatedConnectionMoniker />
96-
<AssociatedConnSrvName />
71+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:LOCALHOST:True</AssociatedConnectionMoniker>
72+
<AssociatedConnSrvName>LOCALHOST</AssociatedConnSrvName>
9773
<AssociatedConnUserName />
9874
<FullPath>Export-Excel.sql</FullPath>
9975
</FileNode>

Baselining/BenchMarking-Storage-Network.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ https://sqlperformance.com/2015/12/monitoring/network-testing-iperf
2828
iperf3 -s
2929

3030
On Client =>
31-
iperf3 -c tul1sqlpoc01 -t 120 -P 50
31+
iperf3 -c YourServerName -t 120 -P 50
3232
-- 120 seconds, 30 threads
3333

3434
-- Method 01: Powershell
35-
& "C:\iperf-3.1.3-win64\iperf3.exe" -c tul1cipxidb3 -t 120 -P 50
35+
& "C:\iperf-3.1.3-win64\iperf3.exe" -c YourServerName -t 120 -P 50
3636
& "C:\iperf-3.1.3-win64\iperf3.exe" -s
3737

3838
-- Method 02: Powershell
3939
cmd.exe /c "C:\iperf-3.1.3-win64\iperf3.exe -s"
40-
cmd.exe /c "C:\iperf-3.1.3-win64\iperf3.exe -c tul1cipxidb3 -t 120 -P 50"
40+
cmd.exe /c "C:\iperf-3.1.3-win64\iperf3.exe -c YourServerName -t 120 -P 50"

Baselining/Export-Excel.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$server = 'tul1cipedb2'
1+
$server = 'YourDbServerName'
22
$tsqlQuery = @"
33
DECLARE @p_CheckDate datetimeoffset
44
,@p_Collection_Time datetime;

Baselining/Job [DBA - FirstResponderKit_Collect_PerformanceData].sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Created By: Ajay Dwivedi
2626
Purpose: This job will collect data regarding running sessions, waits stats and queries.
2727
Data is being collect for 14 days in DBA database tables like dbo.Blitz*****.',
2828
@category_name=N'DBA',
29-
@owner_login_name=N'CORPORATE\adwivedi',
29+
@owner_login_name=N'Contso\adwivedi',
3030
@notify_email_operator_name=N'Ajay Dwivedi', @job_id = @jobId OUTPUT
3131
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
3232
/****** Object: Step [FirstResponderKit_Collect_PerformanceData] Script Date: 2/20/2019 1:18:38 AM ******/

BlitzQueries/BlitzQueries.ssmssqlproj

+2-32
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,6 @@
2727
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
2828
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
2929
</ConnectionNode>
30-
<ConnectionNode Name="tul1cipbksdb2:CORPORATE\adwivedi">
31-
<Created>2019-09-16T17:09:31.5964044+05:30</Created>
32-
<Type>SQL</Type>
33-
<Server>tul1cipbksdb2</Server>
34-
<UserName />
35-
<Authentication>Windows Authentication</Authentication>
36-
<InitialDB />
37-
<LoginTimeout>30</LoginTimeout>
38-
<ExecutionTimeout>0</ExecutionTimeout>
39-
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
40-
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
41-
</ConnectionNode>
42-
<ConnectionNode Name="TUL1CIPXDB17:CORPORATE\adwivedi">
43-
<Created>2019-11-06T12:00:46.9564943+05:30</Created>
44-
<Type>SQL</Type>
45-
<Server>TUL1CIPXDB17</Server>
46-
<UserName />
47-
<Authentication>Windows Authentication</Authentication>
48-
<InitialDB>master</InitialDB>
49-
<LoginTimeout>30</LoginTimeout>
50-
<ExecutionTimeout>0</ExecutionTimeout>
51-
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
52-
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
53-
</ConnectionNode>
5430
</Items>
5531
</LogicalFolder>
5632
<LogicalFolder Name="Queries" Type="0" Sorted="true">
@@ -128,8 +104,8 @@
128104
<FullPath>Detect n Reduce High VLFs.sql</FullPath>
129105
</FileNode>
130106
<FileNode Name="Find-Indirect-Connections.sql">
131-
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPXDB17:True</AssociatedConnectionMoniker>
132-
<AssociatedConnSrvName>TUL1CIPXDB17</AssociatedConnSrvName>
107+
<AssociatedConnectionMoniker />
108+
<AssociatedConnSrvName />
133109
<AssociatedConnUserName />
134110
<FullPath>Find-Indirect-Connections.sql</FullPath>
135111
</FileNode>
@@ -223,12 +199,6 @@
223199
<AssociatedConnUserName />
224200
<FullPath>WhatIsRunning.sql</FullPath>
225201
</FileNode>
226-
<FileNode Name="who_is_active_v11_30(Modified).sql">
227-
<AssociatedConnectionMoniker />
228-
<AssociatedConnSrvName />
229-
<AssociatedConnUserName />
230-
<FullPath>who_is_active_v11_30(Modified).sql</FullPath>
231-
</FileNode>
232202
<FileNode Name="who_is_active_v11_32(Modified).sql">
233203
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
234204
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>

BlitzQueries/Fragmentation-Analysis.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Script to Get Fragmentation Stats for All Dbs on Multiple Servers (in Parallel Jobs)
2-
$dbServers = @('TUL1CIPCNPDB1','TUL1CIPEDB2','TUL1CIPXDB13');
2+
$dbServers = @('DbServer01','DbServer02','DbServer03');
33

44
$dbQuery = @"
55
select d.name

BlitzQueries/whoIsActive.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
EXEC sp_WhoIsActive @get_full_inner_text=1, @get_transaction_info=1, @get_task_info=2, @get_locks=1, @get_avg_time=1, @get_additional_info=1,@find_block_leaders=1, @get_outer_command =1
22
,@get_plans=2
33
--,@filter_type = 'session' ,@filter = '325'
4-
--,@filter_type = 'login' ,@filter = 'Corporate\RichMedia'
4+
--,@filter_type = 'login' ,@filter = 'Contso\RichMedia'
55
--,@sort_order = '[reads] desc'
66

77
-- EXEC sp_WhoIsActive @help = 1;
@@ -10,7 +10,7 @@ EXEC sp_healthcheck @p_getExecutionPlan = 1;
1010
-- EXEC [dbo].[sp_HealthCheck] '?'
1111

1212
/*
13-
$instance = 'ANN1VESPDB01';
13+
$instance = 'DbServerName';
1414
$excelPath = "C:\Temp\$instance.xlsx";
1515
$sqlQuery = @"
1616
exec sp_whoIsActive @get_plans=1, @get_full_inner_text=1,

0 commit comments

Comments
 (0)