Converted into a module: https://github.com/tcartwright/tcdbtools
PS Gallery link: https://www.powershellgallery.com/packages/tcdbtools/
Converted into a module: https://github.com/tcartwright/tcdbtools
PS Gallery link: https://www.powershellgallery.com/packages/tcdbtools/
DECLARE @Sql VARCHAR(MAX) = ( | |
SELECT 'DBCC FREEPROCCACHE (0x' + CONVERT( VARCHAR(MAX), [ecp].[plan_handle], 2) + ') WITH NO_INFOMSGS; ' + CHAR(10) | |
FROM [sys].[dm_exec_cached_plans] [ecp] | |
WHERE [ecp].[usecounts] = 1 | |
AND [ecp].[objtype] IN('Adhoc', 'Prepared') | |
FOR XML PATH('') | |
); | |
SELECT @sql | |
--EXEC (@sql) |
@rem resources | |
@rem http://www.brentozar.com/archive/2008/09/finding-your-san-bottlenecks-with-sqlio/ | |
@rem http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20163 | |
@rem START MODIFICATION AREA START | |
@rem change the drive letter to match the desired drive to test | |
@set testfile=c:\testfile.dat | |
@rem change the number to the number of gb's to test with, this should be roughly the same size as your db | |
@set size=20 | |
@rem the number of threads to use for the test |
@echo on | |
@setlocal EnableDelayedExpansion | |
@set ps=%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile | |
%ps% -File "%~dp0Get Local DB Info.ps1" | |
@echo. | |
@pause |
@echo OFF | |
@setlocal ENABLEEXTENSIONS | |
@REM Author: Tim Cartwright | |
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" | |
@rem https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396#net_d | |
@echo. |
@rem bat file to ease use of the split script | |
@%~d0 | |
@cd "%~dp0" | |
powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -file "%~dp0Generate Security.ps1" -OutPutFile "%~dp0Security.sql" | |
@echo Done. | |
@pause |
Converted into a module: https://github.com/tcartwright/tcdbtools
PS Gallery link: https://www.powershellgallery.com/packages/tcdbtools/