Category: Backups & Recovery
-
DBA Scripts: Get Backup Chain Integrity
You can have a full backup from last night and still not be able to restore to 2pm today. That’s the gap this script closes. Backup coverage checks tell you when your last backups ran. They don’t tell you whether the log backups between them actually form an unbroken chain. A single missing or damaged…
Written by
-
DBA Scripts: Get Backup Restore Duration Estimate
This script is for planning, before a backup or restore starts: how long should you allow, from your own throughput history. If one is running right now and the question is how much longer it has, you want Get Backup and Restore Progress, which is a different script. The window opens at 22:00 and you…
Written by
-
DBA Scripts: Get Suspect Pages and Integrity Checks
Pages Already Recorded as Bad, and a Backup Check Before DBCC CHECKDB An 823 or 824 just landed in the error log, or DBCC CHECKDB is due and you want to know whether anything is already recorded against this server. Get-SuspectPages lists the pages SQL Server has already flagged as bad, and any row with…
Written by
-
SQL Server Recovery Models Explained
⚡If the log will not truncate, the database is almost certainly in Full recovery with no log backup running. Check log_reuse_wait_desc: LOG_BACKUP means back up the log, not shrink the file. Choosing a model is the same question from the other side (the comparison table): Full plus log backups for anything you would restore to…
Written by
-
Backing Up a SQL Server Database with Encryption
Encrypted backups are no longer optional in most environments. If backups leave the server, land on shared storage, or are retained long-term, unencrypted backups are a data leak waiting to happen. SQL Server has supported native backup encryption since SQL Server 2014 (MS Docs), but the mechanics still catch DBAs out, usually during a restore,…
Written by
-
How to Restore a Database in SQL Server
You have a .bak and a database to bring back, or a copy to stand up on another server. The restore itself is one statement, and what goes wrong is nearly always around it: file paths that do not exist on the new server, sessions holding the database, and checks nobody ran afterwards. This post…
Written by
-
Get Last Database Restore Date and Time in SQL Server
A database holds data nobody expected, a refresh is said to have run last night, or an audit wants to know when production was last overwritten. The first fact to pin down is when the database was last restored, and msdb records it for every database on the instance. This is not about backup schedules…
Written by
-
DBA Scripts: Get Backup Coverage
Most production SQL Server environments have backup jobs configured. The question that actually matters is whether those jobs are running, and succeeding, for every database that needs them. A database added last month might never have been folded into the backup plan. A job that’s been failing silently for weeks looks identical to a healthy…
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)