DBA Cheat Sheet

August 10, 2022 | Author: Anonymous | Category: N/A
Share Embed Donate


Short Description

Download DBA Cheat Sheet...

Description

 

DBA Cheat Sheet 

Server Info Hardware Info Database Info Recovery Model Backup   Backup Backup Restore Device SQL Agent obs !raining Info

Server Information Find SQL Server Version SELECT  SELECT  @@VERSION

Find SQL Server Versio Version n Information xp_msver

Find Server Properties SELECT SERVERPROPERTY ('productversion' ) AS  AS 'Product Version' ,SERVERPROPERTY SERVERPROPERTY   ('producteve' 'producteve') ) AS  AS 'Service P!c"' ,SERVERPROPERTY SERVERPROPERTY   ('edition' 'edition') ) AS  AS 'Edition' ,@@SERVERNA#E @@SERVERNA#E   As As $@@SERVERNA#E%  $@@SERVERNA#E% CAST( (SERVERPROPERTY SERVERPROPERTY( ('#AC&INENA#E' '#AC&INENA#E') ) AS AS   VARC&AR VARC&AR( ( )) ))   * COALESCE( COALESCE ('' ''   * ,CAST CAST( CAST (SERVERPROPERTY SERVERPROPERTY( ('INSTANCENA#E' 'INSTANCENA#E') ) AS  AS VARC&AR VARC&AR( ( )), )),   '' '') ) As  As  'Inst!nce N!+e'

Reference"

https://msdn.microsoft.com/en-us/library/ms!"#$%.asp&

Find Port 'umber for SQL Server Instances If you #ave $ore t#an one SQL instance on t#e server you%ll need to find t#e port nu$ber SQL Server is listening on& !#e default instance will be listening on port '())& spre!derroro-  .,  .,   , , N'Server is istenin- on' /O

Reference" https://social.msdn.microsoft.com/Forums/s(lserver/en-)S/*$b%$*+*-cbab"fe*-a,e+-+f"%,dbdd,/spreaderrorloforum0s(letstarted !op

Find 1ccount 2unnin SQL Server 1ent In SQL *++,-*++. 0ECLARE 0ECLARE @ServiceAccount  @ServiceAccount NVARC&AR NVARC&AR( ( )1 )1 E2EC  E2EC  +!ster3 +!ster 3d4o d4o3 35pre-re!d   '&6EYLOCAL#AC&INE' ,   'SYSTE#7CurrentControSet7services7S8LSERVERA/ENT' ,   'O49ectN!+e' 'O49ectN!+e', ,  @ServiceAccount O:TP:T1 O:TP:T 1 SELECT  @ServiceAccount1 SELECT @ServiceAccount 1

@sqlservermama

Page '

 

DBA Cheat Sheet 

In SQL *+'* and above SELECT    SELECT servicen!+e AS AS   'Service N!+e' ,service!ccount ,st!rtupt;pedesc AS AS   'St!rtup T;pe' ,st!tusdesc !s !s   'St!tus' ,!stst!rtupti+e !s !s   'L!st St!rtup Ti+e'
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF