[EN] Sunday Market–SSMS Spotlight Plugin by Dell (part one)

It Sunday again. And some shops are closed. If Yes, it’s time to get next useful tool for free. It’s my episode #07 in non-frequently series: Sunday Market. This time we will look for Dell. Inspired by online session of my good friend from England: Richard Douglas {TWITTER|BLOG|LINKEDIN} I want look for Spotlight Essentials Plugin by Dell. Richard delivered session: Wait Watchers – No pain, all gain exercises to increase database performance at PASS Database Administration Virtual Chapter and it was very interesting. Interesting enough to look for this plugin. It is free, so we can get in on Sunday, just like today. This post will be divided in two parts: one for basic installation – till the moment “"’I got it!’ and second with more configuration options. So let’s install this plugin.

Phase One. Getting the plugin.

You should go to Spotlight Plugin site: https://www.spotlightessentials.com/sql-server/instances 

Captura_Spotlight01

Pict. 01 | Intoructionary picture of plugin

Captura_Spotlight02

Pict. 02 | Registration form for account using Spotlight in future

Captura_Spotlight03

Pict. 03 | Downloading plugin (ca 70 MB)

Captura_Spotlight04

Pict. 04 | Registration for Spotlight Essential Web Account (if you registered before new geristration is not necessary)

 

Phase Two. Installation of plugin.

Captura_Spotlight05

Pict. 05 | Welcome screen (same type like Visual Studio 2013 isn’t?)

Captura_Spotlight06

Pict. 06 | Transaction Product Agreement – in normal words license.

Captura_Spotlight07

Pict. 07 | Installation of Diagnostic Server with specify Diagnostic Server Service Account

Captura_Spotlight08

Pict. 08 | Using special dedicated account SQL Spotlight will bring errors with permissions, but it work and is best way in my opinion.

Captura_Spotlight09

Pict. 09 | Configuration os specific Payback Database which will store recent and current data (we can choose special instance or the same instance as production server)

Captura_Spotlight10

Pict. 10 | If desired instance are not connected or not running, we will get error.

Captura_Spotlight11

Pict. 11 | In the case of clicking NEXT at previous screen we will get error that Specific Database not exist

Captura_Spotlight12

Pict. 12 | When we click CREATE on screen (at picture nine) we can creat Specific Database

Captura_Spotlight13

Pict. 13 | Specific Database created succesfully

Captura_Spotlight14

Pict. 14 | Installaton started…

Captura_Spotlight15

Pict. 15 | …and finished. Aproximately time is less than five minutes.

 

Phase Three. First view in SQL Server Management Studio.

Captura_Spotlight16

Pict. 16 | Specified Database appears in databases tree: SpotlightPluginPlayBackDatabase

Captura_Spotlight17

Pict. 17 | We can docking Spotlight Plugin in a tab. But we can’t connect to Diagnostic Server if our Spotlight plug-in Diagnostic Server Service didn’t run.

Captura_Spotlight18

Pict. 18 | We can check Services and even we see that service is running, we can STOP and START again it.

Captura_Spotlight19

Pict. 19 | First view for our plugin in General Tab

Captura_Spotlight20

Pict. 20 | Next step is connecting instance to Spotlight Essential Plug-In Web Account (I will write more about in in next post)

Captura_Spotlight21

Pict. 21 | Time for connect first instance. In my case is the instance with Specified Database

Captura_Spotlight22

Pict. 22 | And here we see status of connections: to Diagnostic Server and to Instance

Captura_Spotlight23

Pict. 23 | First detailed tab: Overview Tab with Waits, Top Databases Files IO, Batch Request, Summary, Connections, CPU Usage and more.

Captura_Spotlight24

Pict. 24 | Second detailed tab: Sessions with sessions status, activity last command and over thirty other details about sessions

Captura_Spotlight25

Pict. 25 | Third detailed tab: Resources Waits with Wait Time Trend ans Waits Details

Captura_Spotlight26

Pict. 26 | Fourth detailed tab: Data File I/OS with general data file infor for each data file and system databases

Captura_Spotlight27

Pict. 27 | Fifth  detailed tab: TOP SQL  with detailed information about last TOP 25 SQL Queries

Captura_Spotlight28

Pict. 28 | After few minutes of work we can see more events on our General Tab where alarms are sorted by Severity

Captura_Spotlight29

Pict. 29 | And more and more alerst after next few minutes.

Screenshot 2015-01-04 18.17.01

Pict. 30 | We can add more instances for Diagnostic Server

Captura_Spotlight30

Pict. 31 | But we can’t connect with SQL Azure Instance if we just click without changing authentication type

image

Pict. 32 | When we use SQL Authentication, connection is succesful

image

Pict. 33 | And we can see all instances in General Tab

Captura_Spotlight31

Pict. 34 | In General Tab we see status of our instances in colors which based on health status

Screenshot 2015-01-04 18.47.05

Pict. 35 | When we move mouse in General Tab over one of many instances we will see pop-up windows with short information of errors

Screenshot 2015-01-04 18.48.51

Pict. 36 | And those errors will be different, they change in time

Screenshot 2015-01-04 19.01.23

Pict. 37 | Same pop-up windows we will see in Overview tab on each instance

 

That’s All Folks. Get the plugin, istall the plugin and configure the plugin. From this point You can test this plugin and start to play with this nice tool. More details about configuration, errors, connections and how useful this plugin could be in next post.

[EN] First date with Killer ApexSQL Tools

New year started few weeks ago. For me one of my personal goals is to be more active blogger than last year. Especially with this interesting (in my – ond not only – opinion) special series: The Sunday Market. Name (genesis is too big word) of this series is simple. In many countries You cannot buy something interesting for Your environment, because Financial Department are close in Your company. But You always can get something for free from the web. Get-Test-Check > put into your budget.

Captura_ApexSQL_killer

Last Wednesday I presented short (introduction type) session at my local SQL User Group (Polish SQL Server User Group in Wrocław LINK) about free tools from ApexSQL. Some of my folks talked about it few times on previous meetings. It was first session, second will be presented soon with more funny experiments. In this blog series I want show few moments from “dating with Apex”.  In this post I will just introduce about installation of three tools. All are free:

ApexSQL Complete | LINK http://bit.ly/1i3IeV3 | size 7MB | in few words: SSMS and VS integration,   SQL syntax checking, SQL object descriptions, SQL code completion, SQL code visualization, Snippet management

ApexSQL Refactor | LINK http://bit.ly/1i3IjrC | size 8MB | in few words: SQL parameter management, SQL formatting, Consistent code layout, Database object refactoring, Batch formatting, One-to-many relationship replacement

ApexSQL Search | LINK http://bit.ly/MkFvvR | size 7MB | in few words: Smart renaming, Text search, Database object search, Easy SSMS tab navigation, SQL code cleaning, Graphical dependencies

 

Phase one: installation

Captura_ApexSQL_Complete01 Captura_ApexSQL_Refactor08 Captura_ApexSQL_Search08

Pic.01 | Three tools, same installation interface – I really LOVE it. Ordnung muß sein!

All screenshots below (till phase two) are the same for all tools.

Captura_ApexSQL_Complete02

Pic.02 | Reading – yes read it – and accepting license.

Captura_ApexSQL_Complete03

Pic.03 | Choosing installation folder – for me as alway it is ‘non default folder’ *

Captura_ApexSQL_Complete04

Pic.04 | We can integrate these tools with all part of environment which is installed on machine: in this case I have SSMS for SQL 2008 & 2012, anf VisualStudio for 2005, 2008, 2010 & 2012 versions. It’s interesting because I don’t heve Visual Studio 2013 and installer is prepared for instalaltion (suppose that last row will be un-grayed when I install VS2013). But I have SQL Server 2014 on my miachine and this installer is not ready for this version.

Captura_ApexSQL_Complete06

Pic.05 | Choosing (or not) selected Start Menu – even on Windows 8.1 **

Captura_ApexSQL_Complete07

Pic.06 | Ready to install with summary.

Captura_ApexSQL_Complete08

Pic.07 | installation in progress.

Asterix:

* in this case I got several problems with using non defaul folders, but not only – I had not vell functional addins from other software vendor – these addins figting for place and acces for dll’s.

** definitely too much, really too much links in start menu by default:

image

Phase two: result

Capturaerror6

Pic.08 | First execution of SQL Server management Studio 2012 and I got this error, next: SSMS crash. I tried again and again and again.

Capturaerror7

Pic.09 | More interesting error I got when I run Visual Studio 2012 (of course add-ons hasn’t been installed).

I didn’t enought time for full investigation, becaus it happener just few hours befor my user group meeting. So I executed my disaster repair (not recovery) procedure in few steps:

  1. deinstallation al ApexSQL addins
  2. deinstallation all other vendor add-ons
  3. cleaning reistry (by wise registry cleaner)
  4. cleaning folders (by wise dick cleaner)
  5. restart physical machine
  6. installation all three ApexSQL tools again

 

Phase three: final result

Finally I got all tools in my SQL Server Management Studio:

image

Pic.10 | ApexSQL Complete integrated with SSMS 2012.

image

Pic.11 | ApexSQL Refactor integrated with SSMS 2012.

image

Pic.12 | ApexSQL Search integrated with SSMS 2012.

 

Next date with Apex on Sunday.

ps: to kill or to be killed…

[EN] Sunday Market – SQL Server Maintenance Solution by Ola Hallengren

On last SQLBits 9 – Query Across Mersey (September 2011, Liverpool, UK) I had great opportunity and pleasure to be a host as my SQLBits Helper role for not very famous, but full professional specialist from Denmark (work place)/Sweden (living place) – Ola Hallengreen at his session. Just back for the past for a moment – here is the abstract of his session: How do you do database maintenance in an enterprise environment? I have developed a stored procedure based solution that has become extremely popular in the SQL Server community. In this session I will go through how the solution works, how it can be used in different scenarios for backup, integrity check, index and statistics maintenance and talk some about the background for the design. You can also bring your questions about the solution or about database maintenance in general. And links for video recording is here: Slide Deck 75 KB + Demo Code 3 KB + MP4 Video Low 64 MB + MP4 Video Med 87 MB + MP4 Video High 205 MB +  MP4 Video HD 382 MB.

In this post I want to write some words about his great solution. Great because is powerful tool, and great because is free (like all tools in Sunday Market series). Based on Ola’s web site: The SQL Server Maintenance Solution comprises scripts for running backups, integrity checks, and index and statistics maintenance on all editions of Microsoft SQL Server 2005, SQL Server 2008, SQL Server 2008 R2 and SQL Server 2012. The Solution is based on stored procedures, functions, the sqlcmd utility, and SQL Server Agent jobs.

In one Maintenance Solution script package you can find a lot of scripts in three very important components, where all l are:
Supported versions: SQL Server 2005, SQL Server 2008, SQL Server 2008 R2 and SQL Server 2012
Depends on: CommandExecute, DatabaseSelect and CommandLog

SQL Server Backup
Procedure name: DatabaseBackup
Purpose: Back up databases
Example below:

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE [dbo].[DatabaseBackup]

 

@Databases nvarchar(max),

@Directory nvarchar(max) = NULL,

@BackupType nvarchar(max),

@Verify nvarchar(max) = ‘N’,

@CleanupTime int = NULL,

@Compress nvarchar(max) = NULL,

@CopyOnly nvarchar(max) = ‘N’,

@ChangeBackupType nvarchar(max) = ‘N’,

@BackupSoftware nvarchar(max) = NULL,

@CheckSum nvarchar(max) = ‘N’,

@BlockSize int = NULL,

@BufferCount int = NULL,

@MaxTransferSize int = NULL,

@NumberOfFiles int = 1,

@CompressionLevel int = NULL,

@Description nvarchar(max) = NULL,

@Threads int = NULL,

@Throttle int = NULL,

@Encrypt nvarchar(max) = ‘N’,

@EncryptionType nvarchar(max) = NULL,

@EncryptionKey nvarchar(max) = NULL,

@LogToTable nvarchar(max) = ‘N’,

@Execute nvarchar(max) = ‘Y’

 

AS

#####  #####  #####

SQL Server Integrity Check
Procedure name: DatabaseIntegrityCheck
Purpose: Check the integrity of databases
Example below:

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE [dbo].[DatabaseIntegrityCheck]

 

@Databases nvarchar(max),

@PhysicalOnly nvarchar(max) = ‘N’,

@NoIndex nvarchar(max) = ‘N’,

@ExtendedLogicalChecks nvarchar(max) = ‘N’,

@TabLock nvarchar(max) = ‘N’,

@LogToTable nvarchar(max) = ‘N’,

@Execute nvarchar(max) = ‘Y’

 

AS

##### ##### #####

SQL Server Index and Statistics Maintenance
Procedure name: IndexOptimize
Purpose: Rebuild and reorganize indexes and update statistics
Example below:

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE [dbo].[IndexOptimize]

 

@Databases nvarchar(max),

@FragmentationLow nvarchar(max) = NULL,

@FragmentationMedium nvarchar(max) = ‘INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE’,

@FragmentationHigh nvarchar(max) = ‘INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE’,

@FragmentationLevel1 int = 5,

@FragmentationLevel2 int = 30,

@PageCountLevel int = 1000,

@SortInTempdb nvarchar(max) = ‘N’,

@MaxDOP int = NULL,

@FillFactor int = NULL,

@PadIndex nvarchar(max) = NULL,

@LOBCompaction nvarchar(max) = ‘Y’,

@UpdateStatistics nvarchar(max) = NULL,

@OnlyModifiedStatistics nvarchar(max) = ‘N’,

@StatisticsSample int = NULL,

@StatisticsResample nvarchar(max) = ‘N’,

@PartitionLevel nvarchar(max) = ‘N’,

@TimeLimit int = NULL,

@Indexes nvarchar(max) = NULL,

@Delay int = NULL,

@LogToTable nvarchar(max) = ‘N’,

@Execute nvarchar(max) = ‘Y’

 

AS

##### ##### #####

 

From Ola’s WEBSITE You can download separated scripts like:

CommandLog.sql / DatabaseSelect.sql / CommandExecute.sql / IndexOptimize.sql / DatabaseIntegrityCheck.sql / DatabaseBackup.sql 

or get all in one file

 MaintenanceSolution.sql   

 

Enjoy!