Category: Archive
-

AlwaysOn : Manually add a new replica node using a custom backup path with custom credentials
SQL Server Management Studio’s AlwaysOn Availability Groups wizard covers most common scenarios well — but it has a significant limitation: it cannot impersonate a custom user to access a remote backup path with non-default credentials. When your backup share requires a specific domain account or a custom username/password combination, you need to perform the initial…
-

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…
-

How to improve mysql performance using CACHING
Before diving into a deep performance investigation — wait stats, execution plans, I/O benchmarks — it’s worth checking whether a simple configuration oversight is behind the problem. One of the most common and highest-impact quick wins in MySQL is query cache sizing. A cache that’s disabled, too small, or incorrectly sized can account for a…
-

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…
-

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…
-

Massive Database Migration between SQL Server instances: the complete procedure v.2.0 *UPDATED*
A complete T-SQL based procedure to migrate SQL Server instances — including logins, databases, and file relocations — with no external tools required. Changelog (05/04/2014) Added compression to reduce bandwidth, space and transfer time Reduced stat value for very large databases Added backup type parameter: FULL, FULL_COPYONLY or DIFFERENTIAL Added Maxtransfersize and Buffercount parameters to…