Batch FIM exemple section dans un batch, choix par clavier…

@ECHO OFF

:menu

set sqliopath=

set datavolumereport=

set logvolumereport=

set tempdbvolumereport=

set datavolume=

set logvolume=

set tempdbvolume=

set logfilesize=

ECHO.

ECHO ===================================================================

ECHO         SQLIO Test of Disk Subsystem for FIM 2010 WARNINGS

ECHO ===================================================================

ECHO.

ECHO   [!] You must run this test using an account that has read and write

ECHO       permissions to the volume to be tested. You may have to run the

ECHO       test using elevated permissions (Run as administrator).

ECHO   [!] The volume to be tested should not have drive compression or

ECHO       drive indexing enabled.

ECHO   [!] The volume to be tested and SQLIO.EXE should be excluded from

ECHO       virus scanning during testing.

ECHO   [!] SQLIO.EXE should be excluded from Data Execution Prevention

ECHO       (DEP) during testing.

ECHO   [!] There should be at least enough free disk space to create the

ECHO       test file. A fragment free or recently formatted volume is best.

ECHO   [!] Any other programs, services, or processes using the volume to

ECHO       be tested will negatively affect the results of the test.

ECHO   [!] These tests will negatively affect the performance of any other

ECHO       programs, services, or processes using the volume to be tested.

ECHO.

pause

ECHO ===================================================================

ECHO           SQLIO Test of Disk Subsystem for FIM 2010

ECHO ===================================================================

ECHO.

ECHO   Press the number of the performance test would you like to run

ECHO.

ECHO       1 – test the SQL Server data volume

ECHO       2 – test the SQL Server log volume

ECHO       3 – test the SQL Server temporary database (TempDB) volume

ECHO       4 – exit to command prompt

ECHO.

ECHO   and then press ENTER

ECHO.

ECHO.

ECHO ===================================================================

ECHO.

:choice

set /p C=Press 1, 2, 3, or 4:

if « %C% »== »4 » goto end

if « %C% »== »3 » goto section3

if « %C% »== »2 » goto section2

if « %C% »== »1 » goto section1

goto choice

 

:section1

CLS

ECHO Section 1 – Data volume testing

ECHO On Windows Server 2008 R2, the default installation path for SQLIO is

ECHO C:\Program Files (x86)\SQLIO. Type the installation path to SQLIO

ECHO or press ENTER to use C:\Program Files (x86)\SQLIO

ECHO WARNING: DO NOT ENTER A TRAILING BACKSLASH AND ENCLOSE PATH NAMES THAT INCLUDE SPACES WITH QUOTATION MARKS

set /p sqliopath= The SQLIO path is:

If « %sqliopath% »== » » set sqliopath= »C:\program files (x86)\SQLIO »

ECHO.

ECHO Type the path to the folder in which you want to store these test reports or

ECHO press ENTER to store report files in C:\Program Files (x86)\SQLIO

ECHO WARNING: DO NOT ENTER A TRAILING BACKSLASH AND ENCLOSE PATH NAMES THAT INCLUDE SPACES WITH QUOTATION MARKS

set /p datavolumereport= The folder to store the data volume report is:

If « %datavolumereport% »== » » set datavolumereport= »C:\program files (x86)\SQLIO »

ECHO.

ECHO Type the volume letter of the volume you want to test.

ECHO after the volume letter and then press ENTER.

ECHO Or press ENTER to accept default of C.

ECHO WARNING: DO NOT ENTER A TRAILING COLON (:) or BACKSLASH

set /p datavolume= Volume letter (only):

If « %datavolume% »== » » set datavolume=C

ECHO.

ECHO Type the data file size in MB that you want to test on the target volume and press ENTER.

ECHO Or press ENTER to accept default of 5 GB (5120 MB).

ECHO WARNING: ENTER THE NUMBER ONLY; DO NOT ADD MB to the end.

set /p datafilesize= Number of MB (number only):

If « %datafilesize% »== » » set datafilesize=5120

CLS

 

ECHO ===================================================================

ECHO %datavolume%: data volume testing started at %time% on %date%.

ECHO ===================================================================

ECHO.

ECHO SQLIO is located at %sqliopath%

ECHO.

ECHO Reports will be sent to %datavolumereport%

ECHO.

ECHO ===================================================================>> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO %datavolume%: data volume write testing started at %time% on %date% >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO ===================================================================>> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO random 5 k Writes 1 thread to %datavolume%: data volume running

ECHO %datavolume%:\datafile.dat 1 0x00 %datafilesize% > %datavolumereport%\datafileparam.txt

ECHO %sqliopath%\sqlio -kW -s300 -t1 -o1 -frandom -b5 -BH -LS %datavolume%:\TestFile1.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

%sqliopath%\sqlio -kW -s300 -t1 -o1 -frandom -b5 -BH -LS -d%datavolume% -F%datavolumereport%\datafileparam.txt datafile.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO %sqliopath%\sqlio -kW -s300 -t1 -o4 -frandom -b5 -BH -LS %datavolume%:\TestFile1.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

%sqliopath%\sqlio -kW -s300 -t1 -o4 -frandom -b5 -BH -LS -d%datavolume% -F%datavolumereport%\datafileparam.txt datafile.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO %sqliopath%\sqlio -kW -s300 -t1 -o16 -frandom -b5 -BH -LS %datavolume%:\TestFile1.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

%sqliopath%\sqlio -kW -s300 -t1 -o16 -frandom -b5 -BH -LS -d%datavolume% -F%datavolumereport%\datafileparam.txt datafile.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO %sqliopath%\sqlio -kW -s300 -t1 -o32 -frandom -b5 -BH -LS %datavolume%:\TestFile1.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

%sqliopath%\sqlio -kW -s300 -t1 -o32 -frandom -b5 -BH -LS -d%datavolume% -F%datavolumereport%\datafileparam.txt datafile.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

ECHO random 5 k Writes 1 thread to %datavolume%: data volume completed

 

timeout /T 5

 

ECHO random 5 k Writes 4 threads to %datavolume%: data volume running

ECHO %datavolume%:\datafile.dat 4 0x00 %datafilesize% > %datavolumereport%\datafileparam.txt

ECHO %sqliopath%\sqlio -kW -s300 -t4 -o1 -frandom -b5 -BH -LS -d%datavolume% -F%datavolumereport%\datafileparam.txt datafile.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

%sqliopath%\sqlio -kW -s300 -t4 -o1 -frandom -b5 -BH -LS -d%datavolume% -F%datavolumereport%\datafileparam.txt datafile.dat >> %datavolumereport%\FIMSQLIO-Report-DataVolume.txt

Laisser un commentaire