Tag: Database Admin
-
How to Check Table Sizes in SQL Server
In this post, I’m sharing different ways of checking table sizes in SQL Server. There’s many ways to get this information, and whether you prefer using T-SQL scripts for automation, or SSMS tools for quick checks, these methods offer flexibility for different situations as a SQL Database Administrator.…
-
Drop Table if Exists in SQL Server
The DROP TABLE command in SQL Server removes a table from the database, as its name suggests. In this post, we’ll look at how to use the DROP TABLE IF EXISTS command, which makes dropping tables more efficient and error-free by adding a conditional check. Example: Drop Table…
-
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…
-
List All SQL Agent Jobs in SQL Server
This post provides a SQL script to list all SQL Server Agent Jobs on a Microsoft SQL Server instance. The sysjobs and sysjobsteps tables we are querying are in the M-S-D-B database. Fun fact, I am unable to publish a post with this actual database name without seeing…
-
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…
-
Get All 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…
-
Creating a Superuser in RedShift
In Amazon Redshift, a superuser has the highest level of permissions, equivalent to the master user created during cluster setup. Superuser access should only be granted in specific scenarios, such as local test environments or temporary infrastructures. In production environments, it’s best to follow the Principle of Least…
-
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…
-
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…
-
Creating a Linked Server with a MySQL Database
This is my 3rd Linked Server demo post, and this time it’s to a MySQL database. Noteworthy weblinks: > My Linked Server Blog Posts > Microsoft Docs – Linked Servers Here is a simple diagram of the setup in this post. The above was setup similar to what’s…
Recent Posts
- Why Is the Database in “In Recovery” Mode?
- How to View the Definition of a Stored Procedure
- SQL Script to Show Exclusive Locks on Tables
- How to Get SQL Server’s IP Address
- Identify Missing & Unused Indexes in SQL Server
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (3) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (73) Database Backups & Recovery (13) Database Mirroring (2) Deleting Data (1) Error Messages (4) 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 (4) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (14) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (1) 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)