Monitor AlwaysOn Availabilty Groups

Yaniv Etrogi

Yaniv Etrogi is an SQL Server consultant. He loves SQL Server and he is passionate about Performance Tuning, Automation and Monitoring.

Download files from Amazon s3 to local folder using Powershell

As part of the services we provide our clients around Microsoft SQL Server we also provide a service that uploads database backup files to Amazon S3 or Azure Blob Storage (applies for On Premise servers). This option is really great and gives you lots of confidence letting you sleep better at nights. it had already …

Download files from Amazon s3 to local folder using Powershell Read More »

Use SqlCredential with Powershell to connect to an instance of SQL Server

In this post I will share how to use the SqlCredential object with Powershell when using SQL Authentication in order to pass the password in a secured way connecting to an instance of SQL Server. First step is a one time step creating a secured encrypted password saved in a text file that we latter …

Use SqlCredential with Powershell to connect to an instance of SQL Server Read More »

Use PowerShell to Install a Windows Service remotely

When installing a Windows Service remotely as a “Local Service” there are no credentials involved and this is a pretty straight forward  task. But if you need to have the service installed under the account of a local user or a domain user then this is somewhat tricky. The security credentials you create using the …

Use PowerShell to Install a Windows Service remotely Read More »

Find the specific sql server t-log to be restored for an unrecovered database

Recently when I needed to find the Transaction Log file that can be applied to a log shipping secondary database I decided to take a few moments and automate the process that I usually do in the old fashion manual way and that includes: 1. generating the restore log commands using a query over backupset …

Find the specific sql server t-log to be restored for an unrecovered database Read More »

Compressing SQL Server backups using 7Zip4Powershell

When maintaining client’s systems, I tend to pay extra attention about SQL Servers backups, being a ware that the data in most cases is the organization’s most important asset. With that in mind I always look for the extra layer of protection I can provide so that data is protected against any potential threat and …

Compressing SQL Server backups using 7Zip4Powershell Read More »

Perform DBCC CHECKDB Data Integrity checks on Log Shipping Secondary server

As a professional maintaining and managing databases for clients I am very well aware of the fact that Data Integrity in relational databases is absolutely crucial. As DBAs the data we maintain and support, is in many cases the organization’s most important asset. Data Corruption is a topic for it self that I will not …

Perform DBCC CHECKDB Data Integrity checks on Log Shipping Secondary server Read More »

Capture SQL Server’s Blocked Process Report event

For the TraceBlockedProcessReport stored procedure presented in this post see my Traces project at GitHub. This is from the  Microsoft’s official documentation “The Blocked Process Report event class indicates that a task has been blocked for more than a specified amount of time. This event class does not include system tasks or tasks that are …

Capture SQL Server’s Blocked Process Report event Read More »

Generate graphs based on diskspd stress tests

Before moving forward be sure to have read this previous post that is the basis for the current post. This is the link to me GitHub diskspd project containing the relevant files discussed in these 2 blog posts mini serious. Working quiet often with diskspd it was only natural for me to automate the tiring …

Generate graphs based on diskspd stress tests Read More »

Using diskspd to test disk performance with SQL Server

This is the link to my GitHub diskspd project diskspd was designed as a storage testing tool and that basically mean test your SAN or NAS but not only SAN/NAS based disks, you can test any other disk, be it a DAS, a local drive on your server or your new laptop’s SSD (I always …

Using diskspd to test disk performance with SQL Server Read More »

Use SQL Trace to capture database errors

This is a link to previous related posts that you may find interesting https://sqlserverutilities.com/maximize-sql-trace/ https://sqlserverutilities.com/use-sql-trace-to-capture-database-exceptions/ If we want to capture all the commands being sent to the database engine we should capture just these 2 events: SQL:BatchCompleted and RPC:Completed. By doing so we guarantee to be capturing all executions sent to the database engine which …

Use SQL Trace to capture database errors Read More »

Use SQL Trace to capture database exceptions

For the previous post discussing SQL Trace see this post For the TraceExceptions stored procedure presented in this post see my Traces project at Github.  Capturing all the exceptions that occur in the database engine has been proved to be very useful in my experience. Actually, when thinking about it, I realize most DBAs do …

Use SQL Trace to capture database exceptions Read More »

Using a startup Stored Procedure in SQL Server

SQL Server allows marking any stored procedure as a “startup” procedure which means it will get executed upon a service restart. A “startup” procedure has to reside in the master database and cannot accept input parameters – cool, this is something we can live with. I find this option to be very simple and practical …

Using a startup Stored Procedure in SQL Server Read More »

Use SQL Server’s missing indexes feature

SQL Server exposes missing indexes metadata via the following 3 DMVs (Dynamic Management Views) sys.dm_db_missing_index_details,  sys.dm_db_missing_index_groups and sys.dm_db_missing_index_group_stats which combined in a simple query return valuable information of indexes that were detected as missing by the Optimizer and logged in those DMVs. The information in these DMVs is updated by the execution of every query …

Use SQL Server’s missing indexes feature Read More »

Implement SQL Server Agent Jobs with AlwaysOn Availability Groups

In this post I talk about SQL Server Agent jobs when implementing AlwaysOn Availability Groups. AlwaysOn Availability Groups synchronizes the databases that are part of an Availability Group but any other object that is not part of these databases do not get synchronized (i.e. logins, linked servers, operators etc.) and this includes SQL Server Agent jobs. For …

Implement SQL Server Agent Jobs with AlwaysOn Availability Groups Read More »

Use Powershell to Multi Thread SQL Server Index Maintenance tasks

This is my very first blog post at my own site after over a year of none blogging. What happened is that the site I use to blog at http://blogs.microsoft.co.il/yaniv_etrogi has gone down…. yes, I know…. with tones of my blog posts, I had so many posts just around the Replication features, Partitioning and lots …

Use Powershell to Multi Thread SQL Server Index Maintenance tasks Read More »