Skip to content

Commit 1050d2c

Browse files
authored
updating all scripts, moving all diagnostic scripts to respective release version folders (#59)
* updating scripts * removing deleted file * removing deleted files
1 parent 080262a commit 1050d2c

File tree

495 files changed

+16674
-14565
lines changed

Some content is hidden

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

495 files changed

+16674
-14565
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[CmdletBinding()]
2+
Param(
3+
[Parameter(Mandatory=$True, Position=0, HelpMessage="The Server Instance against which the script is to run.")]
4+
[string]$SQLServerInstance,
5+
6+
[Parameter(Mandatory=$True, Position=1, HelpMessage="Configuration DB")]
7+
[string]$ConfigurationDatabaseName,
8+
9+
[Parameter(Mandatory=$False, Position=2, HelpMessage="Pause Indexing for Code, WorkItem or All.")]
10+
[string]$EntityType = "All"
11+
)
12+
13+
function ImportSQLModule
14+
{
15+
$moduleCheck = Get-Module -List SQLPS
16+
if($moduleCheck)
17+
{
18+
Import-Module -Name SQLPS -DisableNameChecking
19+
Write-Host "Loaded SQLPS module..." -ForegroundColor Green
20+
}
21+
else
22+
{
23+
Write-Error "Cannot load module SQLPS. Please try from a machine running SQL Server 2012 or higher."
24+
Pop-Location
25+
exit
26+
}
27+
}
28+
29+
function PauseCodeIndexing
30+
{
31+
$SqlFullPath = Join-Path $PWD -ChildPath 'SqlScripts\PauseCodeIndexing.sql'
32+
Invoke-Sqlcmd -InputFile $SqlFullPath -serverInstance $SQLServerInstance -database $ConfigurationDatabaseName
33+
}
34+
35+
function PauseWorkItemIndexing
36+
{
37+
$SqlFullPath = Join-Path $PWD -ChildPath 'SqlScripts\PauseWorkItemIndexing.sql'
38+
Invoke-Sqlcmd -InputFile $SqlFullPath -serverInstance $SQLServerInstance -database $ConfigurationDatabaseName
39+
}
40+
41+
Write-Host "This would pause indexing for all the collections. Do you want to continue - Yes or No? " -NoNewline -ForegroundColor Magenta
42+
$userInput = Read-Host
43+
44+
if($userInput -like "Yes")
45+
{
46+
[System.ENVIRONMENT]::CurrentDirectory = $PWD
47+
Push-Location
48+
ImportSQLModule
49+
50+
switch ($EntityType)
51+
{
52+
"All"
53+
{
54+
Write-Host "Pausing indexing for Code and WorkItem..." -ForegroundColor Green
55+
PauseCodeIndexing
56+
PauseWorkItemIndexing
57+
Write-Host "Code and WorkItem Indexing has been paused!! Run ResumeIndexing.ps1 to resume indexing." -ForegroundColor Green
58+
}
59+
"WorkItem"
60+
{
61+
Write-Host "Pausing indexing for WorkItem..." -ForegroundColor Green
62+
PauseWorkItemIndexing
63+
Write-Host "WorkItem Indexing has been paused!! Run ResumeIndexing.ps1 to resume indexing." -ForegroundColor Green
64+
}
65+
"Code"
66+
{
67+
Write-Host "Pausing indexing for Code..." -ForegroundColor Green
68+
PauseCodeIndexing
69+
Write-Host "Code Indexing has been paused!! Run ResumeIndexing.ps1 to resume indexing." -ForegroundColor Green
70+
}
71+
default
72+
{
73+
Write-Host "Enter a valid EntityType i.e. Code or WorkItem or All" -ForegroundColor Red
74+
}
75+
}
76+
77+
Pop-Location
78+
}
79+
else
80+
{
81+
Write-Warning "Exiting! Indexing was not paused." -ForegroundColor Cyan
82+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[CmdletBinding()]
2+
Param(
3+
[Parameter(Mandatory=$True, Position=0, HelpMessage="The Server Instance against which the script is to run.")]
4+
[string]$SQLServerInstance,
5+
6+
[Parameter(Mandatory=$True, Position=1, HelpMessage="Configuration DB")]
7+
[string]$ConfigurationDatabaseName,
8+
9+
[Parameter(Mandatory=$False, Position=2, HelpMessage="Resume Indexing for Code, WorkItem or All")]
10+
[string]$EntityType = "All"
11+
)
12+
13+
function ResumeCodeIndexing
14+
{
15+
$SqlFullPath = Join-Path $PWD -ChildPath 'SqlScripts\ResumeCodeIndexing.sql'
16+
Invoke-Sqlcmd -InputFile $SqlFullPath -serverInstance $SQLServerInstance -database $ConfigurationDatabaseName
17+
Write-Host "Code Indexing has been resumed!!" -ForegroundColor Green
18+
}
19+
20+
function ResumeWorkItemIndexing
21+
{
22+
$SqlFullPath = Join-Path $PWD -ChildPath 'SqlScripts\ResumeWorkItemIndexing.sql'
23+
Invoke-Sqlcmd -InputFile $SqlFullPath -serverInstance $SQLServerInstance -database $ConfigurationDatabaseName
24+
Write-Host "WorkItem Indexing has been resumed!!" -ForegroundColor Green
25+
}
26+
27+
function ImportSQLModule
28+
{
29+
$moduleCheck = Get-Module -List SQLPS
30+
if($moduleCheck)
31+
{
32+
Import-Module -Name SQLPS -DisableNameChecking
33+
Write-Host "Loaded SQLPS module..." -ForegroundColor Green
34+
}
35+
else
36+
{
37+
Write-Error "Cannot load module SQLPS. Please try from a machine running SQL Server 2012 or higher."
38+
Pop-Location
39+
exit
40+
}
41+
}
42+
43+
[System.ENVIRONMENT]::CurrentDirectory = $PWD
44+
Push-Location
45+
ImportSQLModule
46+
47+
switch ($EntityType)
48+
{
49+
"All"
50+
{
51+
Write-Host "Resuming indexing for Code and WorkItem..." -ForegroundColor Green
52+
ResumeCodeIndexing
53+
ResumeWorkItemIndexing
54+
}
55+
"WorkItem"
56+
{
57+
Write-Host "Resuming indexing for WorkItem..." -ForegroundColor Green
58+
ResumeWorkItemIndexing
59+
}
60+
"Code"
61+
{
62+
Write-Host "Resuming indexing for Code..." -ForegroundColor Green
63+
ResumeCodeIndexing
64+
}
65+
default
66+
{
67+
Write-Host "Enter a valid EntityType i.e. Code or WorkItem or All" -ForegroundColor Red
68+
}
69+
}
70+
71+
72+
Pop-Location
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
SELECT [ProjectId]
2-
,[Id]
3-
,[Identifier]
4-
,[Name]
5-
,[Path]
6-
,[NodeType]
7-
,[ParentId]
8-
,[Token]
9-
,[SecurityHashcode]
1+
SELECT [ProjectId]
2+
,[Id]
3+
,[Identifier]
4+
,[Name]
5+
,[Path]
6+
,[NodeType]
7+
,[ParentId]
8+
,[Token]
9+
,[SecurityHashcode]
1010
FROM [Search].[tbl_ClassificationNode]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
SELECT [RepositoryId]
2-
,[BranchName]
3-
,[FilePath]
4-
,[DisableReason]
5-
,[ContentHash]
6-
,[LastUpdatedTimeStamp]
1+
SELECT [RepositoryId]
2+
,[BranchName]
3+
,[FilePath]
4+
,[DisableReason]
5+
,[ContentHash]
6+
,[LastUpdatedTimeStamp]
77
FROM [Search].[tbl_DisabledFiles]
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
SELECT [Id]
2-
,[IndexingUnitId]
3-
,[ChangeType]
4-
,[ChangeData]
5-
,[CurrentStage]
6-
,[State]
7-
,[AttemptCount]
8-
,[Prerequisites]
9-
,[CreatedTimeUTC]
10-
,[LastModificationTimeUTC]
11-
,[LeaseId]
12-
FROM [Search].[tbl_IndexingUnitChangeEvent]
1+
SELECT [Id]
2+
,[IndexingUnitId]
3+
,[ChangeType]
4+
,[ChangeData]
5+
,[CurrentStage]
6+
,[State]
7+
,[AttemptCount]
8+
,[Prerequisites]
9+
,[CreatedTimeUTC]
10+
,[LastModificationTimeUTC]
11+
,[LeaseId]
12+
FROM [Search].[tbl_IndexingUnitChangeEvent]
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
SELECT [TFSEntityId]
2-
,[IndexingUnitType]
3-
,[EntityType]
4-
,[IndexingUnitId]
5-
,[TFSEntityAttributes]
6-
,[ParentUnitId]
7-
,[Properties]
8-
,[AssociatedJobId]
9-
,[CreatedTimeUTC]
10-
,[IsDeleted]
11-
FROM [Search].[tbl_IndexingUnit]
1+
SELECT [TFSEntityId]
2+
,[IndexingUnitType]
3+
,[EntityType]
4+
,[IndexingUnitId]
5+
,[TFSEntityAttributes]
6+
,[ParentUnitId]
7+
,[Properties]
8+
,[AssociatedJobId]
9+
,[CreatedTimeUTC]
10+
,[IsDeleted]
11+
FROM [Search].[tbl_IndexingUnit]
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
IF (OBJECT_ID(N'Search.tbl_ItemLevelFailures') IS NOT NULL)
2-
BEGIN
3-
SELECT [IndexingUnitId]
4-
,[Id]
5-
,[Item]
6-
,[AttemptCount]
7-
,[Stage]
8-
,[Reason]
9-
,[Metadata]
10-
FROM [Search].[tbl_ItemLevelFailures]
1+
IF (OBJECT_ID(N'Search.tbl_ItemLevelFailures') IS NOT NULL)
2+
BEGIN
3+
SELECT [IndexingUnitId]
4+
,[Id]
5+
,[Item]
6+
,[AttemptCount]
7+
,[Stage]
8+
,[Reason]
9+
,[Metadata]
10+
FROM [Search].[tbl_ItemLevelFailures]
1111
END
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SELECT [TFSEntityId]
2-
,[EntityType]
3-
,[BatchId]
4-
,[Content]
5-
FROM [Search].[tbl_JobYield]
1+
SELECT [TFSEntityId]
2+
,[EntityType]
3+
,[BatchId]
4+
,[Content]
5+
FROM [Search].[tbl_JobYield]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SELECT [ResourceName]
2-
,[LockMode]
3-
,[LockOwner]
4-
,[LeaseId]
1+
SELECT [ResourceName]
2+
,[LockMode]
3+
,[LockOwner]
4+
,[LeaseId]
55
FROM [Search].[tbl_ResourceLockTable]
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/*
2-
This script gets the Search related registry settings from Collection DB.
3-
*/
4-
5-
SELECT ParentPath, ChildItem, RegValue
6-
FROM tbl_RegistryItems
7-
where PartitionId > 0 and
8-
ParentPath like '%Search%'
1+
/*
2+
This script gets the Search related registry settings from Collection DB.
3+
*/
4+
5+
SELECT ParentPath, ChildItem, RegValue
6+
FROM tbl_RegistryItems
7+
where PartitionId > 0 and
8+
ParentPath like '%Search%'

0 commit comments

Comments
 (0)