Windows Commands for SQL database administrator


As a SQL database administrator, you may need to use some Windows commands to perform certain tasks related to managing the SQL Server. Here are some common Windows commands that may be useful: 

ipconfig:

ipconfig: display the IP configuration for all network adapters on the server

ipconfig /all: display detailed IP configuration for all network adapters, including DNS and DHCP information

ipconfig /renew: renew the IP address lease for all network adapters

ipconfig /release: release the IP address lease for all network adapters

ping:

ping <ip address>: check the connectivity to a specific IP address on the network

ping <hostname>: check the connectivity to a specific hostname on the network

ping -t <ip address>: continuously ping a specific IP address until stopped with Ctrl+C

ping -a <ip address>: resolve the IP address to its hostname

netstat:

netstat: display all active network connections and ports on the server

netstat -a: display all active network connections and listening ports

netstat -n: display all active network connections and ports in numerical format

netstat -o: display all active network connections and associated process IDs

tasklist:

tasklist: display all running processes on the server

tasklist /svc: display all running processes and their associated services

tasklist /fi "username eq SYSTEM": display all running processes under the SYSTEM account

tasklist /m <dll name>: display all processes that have loaded a specific DLL

sc:

sc query: display all services and their current status on the server

sc start <service name>: start a specific service on the server

sc stop <service name>: stop a specific service on the server

sc config <service name> start= <boot option>: configure a specific service to start automatically or manually

eventvwr:

eventvwr: open the Event Viewer and browse through system, security, and application logs

eventvwr /c:<log name>: open a specific event log, such as Application, Security, or System

eventvwr /f:<filename>: save a specific event log to a file in a specified format

diskpart:

diskpart: open the DiskPart command-line utility to manage disks and volumes on the server

list disk: display all disks available on the server

select disk <disk number>: select a specific disk to manage

list volume: display all volumes available on the server

select volume <volume number>: select a specific volume to manage

 

robocopy:

robocopy <source> <destination>: copy files and directories from the source to the destination, with options such as /mir, /move, /log, and /np

robocopy /l <source> <destination>: simulate a file copy operation without actually copying any files

robocopy /monitor <source> <destination>: monitor the source for changes and copy any changed files to the destination

powershell:

powershell: open the PowerShell console and execute PowerShell commands and scripts

Get-Process: display all running processes on the server

Get-Service: display all services and their current status on the server

Get-EventLog -LogName <log name>: display all events in a specific event log, such as Application, Security, or System

gpedit.msc:

gpedit.msc: open the Local Group Policy Editor and browse through various system settings and security policies

msinfo32:

msinfo32: open the System Information tool and display detailed information about the hardware and software on the server

firewall.cpl:

firewall.cpl: open the Windows

telnet:

telnet <hostname>: connect to a specific hostname on the network using Telnet

telnet <ip address>: connect to a specific IP address on the network using Telnet

telnet -a <hostname>: resolve the hostname to its IP address and connect using Telnet

telnet -e <escape character>: set the escape character used to exit Telnet

netgroup:

netgroup /domain <domain name>: display all groups in a specific domain

netgroup /l: display all local groups on the server

netgroup <group name>: display all members of a specific group

net user:

net user: display all user accounts on the server

net user <username>: display information about a specific user account

net user <username> /domain: display information about a specific user account in a specific domain

net user <username> <new password>: reset the password for a specific user account


lusrmgr.msc: open the Local Users and Groups management console, which is used to manage user accounts and groups on the server

secpol.msc: open the Local Security Policy editor, which is used to configure security settings on the server

Comments

Popular posts from this blog

Interview Questions on AOAG

All about SQL Server Execution Plan

Understanding SQL Server Patching: GDR versus CU