Skip to content

Commit b5993ae

Browse files
script info for gallery
1 parent d3049d4 commit b5993ae

7 files changed

+191
-5
lines changed

Backup-OLADatabase.ps1

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
<#
1+
<#PSScriptInfo
2+
3+
.VERSION 1.0
4+
5+
.GUID e690e558-357e-43fb-9bcf-5c39b33ce527
6+
7+
.AUTHOR Rob Sewell
8+
9+
.DESCRIPTION This function will perform an ad-hoc backup using OLA Hallengrens solution - It doesnot expose all of the capabilities but is useful for quick backups when needed Note the Database paramter is dynamically filled once you type it
10+
11+
.COMPANYNAME
12+
13+
.COPYRIGHT
14+
15+
.TAGS SQL, Ola Hallengren, Backup
16+
17+
.LICENSEURI
18+
19+
.PROJECTURI
20+
21+
.ICONURI
22+
23+
.EXTERNALMODULEDEPENDENCIES
24+
25+
.REQUIREDSCRIPTS
26+
27+
.EXTERNALSCRIPTDEPENDENCIES
28+
29+
.RELEASENOTES
30+
31+
#>
32+
<#
233
.Synopsis
334
To perform an ad-hoc backup using OLA Hallengrens solution
435
.DESCRIPTION

Get-SQLInstancesPort.ps1

+31
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
<#PSScriptInfo
2+
3+
.VERSION 1.0
4+
5+
.GUID 5a165df0-c30a-4147-b252-975dbd2a6b2d
6+
7+
.AUTHOR Rob Sewell
8+
9+
.DESCRIPTION This function will show the Instances and the Port Numbers on a SQL Server using WMI and the status of the relevant SQL Service and its start mode
10+
11+
.COMPANYNAME
12+
13+
.COPYRIGHT
14+
15+
.TAGS SQL, Instance, Port Numbers, Service Accounts
16+
17+
.LICENSEURI
18+
19+
.PROJECTURI
20+
21+
.ICONURI
22+
23+
.EXTERNALMODULEDEPENDENCIES
24+
25+
.REQUIREDSCRIPTS
26+
27+
.EXTERNALSCRIPTDEPENDENCIES
28+
29+
.RELEASENOTES
30+
31+
#>
132
<#
233
.SYNOPSIS
334
Shows the Instances and the Port Numbers and SQL Service Status and Start mode on a SQL Server

Show-DatabasesOnServer.ps1

824 Bytes
Binary file not shown.

Test-OLA.ps1

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
## This script will check the status of the SQL Servers OLA set up including all agent jobs, folders and existence of backup files
1+
<#PSScriptInfo
2+
3+
.VERSION 1.0
4+
5+
.GUID e900b08e-5e27-47ab-b407-462b409696ae
6+
7+
.AUTHOR Rob Sewell
8+
9+
.DESCRIPTION This script will check the status of the SQL Servers OLA set up including all agent jobs, folders and existence of backup files
10+
11+
.COMPANYNAME
12+
13+
.COPYRIGHT
14+
15+
.TAGS SQL, Ola Hallengren, Backup, Pester, Test, OVF
16+
17+
.LICENSEURI
18+
19+
.PROJECTURI
20+
21+
.ICONURI
22+
23+
.EXTERNALMODULEDEPENDENCIES sqlserver
24+
25+
.REQUIREDSCRIPTS
26+
27+
.EXTERNALSCRIPTDEPENDENCIES
28+
29+
.RELEASENOTES
30+
31+
#>
32+
## This script will check the status of the SQL Servers OLA set up including all agent jobs, folders and existence of backup files
233
## Whilst you can call this script directly using Invoke-Pester and a script block as shown below it should be called with
334
##
435
## function Test-OLAInstance

Test-OLAInstance.ps1

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
# You will need to add the path to Test-Ola.ps1 on Line 90
1+
<#PSScriptInfo
2+
3+
.VERSION 1.0
4+
5+
.GUID fee80eda-3390-4396-9a2b-478c81c2267f
6+
7+
.AUTHOR Rob Sewell
8+
9+
.DESCRIPTION Tests an instance or a number of instances to ensure that the OLA Hallengren solution is set up correctly. That all agent jobs exist, are schedeuled and were successful That the relevant folders for each database exist and that there are backups files in the folders It uses the Test-Ola.ps1 file You will need to add the path to Test-Ola.ps1 on Line 90
10+
11+
.COMPANYNAME
12+
13+
.COPYRIGHT
14+
15+
.TAGS SQL, Ola Hallengren, Backup, Pester, Test, OVF
16+
17+
.LICENSEURI
18+
19+
.PROJECTURI
20+
21+
.ICONURI
22+
23+
.EXTERNALMODULEDEPENDENCIES sqlserver
24+
25+
.REQUIREDSCRIPTS Test-Ola
26+
27+
.EXTERNALSCRIPTDEPENDENCIES
28+
29+
.RELEASENOTES
30+
31+
#>
32+
# You will need to add the path to Test-Ola.ps1 on Line 90
233

334
function Test-OLAInstance
435
{

Test-SQLDefaults.ps1

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
<#
1+
<#PSScriptInfo
2+
3+
.VERSION 1.0
4+
5+
.GUID 730f1621-25a7-4503-886d-625695f1dd06
6+
7+
.AUTHOR Rob Sewell
8+
9+
.DESCRIPTION Function to run a series of Pester tests for SQL Defaults against a server or array of servers
10+
11+
.COMPANYNAME
12+
13+
.COPYRIGHT
14+
15+
.TAGS SQL, Pester, Defaults, SQL Server
16+
17+
.LICENSEURI
18+
19+
.PROJECTURI
20+
21+
.ICONURI
22+
23+
.EXTERNALMODULEDEPENDENCIES
24+
25+
.REQUIREDSCRIPTS
26+
27+
.EXTERNALSCRIPTDEPENDENCIES
28+
29+
.RELEASENOTES
30+
31+
#>
32+
<#
233
.Synopsis
334
Function to run a series of Pester tests for SQL Defaults against a server or array of servers
435
.DESCRIPTION

When-WillSQLComplete.ps1

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
<#
1+
<#PSScriptInfo
2+
3+
.VERSION 1.0
4+
5+
.GUID e113cd95-5822-4114-89c8-8293422b655a
6+
7+
.AUTHOR Rob Sewell
8+
9+
.DESCRIPTION Runs some t-sql to gather some information about requests from the sys.dm_exec_requests dmv to estimate the amount of time remaining for a statement which can be filtered by BACKUP,RESTORE,INDEX,DBCC,STATS commands
10+
11+
.COMPANYNAME
12+
13+
.COPYRIGHT
14+
15+
.TAGS SQL, Queries, Commands, Time, When Will SQL Complete
16+
17+
.LICENSEURI
18+
19+
.PROJECTURI
20+
21+
.ICONURI
22+
23+
.EXTERNALMODULEDEPENDENCIES
24+
25+
.REQUIREDSCRIPTS
26+
27+
.EXTERNALSCRIPTDEPENDENCIES
28+
29+
.RELEASENOTES
30+
31+
#>
32+
<#
233
.Synopsis
334
A quick function to estimate the completion time of a SQL Statement
435
.DESCRIPTION

0 commit comments

Comments
 (0)