SQLIO测试 SAN

Downloading and Configuring SQLIO

SQLIO Video Tutorial: http://sqlserverpedia.com/wiki/SAN_Performance_Tuning_with_SQLIO

[Download SQLIO from Microsoft]

Notice that I said SQLIO, not SQLIOSIM. Experienced database administrators will often direct you to SQLIOSIM because it's easier to use and mimics SQL Server's disk activity patterns. Here's the catch: it won't necessarily test your SAN to its maximum potential. Your SAN team may indicate that if your SQLIOSIM results aren't fast enough, it's a SQL-related problem, not a SAN-related problem. They may use testing utilities from vendors that mimic results closer to what SQLIO will give you. We want to push the SAN's pedal to the metal and find out how fast it'll go in any situation.

After installing SQLIO, edit the param.txt file and change these two parameters:

  • First parameter - the physical location of the testing file. Change the drive letter to point to the SAN drive you want to test, like T:\testfile.dat.
  • Last parameter - the size of the testing file in megabytes. Increase this to 20480 or larger. Ideally, you want it to be larger than your SAN's cache, because your real databases will be larger than the SAN's cache.

After saving param.txt, run this at the command line in the same directory where SQLIO is installed in order to create the test file:

sqlio -kW -s10 -fsequential -o8 -b8 -LS -Fparam.txt timeout /T 10

When it finishes, your test file is created, and it's time to run our real tests.

Testing Your SAN Performance

Instead of picking and choosing individual parameters to use, I like to take the shotgun approach: try every possible combination of random versus sequential, low and high numbers of threads, read versus write, etc. The below batch file will take all of the possibilities and run 'em all. Copy/paste this into a text file called SANTest.bat:

sqlio -kW -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kW -t4 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kW -t8 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kW -t16 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kW -t32 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kW -t64 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kR -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kR -t4 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kR -t8 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kR -t16 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kR -t32 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kR -t64 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o2 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o4 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o8 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o16 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o32 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o64 -frandom -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o128 -frandom -b64 -BH -LS Testfile.dat



sqlio -kW -t2 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t2 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kW -t4 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t4 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kW -t8 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t8 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kW -t16 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t16 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kW -t32 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t32 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kW -t64 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kW -t64 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kR -t2 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t2 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kR -t4 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t4 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kR -t8 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t8 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kR -t16 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t16 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kR -t32 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t32 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat



sqlio -kR -t64 -s120 -dM -o1 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o2 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o4 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o8 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o16 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o32 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o64 -fsequential -b64 -BH -LS Testfile.dat

sqlio -kR -t64 -s120 -dM -o128 -fsequential -b64 -BH -LS Testfile.dat

Whew! And that's just one pass - if you want to do multiple passes of the same tests for consistency's sake, like to eliminate the chance that other servers are running on the same SAN and affecting your performance results, you would want to paste that same set of 200+ lines multiple times into your batch file.

Let's take the first line of the batch file and analyze what it's doing:

sqlio -kW -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat

The most important parameters are:

  • -kW means writes (as opposed to reads)
  • -t2 means two threads
  • -s120 means test for 120 seconds
  • -dM means drive letter M
  • -o1 means one outstanding request (not piling up requests)
  • -frandom means random access (as opposed to sequential)
  • -b64 means 64kb IOs

Do a find & replace in your text file and replace -dM with the drive letter of your choice. If you're testing on your S drive, for example, you would replace -dM with -dS.

Then go to the command prompt in the same directory as SQLIO is installed and type:

SANTEST.BAT > RESULTS.TXT

This will run our newly created batch file and dump the results into a text file. This will take a long time, like six hours or more, and it will be hammering your SAN. Don't run this on a production server, and don't even run it on the same SAN as a production server when the production server is under load because it may time out. I've had instances where this batch file has actually caused a SAN to restart itself, so use this with caution - preferably in a test lab or before your SAN goes live.

Hours later, when it finishes, you'll have a RESULTS.TXT file with lots of juicy metrics about your storage performance.

Importing SQLIO Results into SQL Server

Those text file results are cryptic - time to bring them into our favorite data analysis platform, Microsoft Access. Wait, I'm kidding, put the axe down - we'll import them into SQL Server.

Script to Create the Tables and and ETL Stored Procedure

Before we start, create a database that you'll use for SQLIO data storage or designate an existing utility database that you'll use. This script requires SQL Server 2005 or newer, since it uses the varchar(max) field.

In that database, run the below script to create the tables for results storage:

001. SET ANSI_NULLS ON
002. GO
003. SET QUOTED_IDENTIFIER ON
004. GO
005. CREATE TABLE [dbo].[SQLIO_Import](
006. [RowID] [intIDENTITY(1,1) NOT NULL,
007. [ParameterRowID] [intNULL,
008. [ResultText] [varchar](max) NULL,
009. CONSTRAINT [PK_SQLIO_Import] PRIMARY KEY CLUSTERED
010. (
011. [RowID] ASC
012. ))
013. GO
014. CREATE TABLE [dbo].[SQLIO_TestPass](
015. [TestPassID] [intIDENTITY(1,1) NOT NULL,
016. [ServerName] [nvarchar](50) NOT NULL,
017. [DriveQty] [intNOT NULL,
018. [DriveRPM] [intNOT NULL,
019. [DriveRaidLevel] [nvarchar](10) NOT NULL,
020. [TestDate] [datetimeNOT NULL,
021. [SANmodel] [nvarchar](50) NOT NULL,
022. [SANfirmware] [nvarchar](50) NULL,
023. [PartitionOffset] [intNULL,
024. [Filesystem] [nvarchar](50) NULL,
025. [FSClusterSizeBytes] [intNULL,
026. [SQLIO_Version] [nvarchar](20) NULL,
027. [Threads] [intNULL,
028. [ReadOrWrite] [nchar](1) NULL,
029. [DurationSeconds] [intNULL,
030. [SectorSizeKB] [intNULL,
031. [IOpattern] [nvarchar](50) NULL,
032. [IOsOutstanding] [intNULL,
033. [Buffering] [nvarchar](50) NULL,
034. [FileSizeMB] [intNULL,
035. [IOs_Sec] [decimal](18, 0) NULL,
036. [MBs_Sec] [decimal](18, 0) NULL,
037. [LatencyMS_Min] [intNULL,
038. [LatencyMS_Avg] [intNULL,
039. [LatencyMS_Max] [intNULL,
040. CONSTRAINT [PK_SQLIO_TestPass] PRIMARY KEY CLUSTERED
041. (
042. [TestPassID] ASC
043. ))
044. GO
045.  
046. CREATE PROCEDURE [dbo].[USP_Import_SQLIO_TestPass]
047. @ServerName         NVARCHAR(50),
048. @DriveQty           INT,
049. @DriveRPM           INT,
050. @DriveRaidLevel     NVARCHAR(10),
051. @TestDate           DATETIME,
052. @SANmodel           NVARCHAR(50),
053. @SANfirmware        NVARCHAR(50),
054. @PartitionOffset    INT,
055. @Filesystem         NVARCHAR(50),
056. @FSClusterSizeBytes INT
057. AS
058. SET nocount off
059.  
060. IF @TestDate IS NULL
061. SET @TestDate = Getdate()
062.  
063. /* Add a blank record to the end so the last test result is captured */
064. INSERT INTO dbo.SQLIO_Import
065. (ParameterRowID,
066. ResultText)
067. VALUES
068. (0,
069. '');
070.  
071. /* Update the ParameterRowID field for easier querying */
072. UPDATE dbo.sqlio_import
073. SET    parameterrowid = (SELECT   TOP 1 rowid
074. FROM     dbo.sqlio_import parm
075. WHERE    parm.resulttext LIKE '%\%'
076. AND parm.rowid <= upd.rowid
077. ORDER BY rowid DESC)
078. FROM   dbo.sqlio_import upd
079.  
080. /* Add new SQLIO_TestPass records from SQLIO_Import */
081. INSERT INTO dbo.sqlio_testpass
082. (servername,
083. driveqty,
084. driverpm,
085. driveraidlevel,
086. testdate,
087. sanmodel,
088. sanfirmware,
089. partitionoffset,
090. filesystem,
091. fsclustersizebytes,
092. sqlio_version,
093. threads,
094. readorwrite,
095. durationseconds,
096. sectorsizekb,
097. iopattern,
098. iosoutstanding,
099. buffering,
100. filesizemb,
101. ios_sec,
102. mbs_sec,
103. latencyms_min,
104. latencyms_avg,
105. latencyms_max)
106. SELECT   @ServerName,
107. @DriveQty,
108. @DriveRPM

你可能感兴趣的:(sql)