Если Вы готовы преобразовать в PowerShell, это намного легче сделать. Это мой"Elevate-Process.ps1
"сценарий (с su
как искажают в моем профиле):
# Updated elevate function that does not need Elevate PowerToys
# From http://devhawk.net/2008/11/08/My+ElevateProcess+Script.aspx
$psi = new-object System.Diagnostics.ProcessStartInfo
$psi.Verb = "runas"
# If passed multiple commands, or one (that isn't a folder) then execute that command:
if (($args.Length -gt 1) -or (($args.length -eq 1) -and -not (test-path $args[0] -pathType Container))) {
$file, [string]$arguments = $args;
$psi.FileName = $file
$psi.Arguments = $arguments
[System.Diagnostics.Process]::Start($psi) | out-null
return
}
# If from console host, handle case of one argyment that is
# a folder, to start in that folder. Otherwise start in current folder.
if ($host.Name -eq 'ConsoleHost') {
$psi.FileName = (Get-Command -name "PowerShell").Definition
if ($args.length -eq 0) {
$psi.Arguments = "-NoExit -Command &{set-location '" + (get-location).Path + "'}"
} else {
$psi.Arguments = "-NoExit -Command &{set-location '" + (resolve-path $args[0]) + "'}"
}
[System.Diagnostics.Process]::Start($psi) | out-null
return
}
# Otherwise this is some other host (which cannot be assumed to take parameters).
# So simplely launch elevated.
$psi.FileName = [system.diagnostics.process]::getcurrentprocess().path
$psi.Arguments = ""
[System.Diagnostics.Process]::Start($psi) | out-null
Обнаружение того, чтобы быть поднятым может также быть сделано в PSH (таким образом, можно проверить на повышение и затем поднять в случае необходимости):
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
if ($IsAdmin) {
$host.UI.RawUI.Foregroundcolor="Red"
write-host "`n** Elevated Session **`n" -foreground $_errorColour -background $_errorBackound
}
Я, оказывается, выполняю производство SQL Server 2008 R2 сверху Windows Server 2008 R2 сверху XenServer 5.6 fp1 сверху HP DL580 с парой SAS в конфигурации RAID1.
Загрузка базы данных является приблизительно 100-200 tpm. Никакой обнаруживаемый хит производительности.
В том поле существует 2 других VMs: Сервер ArcServe (хранилище данных указало на SAN IBM DS по GbE iSCSI), и Почтовый сервер подготовки (hMailServer, скоро для замены нашего более старого и нестабильного Меркурия/32).
Я думаю, что единственный способ узнать будет состоять в том, чтобы проверить его. Узнайте, сколько IOPS Ваш RAID5 способен, и в каком количестве IOPS Ваша база данных нуждается.
О, и дайте Вашему VM много RAM. Здоровая сумма кэша помогает.