Blog Archives

Determining a setting for Cost threshold for parallelism

The cost threshold for parallelism option specifies the threshold at which SQL Server creates and runs parallel plans for queries. SQL Server creates and runs a parallel plan for a query only when the estimated cost to run a serial plan

Tagged with: ,
Posted in Administration, Performance tuning, Scripts

Finding Implicit Column Conversions in the Plan Cache

I’m just sharing with you guys a script to find all implicit data type conversions associated with mismatched data types in a specific database. It’s pretty handy when you are either developing or coding reviewing. More details here: http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/01/08/finding-implicit-column-conversions-in-the-plan-cache.aspx

Tagged with: , , ,
Posted in Administration, Performance tuning, Scripts

Clearing a Single Plan from Cache

Most of you guys know that you can clear all cached plans using DBCC FREEPROCCACHE. In SQL Server 2008 you are able to clean a single pan from cache. The query below helps you to find the plan. There is

Posted in Administration, Scripts

How to monitor Timeout and Changes Roles from Availability Groups with Alerts

Agent alert can send alerts by email when occur some action/timeout between databases in your Availability Group Environment. It allows you to become proactive. The following script shows how to create these alerts. You can also configure to execute another

Tagged with: , , , , ,
Posted in Administration, Alerts, AlwaysOn, Scripts

How to validate Quorum Vote from Windows server Failover Cluster (AlwaysOn)

If you have configured a Windows server Failover Cluster with more than two Nodes, you must care about the “votes” in each Node. Let’s imagine the following environment: You have two Nodes configured in Automatic Failover/Synchronous mode with AlwaysOn Availability

Tagged with: , , ,
Posted in Administration, AlwaysOn, Cluster, High Availability

MSDB Scripts

Many times, you need to get informations from MSDB database. I’m going to share some simple scripts that can help you. Increase SQL Agent History Retention If you have many jobs that run frequently, you may want to increase the

Tagged with: , ,
Posted in Administration, Scripts

Easy script to notify failed jobs [SQL Server]

The script provided below is a easy way to add notification for all failed jobs. Requirements: 1- DatabaseMail Enabled 2- Enable DatabaseMail on the SQL Server Agent ; properties ; Alert System

Tagged with: , , ,
Posted in Administration, Alerts, Scripts