• Install Chocolatey on Windows

    This post is a guide on installing the Chocolatey package manager on Windows by running a PowerShell command. Chocolatey allows you to manage software packages on your system with simple ‘choco’ commands. In this post after I install Chocolatey I’m installing a GUI to view all installed packages.…

    Read More


  • Disk Usage by Top Tables Report in SQL Server

    The Disk Usage by Top Tables Report in SQL Server is a quick way to get the sizes of all tables within a database. It’ll show all tables largest to smallest tables by total size on disk. If you notice that a database is growing larger in size,…

    Read More


  • Change Git Remote URL to SSH from HTTPS

    This post is a guide on how to change Git from using SSH to HTTPS for authentication. Using SSH for your version control system is more efficient as we do not have to enter a password every time we need to contact the remote repository. You should have…

    Read More


  • List all Tables & Columns in Redshift or Postgres

    If you need to list all tables and columns in Redshift or Postgres, this guide provides a SQL script to retrieve schema details across all databases. Redshift is based on (forked from) PostgreSQL, meaning many core SQL commands work similarly in both. However, Redshift introduces key differences, such…

    Read More


  • Creating a New User in Redshift and Promoting to Superuser

    This article provides a step-by-step demo for creating a new User in Redshift and promoting it to a Superuser. I’ll include useful tips, best practices, and links to AWS Docs to help streamline the process. In Amazon Redshift, a Superuser has the highest level of permissions, equivalent to…

    Read More


  • Drop Users in RedShift

    Dropping users in Amazon Redshift is a simple task, but sometimes you may encounter an error message if the user you are trying to drop is an owner of an object in the database, such as a schema, table, or view. When this happens, you will see one…

    Read More


  • Create a Test AWS RedShift Cluster

    Here’s a simple guide on creating a new AWS RedShift Cluster within a personal AWS test environment. Warning, if you’re testing this AWS Service you have to be rigorous with managing the cluster for billing reasons. I delete my cluster right after I’m done with it as you’ll…

    Read More


  • SQL Script: Get Last Backup Times in SQL Server

    Backing up databases is crucial for data protection in SQL Server, yet it’s surprising how often business-critical databases lack proper backups. When reviewing a new SQL Server instance, one of the first tasks is checking the last backup times to ensure recovery points are available before making any…

    Read More


  • Why use WHERE 1=1 in SQL Queries

    A common SQL question is, why would anyone use WHERE 1=1 in their queries? And what does it do? The WHERE 1=1 condition means WHERE TRUE. It returns the same query result as it would without the WHERE Clause. There is no impact on query execution time. This…

    Read More


  • Setting up SSH Keys in WSL

    Setting up SSH keys on Windows is generally done via OpenSSL or Putty. We can set this up and have quick authentication to places like GitHub or Bitbucket. But, we are also able to rely on a Linux distro in WSL for our SSH. If you are developing…

    Read More


Useful SQL DBA Posts

Performance & High Availability
– Get Full SQL Server System Info Fast
– Quick Performance Troubleshooting Scripts
Identify Missing & Unused Indexes
– Get Wait Stats & Top Consuming Queries
Get Exclusive Locks on Tables
Get Always On Availability Group (AAG) Latency
Get Mirroring Status & Latency
Get Replication Latency
Get Last Node Blip in SQL Server FCI
Security & Maintenance
Get Estimated Database Backup/Restore Time
Get Last Database Backup Dates/Times
– Get Database Sizes & Space Used
How to Get Table Sizes
Get Index & Heap Fragmentation Levels
Get SQL User Permissions and Roles
Creating SQL Users on Availability Groups
– Audit Failed Login Attempts

Tags

Always On Availability Groups (AAG) (4) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (76) Database Backups & Recovery (14) Database Mirroring (2) Deleting Data (1) Error Messages (5) Git Commands (5) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) PowerShell Scripts (1) SQL Server Agent (5) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (15) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (2) SQL Server Processes (5) SQL Server Replication (2) SQL Server Scripts (13) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (19)