Skip to content

Clive Roberts

SQL Server DBA

Menu
  • Setup
  • Performance
  • Health Check
  • Troubleshooting
  • T-SQL
  • Handbook
  • Patches
  • News

SQL Server DBA Handbook

91 chapters from my SQL Server DBA handbook: tested procedures and scripts for setting up, running, tuning and troubleshooting SQL Server.

Setup, backup and high availability

  • Backing Up and Restoring a Database
  • Restoring a Full Database Backup (SSMS)
  • Restoring a Database to a New Location
  • Backup and Restore with T-SQL
  • Disaster Recovery Planning
  • Basic vs Advanced High Availability
  • Adding a Database to an Availability Group
  • Suspending and Resuming Data Movement
  • Availability Group Health Troubleshooting
  • Quorum Failure
  • Log Shipping
  • Database Mail Setup and Troubleshooting
  • Moving TempDB
  • Database Snapshots
  • Server Build Checklist
  • Encryption
  • TDE: Backing Up the Certificate
  • Data Obfuscation and Masking
  • SQL Server Audit
  • FILESTREAM
  • Orphaned SQL Logins
  • Replicating SQL Server Logins with Their SIDs
  • Login Failures (Error 18456)
  • Random Password Generator
  • Generating the SPNs (Kerberos)
  • SQL Server Replication: Setup, Types and Pitfalls
  • Adding an Article to a Publication
  • Enabling Change Tracking: Good and Bad Points
  • Migrating a Reporting Services Installation (Native Mode)
  • Upgrading SSRS 2005 to 2012 (Quick and Dirty)
  • Azure SQL Options
  • Migrating SQL Server to Azure
  • Building an Availability Group
  • Failover Cluster Instances and Distributed Availability Groups
  • Backup to URL and Backup Encryption
  • PowerShell and dbatools
  • SQL Server Trace Flags

Performance

  • Database Performance Tuning and Index Strategy
  • Data Compression
  • Forwarded Records
  • NUMA
  • Common Memory Issues
  • Average Write Performance
  • Stress Testing the I/O Subsystem with SQLIO
  • When the SQL Server Cache Needs to Be Cleared
  • Parameter Sniffing
  • Table Partitioning
  • Resource Governor
  • What Happens During a Data Change: Buffer Pool, Write-Ahead Log and Durability
  • Measuring Query Performance and Taking a Baseline
  • Reading Execution Plans
  • Plan Caching and Parameterization
  • Statistics Problem or Caching Problem?

Troubleshooting

  • Database Suspect, Recovery Pending or Stuck Recovering
  • Shrinking Databases
  • Transaction Log Full
  • Data File Full and Disk Space (Error 1105)
  • Shrinking Transaction Logs
  • Stopping a Running Job in Job Activity Monitor
  • Failed SQL Agent Job Triage
  • Single-User Mode
  • Tempdb Full or Contention
  • Repairing the WMI Provider (mofcomp)
  • SQL Server Referencing the Wrong Disk Drives
  • Performance Troubleshooting Queries
  • High CPU Troubleshooting
  • SQL Locks
  • SQL Server Error Numbers
  • Monitoring Deadlocks
  • Sleeping Processes
  • DMVs and Session Monitoring
  • Collecting Data with Performance Monitor
  • Collecting a Trace with SQL Profiler
  • Schema Locks and Online Index Maintenance

T-SQL

  • SQL Best Practices
  • T-SQL Coding Conventions and Programming Guidelines
  • Common Table Expressions (CTEs)
  • CROSS APPLY and OUTER APPLY
  • Exporting Data to a File
  • SET IDENTITY_INSERT
  • OPENQUERY with Linked Servers
  • Service Broker in SQL Server
  • Enabling and Resetting Service Broker
  • Change Data Capture (CDC)
  • Extended Events
  • Temporal Tables
  • DDL and DML Audit Triggers
  • Transaction Modes: Autocommit, Explicit and Implicit
  • Error Handling in Transactions: TRY/CATCH, @@TRANCOUNT and XACT_STATE()
  • Read Consistency: Read Committed, RCSI and Snapshot Isolation
  • T-SQL Performance Anti-Patterns

Sidebar

  • SQL Server DBA Handbook (91)
  • Handbook, news and patches (121)
  • Regain sysadmin access (1)
  • Kill SQL processes (1)
  • Configure MSDB (13)
  • TempDB in use (1)
  • Connected to SQL (1)
  • Move backups (2)
  • VLF details (1)
  • Config Manager error (1)
  • Fill factor (1)
  • Missing indexes (1)
  • Number of cores (1)
  • DBCC CHECKDB (1)
  • Wait times (7)
  • Tail-log backup (1)
  • STUFF function (6)
  • Blocking and deadlocks (2)
  • Locking hints (2)
  • Errors 823, 824, 825 (1)
  • DBCC commands (1)
  • Transaction counts (1)
  • Database details (1)
  • Replication (1)
  • Find jobs (1)
  • Backup progress (1)
  • Pivot table (1)
  • Replication objects (1)
  • Tables with no PK (1)
  • Who dropped the database (1)
  • last_value (1)
  • Parse XML (1)
  • Search a string (1)
  • DATETIME difference (1)
  • Error 3707 (1)
  • SHRINKDATABASE (1)
  • Express backup (1)
  • Enable xp_cmdshell (1)
  • Output a file (1)
  • Start of the month (1)
  • Setup
  • Performance
  • Health Check
  • Troubleshooting
  • T-SQL
  • Handbook
  • Patches
  • News

Precious Lite 2025 | All Rights Reserved. Precious Lite theme by Flythemes