T-SQL to create a SQL Server Database Inventory

Problem I had to work on Inventory Management System and log details for various SQL instances in my support. The old way to do that was to log into every instance check the details and copy paste that into excel. Well I am a lazy person and I had to find an easier way to … Continue reading T-SQL to create a SQL Server Database Inventory

Determine the last database backup in SQL Server with T-SQL

Problem: T-SQL code to obtain the last database backup time, the last backup location, the last backup size and check if the file exists on the disk or not. Note: Result will only include database backups that were taken on disk. SELECT A.[Server], A.database_name, A.last_db_backup_date, B.backup_size/1024/1024 as backup_size, B.physical_device_name , 'Yes' as 'file_exists' into dbo.##BackupReport … Continue reading Determine the last database backup in SQL Server with T-SQL

SQL Server In-Place Upgrade Failed – Wait on the Database Engine Recovery Handle Failed

Issue Few weeks ago I was performing an in-place upgrade from SQL Server 2014 to SQL Server 2017. I followed each and every pre-check before performing an in-place upgrade, but got this error message at the end of the installation: The following error has occurred: Wait on the Database Engine recovery handle failed. Check the … Continue reading SQL Server In-Place Upgrade Failed – Wait on the Database Engine Recovery Handle Failed

Online Data Migration from SQL Server to Cloud Spanner using Striim

This post will focus on the implementation of a continuous migration from SQL Server to Cloud Spanner using Striim. The explanation will include steps for configuring and initial load and a continuous data replication using Change Data Capture. this is enablement post and doesn't talk about a full scale database migration and its challenges. This … Continue reading Online Data Migration from SQL Server to Cloud Spanner using Striim

Running SQL Server 2019 on Google Kubernetes Engine

Have you tried to run a SQL Server deployment on Google Kubernetes Engine yet? Here is a complete guide to create and run SQL Server 2019 on GKE. You will be creating the following resources to successfully host SQL Server on GKE. A namespace to host resources for SQL Server deploymentA secret for 'sa' accountPersistent … Continue reading Running SQL Server 2019 on Google Kubernetes Engine

SQL Server Distributed Availability Group with forwarder in Microsoft Azure

Architecture Diagram To create a distributed availability group, you need two availability groups each with its own listener. You then combine these availability groups into a distributed availability group. In this case one availability group is on-premises and other needs to be created on Microsoft Azure. This example doesn't cover all of the details like, … Continue reading SQL Server Distributed Availability Group with forwarder in Microsoft Azure

T-SQL to script out logins and permissions of all databases

T-SQL to script out logins and passwords for the SQL server instance. Can be useful for taking backups for your logins and DB permissions and can also be useful for migrating logins and permissions. Note: In SSMS, check the “Maximum number of characters displayed in each column” settings before executing the below script. It is defaulted … Continue reading T-SQL to script out logins and permissions of all databases

SQL Server Storage Review using PowerShell

Problem There's no doubt that storage is one of the key components to SQL Server performance and availability for both large and small SQL Server instances. With today's increases in server and virtual server processing power and large-scale memory support, storage and I/O can easily become the bottleneck for overall system throughput. To gain the … Continue reading SQL Server Storage Review using PowerShell

SQL Server Security review using PowerShell

Problem How often do we do Security Reviews for your SQL Server Instances? We aim to stay on top of security and to be able to so we need to regularly review your Instance security configurations. It’s helpful to build a checklist to be used as part of an internal security audit review, and follow that checklist every time you conduct … Continue reading SQL Server Security review using PowerShell