🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Three Kinds of Infrastructure Most Servers Never Had in the First Place A schema change or a new login fails on an inherited server and nothing in your own code explains it, an auditor asks what this instance records, or a SQL…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Check Certificate Expiry and TDE State A certificate is about to expire, a TDE restore has failed with Msg 33111, or someone needs to know which databases are encrypted. These scripts give you every certificate with its days left, the certificate behind…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security What’s Actually Happening at the Login Level, Not Just Who’s Allowed Permissions and Role Membership covers who can do what. These three scripts cover something different: what’s actually happening at the login layer right now. Get-FailedLoginSummary surfaces brute-force patterns and locked accounts…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Who Can Actually Do What, at Every Level Sysadmin Members answers the single highest-stakes question: who has unrestricted access. These 4 scripts answer everything underneath that: explicit object and schema grants inside a database, explicit server-level grants and denies on logins, database…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning Which Query Is the Problem CPU is pinned and you need the statement behind it. Get-TopCpuQueries ranks the plan cache by total CPU. The two scripts beside it rank the same cache by logical reads…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting “The database is slow” almost never means the whole database, it means one query, one plan, one statistic that went stale at the wrong moment. The scripts on this site cover the full path from “something feels slow” to a…
As a production SQL Server DBA, one of the fastest health checks I run on an Always On Availability Group is a latency check. AG latency is the delay between a transaction committing on the primary replica and that same transaction being hardened and redone on a secondary replica. If the secondary is behind, it…
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.In: Storage & Capacity Msg 9002 · Level 17 · State 2 The transaction log for database ‘YourDb’ is full due to ‘LOG_BACKUP’ and the holdup lsn is (44:264:1). ⚡Check log_reuse_wait_desc first: it names the actual blocker out of about a…
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.Related pillar: Backups and Recovery You try to connect to a database and get: Msg 924 · Level 14 · State 1 Database ‘YourDatabase’ is already open and can only have one user at a time. Single-user mode allows one connection,…
⚡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…