Tag: Database Admin

Database Admin Blog Archives: Includes practical guides, troubleshooting strategies, and best practices, written by an experienced Microsoft SQL Server DBA.


  • Get Last Database Restore Date and Time in SQL Server

    This guide provides a script to retrieve the last restore date and time for each database in SQL Server. It’s particularly helpful for tracking restore operations or verifying backups during disaster recovery scenarios. The script below queries the sys.databases and dbo.restorehistory system tables to get the most recent…

    Read More


  • List All SQL Agent Jobs in SQL Server

    SQL Server Agent jobs are needed for automating tasks such as backups, index maintenance, and data processing. This post provides a SQL script to list all SQL Server Agent jobs on an instance, along with useful tips to help understanding. How to List SQL Agent jobs in SQL…

    Read More


  • How to Restore a Database in SQL Server

    Restoring a database in SQL Server is an essential task for any Database Administrator. Whether it’s part of a disaster recovery plan, setting up a test environment, or moving data between servers, you’ll likely restore databases countless times in your career. You can restore databases through the SQL…

    Read More


  • Get Database Sizes & Free Space Info In SQL Server

    Monitoring database file sizes and free space within data and log files is an important part of monitoring SQL Server health. This information, along with other metrics such as growth events, can help you to better predict and plan for future disk space provisioning needs. The following script…

    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


  • Creating a Linked Server with a MySQL Database

    This is my third Linked Server demo post, and this time, we’re connecting to a MySQL database. Here’s a simple diagram of the setup covered in this post, configuring a Linked Server to a MySQL Database: For this setup, I’ve covered it all in previous blog posts: –…

    Read More


  • Testing Connectivity to Remote Server Ports with PowerShell

    This post contains a demo for how to check if a port is open using PowerShell, whether you are on the latest or older versions of Windows. All admins need to know how to test connectivity to remote server ports. In fact, all software developers and other technical…

    Read More


  • How to Apply Force Encryption in SQL Server

    If you’re planning to allow external connections to a SQL Server, one of the first security measures to implement is encryption, both at rest and in transit. SQL Server provides an option to force encryption for all connections, ensuring secure SQL connectivity. This guide walks you through the…

    Read More


  • Include Execution Trace Messages in SQL Server Error Logs

    Execution trace messages in SQL Server Agent error logs can be helpful for diagnosing issues. This guide explains how to enable this option. Logs are always important if you’re supporting systems. The SQL Server Agent is used very often by DBA’s and Software Devs, so writing execution trace…

    Read More