Tag: Script Library

sql server backup files are needed

How Often Should I Test My SQL Server Backups?

“People don’t want to buy a quarter-inch drill. They want a quarter-inch hole!” In the world of databases, stakeholders don’t care about SQL backups. They care about the ability to restore a SQL database.

Who Owners Your SQL Server Database and how to change it

Who’s the SQL Server Database Owner and How Can You Change It?

In SQL Server, when someone creates a database, they own it. That means they have elevated permissions on the database. The SQL Server database owner can change configuration parameters, perform maintenance, and grant permissions on the database to other users. The database owner can even drop the database altogether. In highly secure environments (and what…
Read more

CHECKDB is a critical for Database Integrity

When Was the Last Known Good DBCC CHECKDB Integrity Check?

Fortunately, DBCC CHECKDB will log each time it completes without finding any errors or corruption in the database. That’s known as the Last Known Good date. Let’s look at three ways you determine the Last Known Good date. We’ll use a T-SQL query, a PowerShell command with dbatools, and the SQL Server Logs via Management Studio.

Let's count the number of SQL Server tempdb files I have

3 Ways to Find Your SQL Server tempdb Data Files

Checking the number of tempdb data files is straightforward. Here are three easy ways: one graphical, one T-SQL, and one PowerShell, so you can use your tools of choice.

A properly configured SQL Server is like a well tuned race engine.

Identify Disk I/O Performance Issues for Your SQL Server Using DiskSpd

“We need faster storage.” Sound familiar? Or what about “No, the storage is good; we need to tune the database.” Often teams will have very different opinions about the root cause of a performance issue. Microsoft’s free DiskSpd utility can help identify disk I/O performance issues for your SQL server systems. Here’s a short introduction…
Read more

Am I affected by MrbMiner malware?

SQL Server hardware can be powerful. Lots of CPU cores and memory. Just what a crypto miner may need in their quest to generate cryptocurrency. In the case of the MrbMiner exploit, numerous SQL Servers have been exploited with brute-force attacks. These attacks are scanning for servers exposed directly to the internet and are using…
Read more

Vollgar: 6 Scripts to Help Review Your SQL Servers

Last week, Guardicore released information about a newly discovered attack that uses SQL Servers to compromise servers and networks. Here’s a link; I’d really encourage you to read it. The attack known as Vollgar uses a simple brute force attack to gain access to SQL Servers exposed to the internet. It then uses the elevated…
Read more

Is There an Update for My SQL Server?

We’ve all asked that question at some point. Maybe we inherited a new-to-us SQL Server that hasn’t been maintained regularly. Or, perhaps we’re prepping for a maintenance window and we want to get the latest update into Test as soon as possible. Regardless, we want to know two things. First, what product version is my…
Read more

How Many tempdb Data Files Should My SQL Server Have?

We’re frequently asked how many tempdb files a SQL Server should have, especially from those who have downloaded our free 5 Common SQL Server Configuration Issues PDF. That’s because there’s a lot of well-intended but incorrect information posted on the internet about tempdb.  What Is tempdb? Let’s start with a very brief description of tempdb. When SQL…
Read more

Script: How Long Until My SQL Server Backup/Restore Completes?

Ding!  Your desktop IM client chimes. “Any idea how long my SQL Server backup/restore will take to complete? I think it may be stuck.”  Someone has started a database restore (or backup) using a T-SQL command. Now he wants to know how long the process will take to complete. He’s gone to the bathroom and…
Read more