Some useful windows command for SQL DBAs


Finding Uptime

systeminfo | find /i "Boot Time"
System Boot Time:          14/12/2017, 7:48:04 AM

Cluster Command

cluster resource /status
cluster node /status
cluster group /status


Finding Processor Info

for the total number of cores
echo %NUMBER_OF_PROCESSORS%
Go to RUN --> msinfo32


Finding Memory Info

Windows Cmd:
wmic ComputerSystem get TotalPhysicalMemory && wmic OS get FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory
Results will be in bytes


Powershell Cmd:
(Get-WMIObject Win32_PhysicalMemory |  Measure-Object Capacity -Sum).sum/1GB

For Remoting:
For ($x in serverlist.txt){ $colItems = get-wmiobject -class "Win32_ComputerSystem" -computername $x foreach ($objItem in $colItems){ $displayGB = [math]::round($objItem.TotalPhysicalMemory/1024/1024/1024, 0) write-host "Total Physical Memory: " $displayGB "GB" write-host "Model: " $objItem.Model } $colItems = get-wmiobject -class "Win32_Processor" -computername $x foreach ($objItem in $colItems){ write-host "System Name: " $objItem.SystemName }}

Open SSMS as a different windows login 


C:\windows\system32>runas.exe /noprofile /env /user:pcname\mirroruser ssms.exe

Comments

Popular posts from this blog

Log is not getting shipped in SQL Server Logshipping

SQL Loader with dynamic control file generation

Oracle Job Operations