Archive for the ‘Powershell’ Category

SQL Server health check using PowerShell and T-SQL   15 comments

I am back with another interesting blog which hopefully the production DBAs would find more useful. We often have the need to capture aggregated data related to SQL Server health which can not only be captured quickly but also be able to customize as per the requirements.

We have many tools available to capture the performance data but it mostly has some data lag and does not tell us what’s currently running on the system.

Since last few days, I have been working on a script based solution which helps us to perform quick health check of our production instance to resolve any production issue with this blog, I intend to share the solution as I have found it quite useful Read the rest of this entry »

Query Store: Exploring new features in SQL Server – vNext   1 comment

Troubleshooting performance problem is one of the challenging and most often faced situation in DBA’s life. Following diagram shows three major scenarios where DBA’s get involved and spend nights troubleshooting performance problems.

Note: This is with community technical preview 2 of SQL Server 2016, things may change with the RTM release

18

Read the rest of this entry »

Powershell script to manipulate SQL Server backup files   Leave a comment

Scenario

I use Ola Hallengren’s famous backup solution to back up my SQL Server databases. The destination for full backups is a directory on local disk; let’s say D:\SQLBackup\

If you are familiar with Ola’s backup scripts, you know the full path for backup file looks something like:

D:\SQLBackup\InstanceName\DatabaseName\FULL\InstanceName_DatabaseName_FULL_yyyymmdd_hhmiss.bak

where InstanceName is a placeholder for the name of the SQL server instance, similarly, DatabaseName is for the Database Name. Read the rest of this entry »