Keep SQL Server instance health check analysis fresh and updated

Applies to

ApexSQL Manage

Summary

This article covers the process of refreshing the health check rules outcome in the Result grid column of the Health check tab after fix SQL script for a failed SQL Server instance health check rule is completed.

Introduction

Let’s for instance assume that, after a fix SQL script for a failed health check rule is completed, there is a need to refresh its outcome result in the grid, but doing so without omitting any rules that are part of previously performed health check analysis.

The following guide will cover ways of keeping a health check results in the main grid of the Health check tab fresh and up to date.

First, let’s perform a health check analysis against the desired SQL instance.

Run health check analysis

To perform a health check analysis against the desired SQL Server instance(s), head over to the Health check tab and click the Run button. In the Servers tab of the Run health check window, choose the desired SQL instance as the target of the analysis. Made this selection by ticking the checkbox of the desired instance:

Run health check window

For this guide, under the Rules tab, a set of randomly selected SQL instance health check rules will be used. Click the OK button to run the health check analysis:

Rules tab of the Run health check window in ApexSQL Manage

In the Result summary window, the health check statistics are displayed accurately and in eye-pleasing visuals. Click the Close button to exit the window:

Result summary window in ApexSQL Manage

Once the health check analysis is performed, the chosen set of rules for the examined SQL Server instance are shown in the grid:

Health check analysis grid in SQL manage instance tool

Run Fix SQL scripts

Let’s now run the Fix SQL script for a rule with a failed outcome. To do so, select the appropriate rule from the grid and click the FixSQL button. In the Fix SQL editor click the Execute button to run the script. Once the script is performed successfully close the editor:

Fix SQL editor in SQL manage instance tool

Now, the same action can be repeated for other rules with failed outcomes so issues with SQL instance can be further cured. For example, Fix SQL scripts for the following rules are performed:

  • Database AUTO_CLOSE should be disabled
  • Database AUTO_SHRINK should be disabled
  • C2 Audit Trace Activated

Fix SQL editor in SQL manage instance tool

Refresh Result column after fixing some of the SQL Server instance issues

Once a few issues regarding a SQL instance are fixed, the goal is to update the grid.

There are three ways of keeping rules outcome in the Result column fresh and updated and below all three will be addressed in detail.

Memorize all rules from previously performed health check analysis

One way of achieving the above-mentioned goal is to make an effort and memorize all the rules.

Once fix SQL scripts are performed, go ahead and repeat the same steps from the Run health check analysis section.

This may prove to be a very tedious endeavor since hand-picking those SQL Server instance health check rules based only on one’s good memory will surely take some time and is very exhausting. No need to emphasize that this will likely not happen and is unnecessary.

Using the Save my defaults option

To avoid this manual selection and annoying obligation of remembering every one of those rules, there is an option to automatically remember any set of rules by clicking the Save my defaults button.

After the same SQL instance is chosen in the Servers tab of the Run Health check window, move to the Rules tab and once the desired rules are chosen from its corresponding categories, click the Save my defaults button:

Rules tab of the Run health check window in ApexSQL Manage

So, next time there is a need to run the same set of SQL Server instance health check rules, simply click the My defaults button under the Rules tab and the same rules will populate the list:

Rules tab of the Run health check window in ApexSQL Manage

One caveat here, this action needs to be repeated every time a different set of rules are chosen for different SQL instances, and only one set of rules can be saved at a time.

Refreshing the Result column is now faster and more intuitive

Now, after a fix SQL is completed, close the Fix SQL editor. This action will summon the message dialog asking to run all previously selected set of health check rules on the same SQL Server instance. Click No to ignore health check analysis for now, until the rest of the failed health check rules are addressed with appropriate fix SQL scripts:

Run previous health check analysis

Run fix SQL scripts for the rest of the mentioned SQL instance health check rules. Once the last script is completed successfully, on the same message dialog click the Yes button:

Run previous health check analysis

This action will open the Run Health check window with the same SQL instance as the target in the Servers tab and the same set of rules populated in the Rules tab. Optionally, choose to add more SQL Server instances as the target of the health check analysis or add more rules to the already existing set.

Click the OK button to run the analysis:

Servers tab in SQL manage instance tool

Rules tab of the Run health check window in ApexSQL Manage

Now, the health check analysis for the targeted SQL instance is fresh and up to date:

Health check analysis in SQL manage instance tool