Tag: Database
-

Using Claude Code for Linux Server Administration: A Practical, Supervised Approach
Claude Code for Linux server administration: Claude Code is the command-line tool developed by Anthropic that allows a large language model (LLM) to interact directly with the filesystem, execute shell commands, read and modify files, and manage services, containers, and configurations. This is not a chatbot that suggests commands: it is an agent that executes…
-

Recover a database with a DAMAGED and/or LOST log file
A corrupted or missing transaction log file is one of the most stressful situations a DBA can face. The first instinct is to restore from the last full backup — but depending on the circumstances, SQL Server offers faster recovery paths that minimize both downtime and data loss. This article walks through the two main…
-

How to script logins with the original password HASH and original SID
When migrating SQL Server instances, one of the most error-prone steps is transferring SQL logins to the destination. Simply scripting a login with CREATE LOGIN … WITH PASSWORD won’t preserve the original password hash or the original SID — and mismatched SIDs between instance logins and database users will break application connectivity even if the…
-

Massive SQL Server Database Moving Using Detach – Attach: The Complete Procedure
Moving SQL Server databases to a new volume — whether to rebalance I/O across storage, migrate to faster disks, or reclaim space — requires a methodical approach to avoid downtime surprises. The detach/attach method is the fastest option when you can afford a brief offline window: no backup involved, no network transfer overhead. This metascript…
-

How to make your databases smaller and faster: find unused indexes
Indexes are one of the most powerful performance tools in SQL Server — and one of the most overlooked sources of overhead. Every index you create must be maintained on every INSERT, UPDATE, and DELETE operation. Unused indexes cost you disk space, backup time, memory, and write performance, without providing any read benefit. Finding and…
-

Analyze SQL Server database historical growth: MONTLY size changes
When the daily backup history is too granular for a high-level capacity planning overview, a monthly view gives a cleaner picture of long-term growth trends. This query aggregates backup data from msdb..backupset by month, taking the peak size reached in each month to calculate the net monthly change. This complements the daily report: use the…
-

Analyze SQL Server database historical growth: DAILY size changes
Capacity planning starts with understanding how your databases grow over time. The simplest source of historical size data in SQL Server is the backup catalog: msdb..backupset records information about every backup taken on the instance. If you don’t have a dedicated monitoring tool, this is a reliable starting point. Two important caveats before using this…