New Revamped SQL Server 2016 Upgrade Advisor

SQLServerF1

Most of the DBAs must be familiar with SQL Server upgrade advisor, which is used to run during planning phase of upgrading to higher SQL Server versions inorder to identify any objects or features that will get affected during or after the instance or database upgrade. With every new release of SQL Server, some old features may be deprecated or retired and behavior of some features might change in new versions. So, running upgrade advisor during planning phase on a test server where the production database is restored, will give us good idea on what objects are going to break during or after upgrading to higher version of SQL Server. In previous releases of SQL Server, the Upgrade Advisor tool was made available only few days before the release of the new SQL Server version, but with SQL Server 2016, the upgrade advisor has been released way early giving options to test the instances or databases and then to proceed with testing on RC releases of the SQL Server. Although, we may be very familiar with using the upgrade advisors for SQL Server 2005, 2008 R2, 2012 and 2014, but there have been significant changes to SQL Server 2016 Upgrade Advisor in look and feel and its usage.

We should be able to download the latest version of SQL Server 2016 Upgrade advisor from official Microsoft link here.
As per Microsoft documentation “SQL Server 2016 Upgrade Advisor Preview is a standalone tool that enables users of prior versions to run a set of upgrade rules against their SQL Server database to pinpoint breaking and behavior changes and deprecated features as well as providing help with the adoption of new features such as Stretch Database.
Once we download the SQL Server 2016 Upgrade Advisor, we will find SqlAdvisor.msi in the downloaded location. Run this msi installer by choosing run as administrator and you will need to have local administrator permission on the server where you are installing this tool. It is always recommended to install Upgrade Advisor on a test server and restore a copy of production database on the test server for analysis.

Once the installation of SQL Server 2016 upgrade advisor is completed successfully, launch the program and you will first see a What’s New screen which has some information regarding What’s new in SQL Server 2016 Upgrade Advisor. After that we will find a title bar with SQL Server 2016 Upgrade Advisor and next to it, you will see two main options “Scenarios” and “Active”. Apart from these two options, there are Notifications, Send Feedback and Settings which allows us to see new notifications for the product and to send any feedback to Microsoft for any bugs or new feature requests. Settings option has a gear icon which is used to choose any settings, as of now there is not much you can do here.

Inorder to start the upgrade analysis process, we need to choose “Scenarios” menu -> Run Database Upgrade Advisor -> Select databases to analyze -> Select Instance -> Select the instance from the drop down list if any available or create a new connection -> If we need to specify port number as well inorder to connect to the instance, then we can specify the port number by clicking on advanced options -> Once we successfully made connection to the SQL Server instance, next we will see list of databases to choose for the upgrade analysis -> Select one or more databases based on your requirement -> Run the upgrade analysis by clicking on Run button. It will take a while for the analysis to be performed. Once analysis is complete, you will be presented with a summary page. We will not only see the analysis for SQL Server 2016 instance, but we will find it for other versions as well based on what is the SQL Server version where upgrade advisor was run against, like if you run it against SQL Server 2008 R2 instance, then you will see the analysis for SQL Server 2012, 2014 and 2016. We can drill down for each of the versions and see the affected objects and the details about the impact and recommendation.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2016

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 

Failed to Decrypt A Column Encryption Key Error in SQL Server 2016

SQLServerF1

There have been many new features introduced with SQL Server 2016 and you may get different errors while you use these new features. One such issue and errors DBAs might get while they try to use new SQL Server 2016 feature Always Encrypted data is as below.
Msg 0, Level 11, State 0, Line 0
Failed to decrypt column ‘test’
Msg 0, Level 11, State 0, Line 0
Failed to decrypt a column encryption key using key store provider: ‘MSSQL_CERTIFICATE_STORE’. The last 10 bytes of the encrypted column encryption key are: ‘F1-S3-K2-8E-69-E7-F7-O8-1W-B4’.
Msg 0, Level 11, State 0, Line 0
Certificate with thumbprint ‘664EBAB58B3A8150AC51E2BEF40BDEC17055167C0′ not found in certificate store ‘My’ in certificate location ‘CurrentUser’.
Verify the certificate path in the column master key definition in the database is correct, and the certificate has been imported correctly into the certificate location/store.
Parameter name: masterKeyPath

This error occurs if we do not have certificate imported to the local machine’s certificate store. Always Encryped has two main keys, one is column master key, which is stored in the trusted key store and its information about column master keys, including their location, is stored in the database in system catalog views. Another important part is Column encryption keys, which actually encrypts the sensitive data. For clients to be able to access the data, there needs to be a certificate which needs to be installed on the client systems, with out which we will get the errors related to the certificate. This is to allow only authorized users with the certificate to be able to access and decrypt the sensitive data.

Apart from this error for not importing the certificate, there can be other errors too returned with Always Encrypted even when the certificate in installed or imported on the client system like below,
Failed to decrypt a column encryption key using key store provider: ‘MSSQL_CERTIFICATE_STORE’.
The last 10 bytes of the encrypted column encryption key are: ‘F1-S3-K2-8E-69-E7-F7-O8-1W-B4’. Certificate specified in key path ‘CurrentUser/My/664EBAB58B3A8150AC51E2BEF40BDEC17055167C0’ does not have a private key to decrypt a column encryption key. Verify the certificate is imported correctly.
Parameter name: masterKeyPath

The above error occurs even when we import the certificate because the imported certificate only has a public key, which is not enough to decrypt the data. We will also need a private key to be able to successfully decrypt the data.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2016

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 

SQL Server Cumulative Updates are More Stable to Install

Microsoft releases various service packs, cumulative updates, hotfixes for SQL Server to fix any bugs or known issues. Each of these serves different purposes. For example hotfixes address specific bug or issue and released when a customer opens a case with Microsoft and issue identified as bug, then hoxfix will be released to rectify the specific issue. So, DBAs are required to only apply the hotfix if they are facing that issue. Cumulative updates contain more number of fixes which include multiple hotfixes and additional bug fixes raised by customers. Service Packs are more higher level and contain all service packs, cumulative updates released so for for that version of SQL Server.

With each release of SQL Server version, Microsoft has been making various improvements to the product and the process based on the feedback received from the customers. For example, since SQL Server 2008, Microsoft has allowed possibility of uninstalling service packs, thus providing a better and easier way of rollback in case something goes wrong after applying the patch. Now in year 2016, Microsoft has come up with approach of recommending to install latest available service pack or cumulative update and stated that both of these will be stable as the level of testing done will be same. Previously, in DBA community, there has been assumption that service packs are more stable compared to cumulative updates, as service packs contain more fixes and tested thoroughly and thought that CUs are not tested as thoroughly as SPs.

Now with the article, Microsoft has made it clear that even service packs going forward from year 2016 are stable and recommends to install them as soon as they are available, similar to how DBAs react to release of service packs. This is due to change in the way the service packs and cumulative updates are created and tested. Microsoft has made effort to update the KB articles to reflect the same. Previously, the KB articles used to have message that “This cumulative package is intended to correct only the problems that are described in this article. Apply it only to systems that are experiencing these specific problems.”, which made many customer back down from applying the cumulative updates, but now they are updating the message with “we now recommend ongoing, proactive installation of CU’s as they become available.”

This change was welcomed by the DBA community where it makes it easier to convince the management to go ahead with applying the latest updates available from Microsoft whether it is a service pack or a cumulative update. Hope, with coming years there will be many more changes which not only improves the product, but also improves the processes.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2005
SQL Server 2008 R2
SQL Server 2012
SQL Server 2014
SQL Server 2016

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 

The query processor ran out of internal resources Error in SQL Server errorlog

SQLServerF1

There are many number of errors documented for SQL Server and are raised when certain error condition occurs which range from syntax errors to problems with instance, databases, jobs, performance, features, etc. When a particular error is received, the error message will have some information regarding the kind of error and what might have caused the error. Sometimes, it is found that the errors are not detailed or misleading and make troubleshooting move in wrong direction or can cause slowdown of resolution the errors.

Out of many errors, some errors are related to performance and the error message may not be enough to understand the reason of the failure. Below is one such error message which occurs due to performance issues with the server performance or with a specific stored procedure or a batch or a individual SQL query. When ever a query hits SQL Server instance, a query plan is created if it is the first time, if not, SQL server optimizer will check for existing plans and reuse if one is already present. There are various reasons the query plan generated may not be optimal and takes more time to complete and sometimes the query can fail altogether with different errors. Below is one such error.

Error: 8623, Severity: 16, State: 1.
The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

This particular error mentioned above is is a rare event and only expected to occur when a very extremely complex queries or queries that reference a very large number of tables or partitions is received by SQL Server. There can be different reasons on what a complex query is referred as, it can happen when attempting to select records through a query with a large number of entries in the “IN” clause like greater than 10,000. There are also some bugs or known issues that can cause this error and some connect bugs are raised too. You can use SQL Server profiler or extended events to track and identify the query causing this error. If this error is recurrent and happening on certain day or time, then we can check if there are any jobs running at that time leading to this error.

The resolution for this error is to simplify and rewrite the complex query. We can also try and divide and get part of the query working and then use extra joins and conditions. We can also use temp table and use temp tables in joins to avoid this error from occurring. We can also try other alternatives like we can try to run the query using the hint option like force order, or option hash join or merge join or using trace flag 4102 with a plan guide. Enabling Traceflag 4102 will revert the behavior of the query optimizer to older version of optimizer for handling semi-joins.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2005
SQL Server 2008 R2
SQL Server 2012
SQL Server 2014
SQL Server 2016

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 

SQL Server High CPU Issues Due to Edition Limitations

SQLServerF1

There are variety of performance issues that can cause SQL Server performance issues. Performances can range from low server Hardware configuration, improper OS or SQL Server settings, fragmentation, blocking, no proper maintenance like index rebuilds or stats updates, etc. It is not easy to identify or pin point what is causing the slowness or performance problems with the SQL Server. As a DBAs we will need to review everything related to the hardware, OS and SQL Server to able to find the root cause of the issue.

There are many cases where performance issues are caused due to low server hardware configuration like lack of CPU power, or insufficient memory available or under-performing disk IO. We can look at various parameters like perfmon, SQL Server dmv statistics, query waits, etc to be able to understand if there is real bottleneck with the hardware and if we need to upgrade the hardware for better performance. However there can be situations, where the server although has a good hardware configuration interms of CPU, Memory or Disks, improper settings on some limitations cause the SQL Server not to use all of the available hardware on the server.

One of such issue related to the slowness caused by CPU usage due to limitations on the SQL Server edition been used. On one of our client server, there were multiple SQL Server instances installed. There was a monitoring tool which used to monitor the server and used to raise intermittent alerts for high CPU usage. Upon connecting to the server and verifying, the CPU usage was only reported as 50% usage on the server. Users also used to report about the performance issues some times, but not frequently.

Upon checking the server, from task manager the CPU usage was reported around 50% and this server has 8 sockets with one core each, The server has Windows Server 2012 as the Operating System and the task manager, by default combines all the processors available on the server and shows the average usage of all the processors. There is also an option to see the detailed view of CPU usage of each individual processor usage, checking which we found that only four processors are pegged to 100%, where as rest 4 CPUs were having negligible usage. So, it appeared that the SQL Server instances were using only 4 CPUs thus the high CPU usage with the four CPUs only.

Upon checking further, we noticed that all the SQL Server instances installed on the server were Standard Edition. Checking the documentation showed that SQL Server standard edition can use maximum of 4 sockets or 16 cores, which ever is less. Similar limitations on other SQL Server 2008 R2 or SQL Server 2005 versions of 4 sockets only.
https://msdn.microsoft.com/en-us/library/ms143760(v=sql.110).aspx

We can also check and confirm this on SQL Server 2012 instances by checking the SQL errorlog which will have a message like “SQL Server detected 8 sockets with 1 cores per socket and 1 logical processors per socket, 8 total logical processors; using 4 logical processors based on SQL Server licensing”.

For SQL Server 2008 R2 or SQL Server 2005, we can query sys.dm_os_schedulers to see how many processors are been used by the SQL Server instances.

The server where we had issues had multiple SQL Server instances, so we had to use processor affinity mask settings and map each instance to use first 4 or last 4 processors allowed us to use all the available processors on the server, thus reducing the CPU contention.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2005
SQL Server 2008 R2
SQL Server 2012
SQL Server 2014
SQL Server 2016

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 

List of Bugs Fixed in SQL Server 2012 SP1 – Part 10

SQLServerF1

With every release of SQL Server product or subsequent service packs or Cumulative updates, new bugs are encountered or discovered. Below are some of the bugs which were fixed with the release of SQL Server 2012 Service Pack 1 (SP 1) for Microsoft SQL Server 2012.

SQL Server MSDN Bug Number 861377
You cannot use the SQL Server slipstream package to update the current feature to Service Pack 1 when you add a new feature at the same time.
SQL Server MSDN Bug Number 846622
The Install wizard freezes when it searches for product updates.
SQL Server MSDN Bug Number 817937
FIX: Master Data Services (MDS) feature is visible in the feature tree when you try to uninstall SQL Server 2012 SP1.
SQL Server MSDN Bug Number 954667

FIX: When you try to update the SQL Server Client Tools or SQL Server Full-Text Search feature by using a corrupted installer file, the feature does not display the correct error message.
SQL Server MSDN Bug Number 819093
Feature selection is unavailable when you install a security update for shared components when the instance component is at a different service pack level.
SQL Server MSDN Bug Number 907647
FIX: Updates SQM to report the service pack level as a number.

SQL Server MSDN Bug Number 887062
FIX: SQL Server service pack applies English to certain features even though these features are installed by using a localized language.
SQL Server MSDN Bug Number 1018645
“Exit code:-2068578302” error message when you try to uninstall an instance of SQL Server 2012.
SQL Server MSDN Bug Number 829208
Reporting service is in a bad state after a SQL Server upgrade fails.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2014

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 

List of Bugs Fixed in SQL Server 2012 SP1 – Part 8

SQLServerF1

With every release of SQL Server product or subsequent service packs or Cumulative updates, new bugs are encountered or discovered. Below are some of the bugs which were fixed with the release of SQL Server 2012 Service Pack 1 (SP 1) for Microsoft SQL Server 2012.

SQL Server MSDN Bug Number 853528
The /QS parameter in a command line does not overwrite /QUITESIMPLE =”False” in configuration file when you install SQL Server 2012.
SQL Server MSDN Bug Number 972251
The IP/subnet option is disabled on the Cluster Network Configuration page, and you cannot move to next step.
SQL Server MSDN Bug Number 748122
The setup UI is displayed left-to-right for Hebrew and Arabic languages when you run rsSharePoint.msi.

SQL Server MSDN Bug Number 810794
The Cluster Network Configuration page in the ADDNODE wizard does not show a selected instance’s IP addresses if you go back and select a new instance of SQL Server.
SQL Server MSDN Bug Number 824972
The navigation pane is too wide in SQL Server Installation Center.
SQL Server MSDN Bug Number 964995
Adds a rule to warn you if the .NET Framework 3.5 is not installed and if the computer cannot access the Internet.

SQL Server MSDN Bug Number 880779
Setup process does not provide a summary that describes the next steps when you cannot update or remove an update.
SQL Server MSDN Bug Number 969810
You cannot install SQL Server updates through Windows Server Update Services or Microsoft Update on passive nodes of clustered instances.
SQL Server MSDN Bug Number 880225
Adds methods in Service Quality Monitoring (SQM) and in Watson to help you understand why the Setup program cannot install an MSI because of ERROR_PATH_NOT_FOUND code.
SQL Server MSDN Bug Number 880233
Setting validation does not report the correct setting that causes a failure in SQM and in Watson.

Hope this was helpful.

This is applicable for below versions of SQL Server

SQL Server 2014

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, Frequently asked questions, SQL Server Trainings

 
1 2 3 11