Quantcast
Channel: SQL Archives - SQL Authority with Pinal Dave
Viewing all 594 articles
Browse latest View live

SQL SERVER Tools I Use and Recommend (Updated: October 2019)

$
0
0

I just returned from the long road trip to teach 21 SQL Server Performance Tuning Scripts Course. One of the most popular questions, I had received what tools I use personally when I work with SQL Server. Though I had answered them during the training session, let me list each of them here for reference for everyone.

SQL SERVER Tools I Use and Recommend (Updated: October 2019) tools-i-use-800x165

Tools I Use

Here are the different tools and their download links along with it.

Database Performance Analyzer for Performance

I must admit I am a big of Database Performance Analyzer (DPA). The first thing it a free tool and it helps to manage pretty much any databases – virtually or physically. It reveals performance bottlenecks deep inside your SQL Server, Oracle, DB2 and SAP ASE instances. No other database monitoring tool focuses on response time and Multi-Dimensional Performance Analysis like DPA does.

Call to Action Download DPA or Alternative Link for FREE.

SQLGrease for Subscription Model

I have been using this tool for many clients who prefer subscription-based tool just for SQL Server. SQLGrease was built from the ground up specifically for SQL Server. Using the newest monitoring features in SQL Server, SQLGrease collects detailed information with extremely low overhead. SQLGrease installs in minutes. Upgrades do not require reinstallations and do not require end-user intervention. As a result, SQLGrease frequently introduces new features at no additional cost.

Call to Action Download SQLGrease

Foglight for Cross-Platform

I have been using Foglight more and more at my clients whenever I walk into the situation that I have to manage Cross-Platform database. with the foglight, you can proactively manage and monitor database environments, diagnose and tune real-time and historical performance, predict and troubleshoot issues, increase the health of your database environment.

Call to Action Download Foglight

RedGate for Monitoring

As the demand for more frequent deployments increases, the management of SQL Server availability needs to evolve. It’s essential that there’s a constant feedback loop between development and DBA teams about the impact of deployments. There’s also a need to ensure that the operations teams have full visibility of your estate, not just your production servers. If your engineering teams have access to secure development and testing servers, deployment issues are caught before they reach production.

Call to Action Download RedGate Whitepaper

NetLib Encryptionizer for Security

Just like performance, security is one of the most important aspects. NetLib Security provides cost-effective data encryption solutions that can be quickly deployed in a few steps. Encryptionizer is our powerful and easy-to-deploy flagship product that protects stored data and databases that belong to data owners for data associated with a distributed application ad data associated with SQL Server. Developers and data owners use it to encrypt stored data right out of the box, with virtually no impact on performance; it also directly assist compliance requirements.

Call to Action Download NetLib Encryptionizer

Melissa for SQL Server Data Quality

I see an increasing need for SQL Server Data Quality in the industry nowadays. Melissa’s Data Quality Components for SSIS is a unique set of global data quality tools for Microsoft’s integration and ETL (extract-transform-load) solution that empowers users to collect data from any source, clean and enrich it during migration and integration operations, to gain immediate insight for actionable intelligence.

Call to Action Download Melissa

I strongly encourage you to check out the tool which I use for a variety of tasks.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER Tools I Use and Recommend (Updated: October 2019)


SQL SERVER – Installation Error: 25641- For target, “package0.event_file”, the parameter “filename” passed is invalid. Target parameter at index 0 is invalid

$
0
0

While installing SQL Server 2012 in a client environment, they faced an interesting error about for target. Here is the information that is taken from SQL Server ERRORLOG. If you don’t know how to find Errorlog, please refer to my earlier blog. SQL SERVER – Where is ERRORLOG? Various Ways to Find ERRORLOG Location

SQL SERVER - Installation Error: 25641- For target, "package0.event_file", the parameter "filename" passed is invalid. Target parameter at index 0 is invalid error25641-800x130

The below lines are taken from the ERRORLOG file. I have truncated the date-time column to make it crisp and concise.

Starting up database ‘tempdb’.
Database ‘master’ is upgrading script ‘u_tables.sql’ from level 502 to level 569.
Starting u_Tables.SQL at …
This file creates all the system tables in master.
drop view spt_values ….
Creating view ‘spt_values’.
drop table spt_monitor ….
Creating ‘spt_monitor’.
Grant Select on spt_monitor
Insert into spt_monitor ….
Error: 25641, Severity: 16, State: 0.
For target, “package0.event_file”, the parameter “filename” passed is invalid. Target parameter at index 0 is invalid …
Error: 912, Severity: 21, State: 2.
Script level upgrade for database ‘master’ failed because upgrade step ‘u_tables.sql’ encountered error 25641, state 0, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
Error: 3417, Severity: 21, State: 3.
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
SQL Server shutdown has been initiated
SQL Trace was stopped due to server shutdown. Trace ID = ‘1’. This is an informational message only; no user action is required.

When I search for errors found in ERRORLOG file, I found many results that were not relevant.

If you have read my earlier blogs, there are many situations where SQL upgrade was failing with error: “Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it”.  In such situations, we can start SQL with special trace flag 902, fix the cause of the error, remove 902 and continue with install/upgrade. In my client’s situation they were getting the “Retry” option with a message – Wait on the Database Engine recovery handle failed. Check the SQL Server error log for a potential cause.

The path for file u_tables.sql is “C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Install\u_tables.sql”

WORKAROUND/SOLUTION

If you open the file, you can notice that the below section is relevant.

We can see the message “Insert into spt_monitor ….” printed in ERRORLOG just before failure which confirms that create event session is failing.

WORKAROUND/SOLUTION

We tried creating extended event session and it failed with the same error what we are seeing in SQL ERRORLOG. We captured process monitor and found that the SQL Service account did not have permissions on the drive (E drive in our case) where the LOG folder was located. This was confirmed by seeing “ACCESS DENIED” via process monitor.

The solution which would work is to give the SQLServer service Read Permissions at the root level of the disk where ……MSSQL11.MSSQLSERVER\MSSQL\Log\ is located. After giving the account these permissions there were no more errors during the Installation/Upgrade.

Note: The same error can also appear when a service pack is applied. Mostly there were some hardening performed on the server which caused service account permission to get modified.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Installation Error: 25641- For target, “package0.event_file”, the parameter “filename” passed is invalid. Target parameter at index 0 is invalid

MySQL – MariaDB – Writing the Very First Stored Procedure

$
0
0

As many of you know I am a big fan of the SQL Server Performance Tuning area and I spend most of the time working with the client on various SQL Server Performance Tuning projects. The best part of my job is that I get to work with the new client every day on my favorite topic of Comprehensive Database Performance Health Check. Recently while working with a client on a system walked into a very interesting situation where I had to write a stored procedure in three different programming languages MySQL, MariaDB and SQL Server. While it was easy for me to write a stored procedure in SQL Server, I found that for MariaDB and MySQL one has to know a bit of syntax to write the very first stored procedure.

MySQL - MariaDB - Writing the Very First Stored Procedure very-first-800x241

The goal of this blog post is to provide a template for anyone who wants to write their very first stored procedure with MariaDB or MySQL. 

Let us see how we can write the stored procedure in the MariaDB and MySQL. Please note that the stored procedure does not have to accept any parameter and also does not interact with any database table. It just returns value 1 when we execute it.

-- Change the delimiter
DELIMITER //
-- Create the stored procedure
CREATE OR REPLACE PROCEDURE FirstProc()
BEGIN
SELECT 1 AS OurResult;
END
//
-- Change back the delimiter
DELIMITER ;
-- Call the stored procedure
CALL FirstProc();
-- remove the stored procedure
DROP PROCEDURE FirstProc;

Well, that’s it. We have successfully created our stored procedure.

It is worth noting that in MariaDB and MySQL when you create the stored prcedure you have to specify parenthesis () after the name of the stored procedure. However, there is no need for the parenthesis when we are dropping the stored procedure.

If you want to start learning MariaDB or MySQL, here is the link where you can learn more about it:

Let me know if you have any good tricks for SQL Server, I will be happy to post on the blog with due credit to you.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on MySQL – MariaDB – Writing the Very First Stored Procedure

MariaDB – MySQL – Show Engines to Display All Available and Supported Engine

$
0
0

My primary job is to help my clients with their SQL Server Performance Problems. The best part of my job is that I get to work with the new client every day on my favorite topic of Comprehensive Database Performance Health Check. Many of my clients are running other RDMBS along with SQL Server. I recently received a question from a client who was using MariaDB, is there any way to know what kind of Engines their version of MariaDB supports. Essentially, they wanted to know command which can Show Engines to Display All Available and Supported Engine in MariaDB.

MariaDB - MySQL - Show Engines to Display All Available and Supported Engine Supported-Engine1-800x255

As you know that MariaDB can be a replacement for MySQL. All the command which works for MySQL usually works for MariaDB. I remembered when I used to work with MySQL, I used a command SHOW ENGINES, I asked them to see if that works for them on MariaDB or not. Indeed it worked.

Here is the command which will display all available and supported engine in MariaDB.

SHOW ENGINES

Here is the output of the above command when I ran the same on my version of MariaDB which is 10.4.8.

MariaDB - MySQL - Show Engines to Display All Available and Supported Engine Supported Engine

I also realized that InnoDB is a default database engine for MariaDB because it supports transactions, foreign keys, and row-level locking.

It is very clear from the result of what is transactions and savepoint transactions. The letters XA stands for XA transactions are designed to allow distributed transactions, where a transaction manager (the application) controls a transaction that involves multiple resources.

If you want to start learning MariaDB or MySQL, here is the link where you can learn more about it:

Let me know if you have any good tricks for SQL Server, I will be happy to post on the blog with due credit to you.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on MariaDB – MySQL – Show Engines to Display All Available and Supported Engine

SQL SERVER – Upgrade Rule Failure Error: No Custom Security Extensions

$
0
0

A few days ago, I wrote a blog about the issue with the SQL Server upgrade where issue was due to Reporting Services installation in a bad state. Here is the link for that blog. SQL SERVER – Upgrade Error: The Specified Service Does Not Exist as an Installed Service. Let us learn about upgrade the rule failure error in this blog post and learn how we can fix the error.

SQL SERVER - Upgrade Rule Failure Error: No Custom Security Extensions upgrade-error1-800x203

As soon as I posted that blog, the very same day, I was contacted by a client who was having a different issue due to SSRS installed and rule checks were failing. Here were the errors which we were seeing.

SQL SERVER - Upgrade Rule Failure Error: No Custom Security Extensions ssrs-upg-err-01

There was also an HTML report, which had the below details.

  • No Custom Security Extensions.
  • The Report Server has some custom security extensions configured.
  • No Custom Authentication Extensions.
  • The Report Server has some custom authentication extensions configured.

WORKAROUND/SOLUTION – Rule Failure Error

I am not an expert in SQL Server Reporting Services (SSRS), so I searched on the internet and found many solutions. The solution which worked for my client was to change the SSRS security extension to the default extension in rsreportserver.config and performed the upgrade.

Alternatively, if you are not using SSRS then you can uninstall and perform the upgrade. As I always say – please take a backup before you make any changes. In this situation, take a backup of the ReportServer database, ReportserverTempDB database, encryption keys and also a backup of the Reporting services folder. Once you have taken a backup, follow below:

  • Locate RSReportServer.config file and make a copy (for reference purpose)
  • Search for <Authentication> and look for <Authentication> tag where extensions are located.
  • Remove content within the tag. It would look like below.

<Security>
</Security>
<Authentication>
</Authentication>

  • Restart SSRS Service.
  • Perfmon in-place upgrade.
  • Reconfigure the extensions by putting back the tags. You also need to know that the new RSReportServer.config file is located in a new location after the upgrade. If there are any supporting DLLs needed, you need to copy them as well.

Luckily, my client as aware of the steps to enable the extension so I didn’t pay much attention to post-upgrade steps.

If you find more details, please share it via comments.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Upgrade Rule Failure Error: No Custom Security Extensions

SQL SERVER – Error 17182: Unable to Initialize SSL Support. The Client and Server Cannot Communicate, Because They do Not Possess a Common Algorithm

$
0
0

One of my existing clients contacted me to provide assistance in an issue where they were not able to install SQL Server 2014. In this blog, we would learn about fixing error “Unable to Initialize SSL Support. The client and server cannot communicate, because they do not possess a common algorithm” which might be seen in SQL Server ERRORLOG and can cause SQL startup failures.

SQL SERVER - Error 17182: Unable to Initialize SSL Support. The Client and Server Cannot Communicate, Because They do Not Possess a Common Algorithm sslsupport-800x217

Here is the relevant information from ERRORLOG which would help you in comparing error numbers, hex codes etc. to make sure that the solution given in the blog works for you.

The server could not load the certificate it needs to initiate an SSL connection. It returned the following error: 0x80090331. Check certificates to make sure they are valid.

Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.

Error: 17182, Severity: 16, State: 1.

TDSSNIClient initialization failed with error 0x80090331, status code 0x80. Reason: Unable to initialize SSL support. The client and server cannot communicate, because they do not possess a common algorithm.

Error: 17182, Severity: 16, State: 1.

TDSSNIClient initialization failed with error 0x80090331, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. The client and server cannot communicate, because they do not possess a common algorithm.

Error: 17826, Severity: 18, State: 3.

Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.

Error: 17120, Severity: 16, State: 1.

SQL Server could not spawn FRunCommunicationsManager thread. Check the SQL Server error log and the Windows event logs for information about possible related problems

During my discussion with another client, I had a discussion about TLS and possible errors. One of the errors which I remembered was “The client and server cannot communicate, because they do not possess a common algorithm.” Here is the article from Microsoft about SQL Server support for TLS.

TLS 1.2 support for Microsoft SQL Server

WORKAROUND/SOLUTION

Since we know that this is due to the version of SQL which doesn’t s support TLS 1.2.

  • Disabled TLS 1.2 and Enabled TLS 1.0 and TLS 1.1
  • Reboot the server.
  • If error came during installation, then uninstall SQL Server.
  • Reinstall SQL Server and it should start as TLS 1.2 is disabled.
  • Applied patch (refer link above) that is necessary to support TLS1.2
  • Enabled TLS1.2 again and disabled TLS1.0 and TLS 1.1.
  • Reboot once again.
  • Test connectivity to the SQL Server.

Here is the registry key which is for TLS 1.0. The same key and values are applicable for other TLS keys also like TLS 1.0, TLS 1.2.

Windows Registry Editor Version 5.00

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0]

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] “Enabled”=dword:ffffffff
“DisabledByDefault”=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server] “Enabled”=dword:ffffffff
“DisabledByDefault”=dword:00000000

Hope this helps someone who is in middle of installation.

Feel free to comment and let me know if there are some other options/solutions available.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Error 17182: Unable to Initialize SSL Support. The Client and Server Cannot Communicate, Because They do Not Possess a Common Algorithm

Guest Posts Invitation and Popular Award

$
0
0

I often get a request for the guest posts and I usually deny them as the purpose of this blog is to share what I am learning every day. However, whenever I travel to various conferences, lots of people share lots of ideas with me which they would love to share with my audience. Many times, I capture them and share on the blog with due credit to them and quite often I just can’t remember them after a week. After my recent trip to a conference, I decided I will open a blog for a week of guest posts and will share the learnings from everyone on the blog with due credit to them.

Guest Posts Invitation and Popular Award guest-posts-800x284

Invitation for Guest Posts

First of all, this invitation to every SQL Enthusiast in the world and we are not limiting it to one technology. As time is very limited, I have created 3 people’s teams of experts who will look at the submission and will provide feedback about the blog posts. The team will decide to publish or not publish the blog post and also will modify it as needed. Please note that once the blog post is published, while we can make modifications it would not be possible to unpublish.

Here are the basic guidelines of the blog posts:

  • Blog posts should contain a minimum of 350 words excluding any code.
  • There should be at least one image of width 800 px.
  • Your blog post should have a Title and Content.
  • It should not be marketing blog posts for any third party vendors or products.
  • The blog should not include any link to any other external webpage. (Not even to the official documentation of SQL product).
  • The blog will contain your name at the beginning of the blog post and link to your twitter or LinkedIn handle or both.
  • Feel free to include your short bio and photograph. (No links)
  • The blog post can be of any SQL technology (or even No SQL is welcome) as long as it is informative and useful.
  • The blog posts will be published from 9 to 13 December 2019. If there are more than 5 guest posts, we will publish them in the week of 16 to 20 December 2019. If we have more than 10 blog posts, we will publish multiple blog posts on certain days.
  • The last date to submit the blog posts is December 2nd, 2019.
  • There is no compensation for the blog posts.

Popular Guest Post Award

Here is the most interesting part of this Guest Post Week. On the 6th of January, the 3 members team will decide the most popular guest post. They will decide this based on the various statistics and not personal opinion.

The winner will be decided with the help of the following statistics:

We will take a blog view for the first 15 days after it’s published date and divide it by 1000 and will keep the integer number to categorized which band it landed. If there are multiple blogs in a single band we will decide the winner based on the number of comments. If there is a further tie, we will announce all tied as a winner. 

Let me give you a simple example of three blog posts with their first 15 days data.

Date 1: Blog A with 6999 Views and 15 comments
Date 2: Blog B with 6001 Views and 25 comments
Date 3: Blog C with 8000 Views and 10 comments

When we look at the statistics we will look at as follows:

Blog A: Band 6 with 15 comments
Blog B: Band 6 with 25 comments
Blog C: Band 8 with 10 comments

The winner will be in the order of Blog C, Blog B, and Blog A.

The top 1 winner will get FREE Access to SQL Server Performance Tuning Practical Workshop – Recorded Classes (worth USD 1000) for one month. If you do not want the free access, you can give it to one of your friends or anyone who has commented on your blog post.

We will not rank any other blog posts or publish any other rankings. 

Submit Your Guest Post

The process to submit the blog post is very simple.

Just send an email to pinal@sqlauthority.com with the title “Guest Post – Title of the Blog Post” before December 2nd. You will get confirmation from me in 24 hours and if the team accepts your blog post they will inform you on December 2nd, 2019.

I think it is going to be a fun party and everyone is welcome to join!

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on Guest Posts Invitation and Popular Award

SQL SERVER – Improving Deployment Performance by SQL Server Monitoring

$
0
0

Why do organizations keep their entire team ready and available when any new deployment is about to happen? Well, the answer is pretty simple: there are many different variables that can go wrong when the new deployment happens. As a performance tuning expert, if anyone brings me a problem my first question is what has changed since the last go-live or deployment when things were all fine. I’m very happy to see changing trends in the industry where people are now accepting that we can improve deployment performance if we apply proper SQL Server Monitoring.

SQL SERVER - Improving Deployment Performance by SQL Server Monitoring deployment-performance-800x190

Improving Deployment Performance

By making monitoring a standard part of your deployment process, you can enable a free-flowing communications channel between your database administration and development teams. A monitoring tool can provide full visibility into server status and deployment impacts, so the two teams can work together to avoid problems affecting your customers.

Monitoring can also help your teams to continuously adjust and improve. It can enable them to work together to tweak performance, anticipate disruptions, and better manage resourcing requirements, ensuring ongoing customer satisfaction.  As demand for more frequent deployments rises, the management of SQL Server availability needs to evolve. Learn why SQL Server monitoring should be part of your deployment process going into 2020.

Call to Action – Download Whitepaper

There are lots of things we can study to make sure that our deployments go smoothly and efficiently. In this free 14-page whitepaper, you’ll learn how SQL Server monitoring can help with:

  • Maintaining availability and security at all stages of the development process.
  • Keeping visibility and communication flowing between DBA and development teams.
  • Removing bottlenecks.
  • Identifying and responding to deployment-related performance issues.
  • Keeping customers happy and their data secure.

Click Here to Download Whitepaper

Let me know your opinion about this topic in the comments area.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Improving Deployment Performance by SQL Server Monitoring


SQL SERVER – Mismatch Between sys.database_files and sys.master_files For TempDB Database

$
0
0

SQL Server is a great product and sometimes some “By Design” behaviors cause interesting unexpected issues which is hard to understand unless you are an expert! In this blog, I would share my knowledge and findings of a situation where there was a mismatch between sys.database_files and sys.master_files for the TempDB database!

One of my existing clients contacted me and information that after restarting SQL Services they started seeing performance issue. I was engaged for performance consulting via my offering On-Demand (50 Minutes). We started GoToMeeting and started troubleshooting. In a short amount of time, I found that they were having contention in the TempDB database. I have them my recommendations to increase the files in the TempDB database. Interestingly, they told that they have already implemented this long ago.

Mismatch Between Files

I checked sys.master_files for tempdb database and sys.database_files.

SELECT * 
FROM sys.master_files 
WHERE database_id = 2
GO
SELECT * 
FROM tempdb.sys.database_files
GO

SQL SERVER - Mismatch Between sys.database_files and sys.master_files For TempDB Database tempdb-missing-01

As we can see above, there is a mismatch of information between those two catalog views. I checked the SQL Server ERRORLOG file and found the below messages.

  • Starting up database ‘tempdb’.
  • Error: 5123, Severity: 16, State: 1.
  • CREATE FILE encountered an operating system error 3(The system cannot find the path specified.) while attempting to open or create the physical file ‘F:\MoreTempDBFiles\temp1.ndf’.

This means that It looks like the functionality of SQL Server that when it is not able to create additional files for tempdb, it would create only 2 default files.

WORKAROUND/SOLUTION

Based on my understanding, there is no way to add new files when SQL is running. We need to find the cause and fix the cause by looking at ERRORLOG and then fix that. Once the root cause is fixed, we need to restart the SQL Server service to get back all the files. In our error message, it was due to path missing. We created the path, restarted SQL Server service and all files were back.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Mismatch Between sys.database_files and sys.master_files For TempDB Database

SQL SERVER – SQL Azure Managed Instance Restore Error – The Database Was Backed Up on a Server Running Version 15.00.2000

$
0
0

Based on the current trend of moving to the cloud platform, there have been many new learnings for me. One of my clients migrated to SQL Azure Managed Instance and contacted me for an interesting situation. In this blog, I am going to share my findings of the error message “The database was backed up on a server running version 15.00.2000. That version is incompatible with this server, which is running version 15.00.2070.” which came when they wanted to restore a backup taken from Managed Instance to a SQL Server 2019 in an on-premise environment. Let us learn how we can resolve the Restore Error.

Below is the error message which they shared with me.

SQL SERVER - SQL Azure Managed Instance Restore Error - The Database Was Backed Up on a Server Running Version 15.00.2000 restoreerror-800x227

Restore Error

Msg 3169, Level 16, State 1, Line 7
The database was backed up on a server running version 15.00.2000. That version is incompatible with this server, which is running version 15.00.2070. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server.
Msg 3013, Level 16, State 1, Line 7
RESTORE DATABASE is terminating abnormally.

WORKAROUND/SOLUTION

That error came as a surprise to me because the major version number is the same on both sides. Notice the version 15.00.2000 and 15.00.2070. Since both are 15.xx.xxxx (SQL Server 2019) it should have worked.

Later, I did some more search and learned more about SQL Server Azure Managed Instance. Here is the relevant information from Microsoft articles which mentions this as a limitation. (FAQ). One of the FAQ is as below:

  1. How can I move a database from managed instance back to SQL Server or Azure SQL Database?
    A. (…removed some text…) Native COPY_ONLY backups taken from managed instance cannot be restored to SQL Server because the managed instance has a higher database version compared to SQL Server.

Another link which talks about the same limitation marked as Important.

A database backup created on a managed instance can only be restored on another managed instance. It cannot be restored to a SQL Server on-premises instance (similar to the way that a backup of a SQL Server 2016 database cannot be restored to a SQL Server 2012 instance).

Due to this limitation, we went ahead with bacpac method.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – SQL Azure Managed Instance Restore Error – The Database Was Backed Up on a Server Running Version 15.00.2000

Centralpoint – Digital Experience Platform with Artificial Intelligence

$
0
0

The biggest advantage of my consulting job is that I get to learn new things every single day when I am helping different organizations solve their SQL Server Performance problems. While working with one of my largest technology clients, I came across very interesting technology which many of you have not heard about it but indeed a flagship Digital Experience Platform with Artificial Intelligence – known as Centralpoint.

Centralpoint - Digital Experience Platform with Artificial Intelligence centralpoint-800x333

Centralpoint, by Oxcyon has made Gartner’s Magic Quadrant for Digital Experience Platforms, and are stirring things up a lot. This company is nearly 20 years old, and boasts nearly 350 clients including the US Congress, about 70 Healthcare Systems, and many others. It is all Microsoft/SQL based and can be installed on-premise or cloud, and they offer some really powerful tools that you just don’t see every day.

Data Transformation Tool

First, there is their data transformation tools, which can ingest or index data from a variety of sources both structured (like Oracle, IBM, SQL, XML) and unstructured (scanning and ingesting from multiple file paths which could include PDF, Word, images, or virtually anything). This is really where Centralpoint gets its name, and with so many disparate silos of information in most organizations, you can imagine the value of being able to search across everything at once.

Not only can Centralpoint aggregate all of your data (or index the links to their actual whereabouts) on a scheduled basis, it can also automatically apply metadata based upon the contents of each file indexed or ingested (this is what they do for the US Congress). Data dictionaries can be imported, to allow each record to be scanned, and based upon matches of the contents, Centralpoint will automatically add the metadata for you. This allows all users to keep dumping their information in file folders, which is easy for them, and Centralpoint will pick it up and ingest it so that it is now searchable online. Culturally this is an interesting twist because most users do not like entering information, and frankly, they are not very good at tagging it properly; so think of this as the ‘enabler’ which allows people to do their job, and depend on Centralpoint to organize the information properly and accurately for them. (Read more details)

Easy Integration

Second, they integrate right out of the box with either AD, LDAP, OATH or SAML, allowing you to maintain multiple web-based initiatives (public, private, employees, clients) all from the same technology. This is why Gartner has them ranked in Digital Experience Platforms, because the way these guys see it, it is about a secure ‘Digital Experience’ for each user, depending on who they are (and their singular or multiple roles they have). Most large enterprise solutions need secure authentication wherein all information is served to each user based upon roles, this global login tool is an agnostic way to do the plumbing easily to ensure each user see only what they are allowed to (employee, client, anyone). (Read more details)

Document Retention Policy Management

The third is their unique approach to the issue of Document Retention Policy Management. Like their data transformation (but working in reverse order) Centralpoint will spider your many systems on a scheduled basis (normally daily) against your retention policies. Here, Centralpoint is detecting records in other systems that should be archived or deleted. When it finds them, it notifies you for approval to delete, and when you give it the thumbs up, it will return to those systems to actually delete or archive the records, maintaining an auditable report of its activities. Here Centralpoint could be considered something of a ‘COMPLIANCE APPLIANCE’  for your sensitive records and the proper expiration of each. (Read more details)

Summary – Call to Action

Lastly, Oxcyon has some really clever tools to make this centralized knowledge ‘portable’ or available to your other web-based applications. This is something they call an AI Assistant or AI Coach, and it empowers you to pop up within other web-based applications you run with the right answer when it is needed. Just think about clients, or customer service representatives fielding a call, able to get to the appropriate answer as fast as possible without leaving their screen. Oxcyon has even integrated it with IVR solutions like Genesys and Cisco, which means the incoming call drivers from the IVR, as they are typed in by the user, search against the knowledge presenting the right answers, sometimes before the call center rep even answers the phone-pretty amazing.

I strongly suggest that you Check Out Centralpoint and Schedule a Demonstration.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on Centralpoint – Digital Experience Platform with Artificial Intelligence

SQL SERVER – Log Shipping Job Error: Failed to Connect to Server

$
0
0

A few days ago, I wrote a blog about log shipping job failure due to missing permission. In this blog, I would share my experience with another log shipping error “Connection Timeout Expired” for which my client contacted me via Comprehensive Database Performance Health Check. As per them restore job was failing with errors. Let us learn how to solve Log Shipping Job Error: Failed to Connect to Server.

SQL SERVER - Log Shipping Job Error: Failed to Connect to Server logshippingerror-800x185

Job Name: LSRestore_<details>
Step Name: Log shipping restore log job step.
Duration: 00:00:23
Message:
<DateTime>*** Error: Could not retrieve restore settings.(Microsoft.SqlServer.Management.LogShipping) ***
<DateTime>*** Error: Failed to connect to server ServerName.(Microsoft.SqlServer.ConnectionInfo) ***
<DateTime>*** Error: Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was – [Pre-Login] initialization=17708; handshake=15341; (.Net SqlClient Data Provider) ***
<DateTime>*** Error: The wait operation timed out() ***
<DateTime>—– END OF TRANSACTION LOG RESTORE     —–

There are few interesting things to note here.

  1. The total job duration is 23 seconds.
  2. Error is “Connection Timeout Expired”
  3. Total time in initialization and handshake = 17708 + 15341 = 33049 which is 33 seconds.
  4. The time taken was due to a pre-login handshake.

WORKAROUND/SOLUTION

There could be multiple reasons for the login process taking the time. It might be due to a busy server or slow domain controller communication or slow network. In short, these errors in the log shipping job indicate that sqllogship.exe is trying to connect to SQL Server and eventually timing out because the connection took longer than the 30 seconds (default value) interval. I observed that my client had too many databases configured for Log shipping and all the jobs were running at the same time. So, I asked them to stagger the jobs so that all are not running at the same time.

Another possible workaround would change the login/connection timeout and set a higher value. When we edit these, we can find that the copy and restore jobs call sqllogship.exe. To avoid the connection timeout errors, we edited this and appended an additional parameter “-logintimeout 60” (without quotes) to the job.

SQL SERVER - Log Shipping Job Error: Failed to Connect to Server ls-timeout-01

This will cause the job to wait for 60 seconds before timing out connecting to the server. This is a documented option in sqllogship.exe.

After adding this parameter, the issue got resolved and the job ran successfully.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Log Shipping Job Error: Failed to Connect to Server

SQL SERVER – Patch Failure – Disk Full: There is Not Enough Disk Space On the Volume

$
0
0

Few of my clients are still running older versions of SQL Server and they have their own reasons to not to move to the new SQL version. In this blog, I would share my findings of how I identified the cause of failure “Disk full: There is not enough disk space on the volume.”

SQL SERVER - Patch Failure - Disk Full: There is Not Enough Disk Space On the Volume diskfull-800x270

Whenever I get a failure of any installation, I always follow official Microsoft documentation:

View and Read SQL Server Setup Log Files

I investigated Summary_<MachineName>_Date.txt file and found an error message.

Detailed results:
Feature: Full-Text and Semantic Extractions for Search
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 1603
Component log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20191229_100959\MSSQLSERVER\sql_engine_core_inst_Cpu64_1.log

Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 1603
Component log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20191229_100959\MSSQLSERVER\sql_engine_core_inst_Cpu64_1.log

Feature: SQL Server Replication
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 1603
Component log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20191229_100959\MSSQLSERVER\sql_engine_core_inst_Cpu64_1.log

SQL SERVER - Patch Failure - Disk Full: There is Not Enough Disk Space On the Volume patch-disk-full-01

As we can see, ALL the failures are pointing us to another file sql_engine_core_inst_Cpu64_1.log and the error code is 1603. As mentioned in Microsoft documentation, I searched for “value 3” (without double quotes) and found the place of failure with an error message in sql_engine_core_inst_Cpu64_1.log.

SQL SERVER - Patch Failure - Disk Full: There is Not Enough Disk Space On the Volume patch-disk-full-02

Here is the error message in text format.

Disk full: There is not enough disk space on the volume ‘D:’ to continue the install with recovery enabled. 131,060 KB are required, but only 48 KB are available. Click Ignore to continue the install without saving recovery information, click Retry to check for available space again, or click Cancel to quit the installation.
Action ended 3:22:05: InstallValidate. Return value 3.
Action ended 3:22:05: INSTALL. Return value 3.

WORKAROUND/SOLUTION – Disk Full

I don’t know if I need to explain the corrective action for the error message we received. Yes, it is about low free space issue on D drive. The correction action would be to move some files around to other drives so that we have enough space on D drive and setup can be completed.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Patch Failure – Disk Full: There is Not Enough Disk Space On the Volume

SQL SERVER – Script Level Upgrade for Database ‘master’ Failed – The Server Principal Owns One or More Availability Group(s) and Cannot be Dropped

$
0
0

I have helped many clients in upgrade failures via my On-Demand consulting and I am amazed to see various ways that can break SQL Server upgrade. In this blog we would learn about fixing error Script level upgrade for database ‘master’ failed because of upgrade step ‘msdb110_upgrade.sql’.

SQL SERVER - Script Level Upgrade for Database 'master' Failed - The Server Principal Owns One or More Availability Group(s) and Cannot be Dropped failed-800x245

Below are few earlier blogs which have other causes of the same error:

This time it was a new error, so I am blogging it. As usual, I asked for ERRORLOG and was looking for the cause of failure.

Error: 15141, Severity: 16, State: 1.
The server principal owns one or more availability group(s) and cannot be dropped.
Error: 912, Severity: 21, State: 2.
Script level upgrade for database ‘master’ failed because upgrade step ‘msdb110_upgrade.sql’ encountered error 15141, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
Error: 3417, Severity: 21, State: 3.
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.

The real cause of upgrade script failure is “The server principal owns one or more availability group(s) and cannot be dropped.”

WORKAROUND/SOLUTION – Level Upgrade

Whenever we have such an upgrade script failure issue and SQL is not getting started, we need to use trace flag 902 to start SQL which would bypass script upgrade mode. This would allow us the find the cause and fix it. So, here are the steps I have done.

As I mentioned earlier, first we started SQL with trace flag 902. I started SQL using trace flag 902 as below via command prompt.

NET START MSSQLSERVER /T902

For named instance, we need to use below (replace instance name based on your environment)

NET START MSSQL$INSTANCENAME /T902

Refer: SQL SERVER – 2005 – Start Stop Restart SQL Server from Command Prompt

As soon as SQL was started, we were able to connect because the upgrade didn’t run. We located “msdb110_upgrade.sql“ file under “C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\Install” folder and executed it in SSMS. We got the exact same error.

Error: 15141, Severity: 16, State: 1.
The server principal owns one or more availability group(s) and cannot be dropped.

This was due to the drop login command in the script. The following statement was the cause of the failure.

IF EXISTS (SELECT * from sys.server_principals WHERE name = '##MS_PolicyEventProcessingLogin##')
BEGIN
    IF EXISTS (SELECT * from sys.server_triggers WHERE name = N'syspolicy_server_trigger')
        DROP TRIGGER [syspolicy_server_trigger] ON ALL SERVER
    DROP LOGIN [##MS_PolicyEventProcessingLogin##]
END
GO

We used the below script to figure out which AG is owned by the above account.

SELECT agrp.[name] AS availability_groups_name
	,agrp.group_id
	,arep.replica_id
	,arep.owner_sid
	,sp.[name] AS owner_name
FROM sys.availability_groups agrp
JOIN sys.availability_replicas arep ON agrp.group_id = arep.group_id
JOIN sys.server_principals sp ON arep.owner_sid = sp.[sid]

To change the ownership below is the command (you need to change the group name).

USE [master]
GO
ALTER AUTHORIZATION ON AVAILABILITY GROUP::SQLAG TO sa;
GO

After this, we stopped SQL Service and started normally (without trace flag). It worked well and the SQL version of updated. I am wondering why someone would change the ownership of AG to ##MS_PolicyEventProcessingLogin## account. If you know the reason, please share it via comments.

You can add me on Linkedin here.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Script Level Upgrade for Database ‘master’ Failed – The Server Principal Owns One or More Availability Group(s) and Cannot be Dropped

SQL SERVER – Event ID 7000 – The System Cannot Find the File Specified

$
0
0

Many times, I feel that I have so many blogs that I must have covered all common possible error related to the usage of SQL Server. But it looks like there are few easy ones which I missed. And thanks to those who take time in sending them to me that it makes a great reminder to what I have missed to date. This blog is from one that came from a DBA from one of my consulting engagements. Let us learn how to fix event id 7000 error.

SQL SERVER - Event ID 7000 - The System Cannot Find the File Specified event-id-7000-800x184

My client told me that they are having an issue with SQL Server Agent. After restarting the operating system, SQL Agent Service didn’t start even though it was set to start automatically. As usual, I started looking around for error messages and fond them below in the event log.

Log Name:      System
Source:        Service Control Manager
Event ID:      7000
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Description:
The SQL Server Agent (MSSQLSERVER) service failed to start due to the following error: 
The system cannot find the file specified.

The message means that Services are trying to start the process (sqlagent.exe) but its failing.

WORKAROUND/SOLUTION – Event Id 7000

When we tried starting it manually, we got below error.

SQL SERVER - Event ID 7000 - The System Cannot Find the File Specified sqlagt-path-err-01

This is the same error that we see in the event log. When I looked into the properties of the service, I found that the path mentioned in “Path to executable” was an invalid path.

SQL SERVER - Event ID 7000 - The System Cannot Find the File Specified sqlagt-path-err-02

The value was “F:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE” -i MSSQLSERVER”

For my client, all binaries are in C: drive and ideally this path should be “C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE” -i MSSQLSERVER”

My client was not sure how it got changed. To change the path defined in “ImagePath”under “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT”

You need to identify the name of the service, shown under “Service name” in the properties. If you have a named instance of SQL Server, then it would be SQLAgent$InstanceName.

SQL SERVER - Event ID 7000 - The System Cannot Find the File Specified sqlagt-path-err-03

After modifying ImagePath, to C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE” -i MSSQLSERVER we were able to start SQL Server Agent Service and the issue was resolved.

Have you ever encountered this error ever in your environments? Do let me know what you did to solve the same.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Event ID 7000 – The System Cannot Find the File Specified


SQL SERVER – SQL Server Agent Missing in SQL Server Configuration Manager

$
0
0

If you search on the internet, you will find various combinations of missing services. One of the common situations is to have ALL SQL related services missing from SQL Server Configuration Manager. In this blog, we would look into a special situation where ONLY SQL Server Agent is missing in SQL Server Configuration Manager.

SQL SERVER - SQL Server Agent Missing in SQL Server Configuration Manager agentmissing-800x228

Long ago, I wrote a blog where the SQL Server Agent node is missing from SQL Server Management Studio.

SQL SERVER – SQL Server Agent Missing in SQL Server Management Studio (SSMS)

The situation which I am going to write about can be explained by pictures in a better way.

Services Control Manager (Services.msc) shows all SQL related services.

SQL SERVER - SQL Server Agent Missing in SQL Server Configuration Manager agt-missing-01

But SQL Server Configuration Manager shows all except SQL Server Agent.

SQL SERVER - SQL Server Agent Missing in SQL Server Configuration Manager agt-missing-02

One of the key points to note here is that SQL Server Agent is not running. When we tried starting SQL Agent Service from Services.msc, it failed. I already wrote a blog to fix the error SQL SERVER – Event ID 7000 – The System Cannot Find The File Specified.

WORKAROUND/SOLUTION – Agent Missing

It looks like SQL Server Configuration Manager is smart to look at the path and not to show the service which is having the wrong path. The fun part is that I was able to make the configuration manager empty was putting incorrect value for the path. I got rid of SQL Server by modifying ImagePath in below key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER

SQL SERVER - SQL Server Agent Missing in SQL Server Configuration Manager agt-missing-03

Earlier screenshot had 6 services and now it became 5.

The moral of the story is that first check if we are able to start the service from services.msc. If yes, then you need to look for other blogs/help. But if you can’t then fix that first and check.

Let me know your feedback about this blog post as I am very much curious to know about it. Just leave a comment.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – SQL Server Agent Missing in SQL Server Configuration Manager

SQL SERVER – SqlServerWriter Missing in vssadmin List Writers Command

$
0
0

There are multiple ways by which we can take a backup of the SQL Server database. One of the methods used by 3rd party providers is using VSS (Volume Shadow Copy Service). One of my clients contacted me that 3rd party backup is failing. After troubleshooting they found that when they run vssadmin list writers command from the command prompt, they are not seeing SqlServerWriter. When they compared with a working machine, they found that the writer is listed. I faced this error with one of my clients of Comprehensive Database Performance Health Check.

SQL SERVER - SqlServerWriter Missing in vssadmin List Writers Command SqlServerWriter-800x182

Here is the command to search for SQLSerevrWriter in the output of vssasdmin list writers.

vssadmin list writers | findstr /I SQLServerWriter

Here is the output on the working machine.

SQL SERVER - SqlServerWriter Missing in vssadmin List Writers Command sqlwriter-missing-01

SqlServerWriter

On the non-working machine, we are seeing no output.

SQL SERVER - SqlServerWriter Missing in vssadmin List Writers Command sqlwriter-missing-02

WORKAROUND/SOLUTION – SqlServerWriter

There might be multiple reasons for SqlServerWriter missing in the output. One of the reasons is the whitespace at the end of the database name.

The easiest way to find if you are running into this is to run the below query.

SELECT name
	,LEN(LTRIM(RTRIM(name)) + '%') 'Length1'
	,LEN(name + '%') 'Length2'
FROM sys.databases
WHERE LEN(LTRIM(RTRIM(name)) + '%') <> LEN(name + '%')

If you see any rows as output, then it means that there is whitespace at the end of the database name. You must fix it to move forward. Note that this needs to be checked on ALL instances running on the machine.

Another issue could be permitted for the SQL Server Writer service account. As per documentation, it must be a Sysadmin in ALL SQL Server instances running on the machine.

Here are some really good blog posts which you can read about parameter sniffing and how you can avoid the problem related to it.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – SqlServerWriter Missing in vssadmin List Writers Command

SQL SERVER – Enable Additional Logging for SQL Server Agent

$
0
0

When I searched for this topic, I was getting blogs where they were talking about additional logging for the job step in SQL Server Agent jobs. In this blog, I would share my learning about logging about SQL Server Agent itself.

Like the ERRORLOG file for SQL Server, there is are files starting with the name SQLAgent, which are the log files for SQL Server Agent. The default is six older files, the same as SQL ERRORLOG. There is one difference though; the current ERRORLOG has no extension whereas current SQLAgent has an extension of .OUT.

SQL SERVER - Enable Additional Logging for SQL Server Agent logging-800x135

Sometimes, during troubleshooting and issue related to SQL Agent itself or for some learning purposes, we may have a need to increase the information written to SQL Agent logs. There are various methods to do this. All of them end up doing the same thing, modify registry settings so that SQL Agent picks it up during restarts and writes verbose messages.

WORKAROUND/SOLUTION – Additional Logging

METHOD # 1 –

If you want to use T-SQL then you can run the below statement in SSMS or another method in SQL Server. This would also need a restart to the SQL Server agent.

USE [msdb]
GO
EXEC msdb.dbo.sp_set_sqlagent_properties @errorlogging_level=7
GO

METHOD # 2

We can increase the logging by using SQL Server Management Studio (SSMS) also. Here is the screen to do that. This is the properties page of SQL Server Agent and “Include execution trace messages” is the option that needs to be checked.

SQL SERVER - Enable Additional Logging for SQL Server Agent sqlagt-log-01

METHOD # 3

As I mentioned earlier, this all settles down to the registry key. It is a key ErrorLogLevel under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL15.MSSQLSERVER\SQLServerAgent as show below.

SQL SERVER - Enable Additional Logging for SQL Server Agent sqlagt-log-02

Based on the version and instance name of SQL Server, two parts in the path would change.

MSSQL15 = this is because I have SQL Server 2019. The last two digits would change based on a version of SQL Server.

SQL Server VersionKey First Part
SQL Server 2012MSSQL11
SQL Server 2014MSSQL12
SQL Server 2016MSSQL13
SQL Server 2017MSSQL14
SQL Server 2019MSSQL15

MSSQLSERVER = This is the instance name given to SQL Server. Since mine is the default instance, its MSSQLSERVER.

Let’s assume that you have SQL Server 2016 and the instance name is PROD then the key would be MSSSQL13.PROD

Once the change is made from any of the methods, the SQL Server Agent service restart is needed to see the change.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Enable Additional Logging for SQL Server Agent

SQL SERVER – Always On Listener Creation Failure – Enabling Object ProdListener Failed With Error 5

$
0
0

In the past, I have written a few blogs where I explained a few issues about the failure of listener creation Failure in a cluster. In this blog, we would see another cause of listener creation failure.

SQL SERVER - Always On Listener Creation Failure - Enabling Object ProdListener Failed With Error 5 listenercreation-800x252

Whenever I get issues while creating a listener in SQL Server, I look at the failover cluster manager to figure out the resource which is failing and then I generate a cluster log. If you are not sure how to generate cluster logs, read my earlier blog on the same topic. SQL SERVER – Steps to Generate Windows Cluster Log?

Here is the setup of my lab. This would help you in co-relating the cluster log from your environment.

  • Listener Name – ProdListener
  • Windows Cluster Name – WinCluster

As I mentioned my listener was failing, which is a client access point in the cluster manager. In the below lines from the cluster log, I have removed the timestamp to avoid clutter.  Here is the trimmed version of the cluster log from the node where the network name resource was not coming online.

INFO [RES] Network Name : AccountAD: Initializing Name: ProdListener, NetbiosName: ProdListener, Type: Singleton, Created: false
INFO [RES] Network Name : AccountAD: PopulateNetnameADState – DCFlags 1073745937 LdapReferralAllowed 0
INFO [RES] Network Name: [NNLIB] FindSuitableDCNew – objectName ProdListener, username – WinCluster$, firstChoiceDCName – \\domain.com
INFO [RES] Network Name: [NNLIB] Found first choice DC that has the object ProdListener DCName – \\domain.com.
INFO [RES] Network Name: [NNLIB] GetOUForVCOCreation – OU name of CNO is OU=IN,DC=Domain,DC=Com
INFO [RES] Network Name: [NNLIB] GetOUForVCOCreation – CNO SID is S-1-5-21-2987268983-2468375096-37832846-293957
INFO [RES] Network Name : AccountAD: Object ProdListener already exists, using DC: \\domain.com
INFO [RES] Network Name: [NNLIB] Trying to enable disabled object ProdListener on DC: \\domain.com (Flags 0000000000001022)
WARN [RES] Network Name : AccountAD: Enabling object ProdListener failed with error 5

In above cluster log, we can see INFO, WARN, ERR which is similar to what we see in windows event logs, Warning, Information and Error. The most relevant error is “Network Name <ProdListener>: AccountAD: Enabling object ProdListener failed with error 5”. This essentially means that Cluster is trying to enable the object and failing with access denied error. They key part here is that this operation is done by “username – WinCluster$”. This is not a domain user but a cluster computer object, also known as CNO.

“Access is denied” error can be caused due to many other reasons which can cause network name or client access point resource in cluster creation to fail. Based on my experience one of the most common causes would be where the Domain Administrator does not allow the CNO “Read All Properties” and “Create Computer Objects” permissions. You might see “Access is denied” in the event log.

WORKAROUND/SOLUTION – Listener Creation

Based on the cluster log snippet, it was clear that a domain admin needs to provide access on VCO to CNO. VCO is a virtual computer object which is a listener in Always On scenario. CNO is a cluster name object which is a computer object for Windows Cluster network name in active directory.

  • Open the Active Directory Users and Computers Snap-in (dsa.msc) on a domain controller.
  • In Menu > View -> check Advanced Features. (Otherwise, we would not see option explained in next steps)
  • Right-click the OU/Container where we want the VCO (ProdListener in above example) to be created and click “New” -> “Computer”
  • Provide a name for the object (This will be Listener Name for AG) and click “OK”.
  • Right-click on the VCO which we just created and select “Properties”. Click the Security tab and then click “Add”:
  • Enter the CNO (Make sure to select “Computers” option in the “Object Types” window) and click “OK”. The CNO is a Cluster Name Object. This is the name of the Windows Cluster name NOT listener or FCI name.
  • Give CNO “Full Control” over the VCO.

After this, we should be able to bring VCO online in the cluster manager. Listener creation also worked and it was a happy ending.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Always On Listener Creation Failure – Enabling Object ProdListener Failed With Error 5

SQL SERVER – SSMS Install Error 0x80070652 – Setup is Blocked Due to Another Install Currently running. Please Let the Other Install Complete and then Restart the Computer if Necessary

$
0
0

While preparing for a demo for my client Comprehensive Database Performance Health Check, I was installing necessary applications on my laptop. In this blog, I would share my experience with SQL Server Management Studio SSMS install error – Setup is blocked due to another install currently running.

The error message which I received was this:

SQL SERVER - SSMS Install Error 0x80070652 - Setup is Blocked Due to Another Install Currently running. Please Let the Other Install Complete and then Restart the Computer if Necessary ssms-install-err-01

I click on the link which was provided in the message above and it opened a file.

[1738:173C][2020-02-12T03:38:32]i000: MainViewModel.OnPackageAction: Install Completed for package Microsoft Visual C++ 2013 Redistributable (x86) – 12.0.30501
[1738:173C][2020-02-12T03:38:32]w350: Applied non-vital package: VCRedistD12x86, encountered error: 0x80070652. Continuing…
[1738:173C][2020-02-12T03:38:32]i000: MainViewModel.OnPackageAction: Install Started for package Microsoft Help Viewer 2.3
[171C:1720][2020-02-12T03:38:32]i301: Applying execute package: HelpViewer2_3, action: Install, path: C:\ProgramData\Package Cache\{BEFC10C1-7032-3C8E-80BC-621A77BFEABD}v2.3.28107\redist\help3_vs_net.msi, arguments: ‘ MSIFASTINSTALL=”7″‘
[171C:1720][2020-02-12T03:38:35]e000: Error 0x80070652: Failed to install MSI package.
[171C:1720][2020-02-12T03:38:35]e000: Error 0x80070652: Failed to execute MSI package.
[1738:173C][2020-02-12T03:38:35]e000: Error 0x80070652: Failed to configure per-machine MSI package.
[1738:173C][2020-02-12T03:38:35]i000: MainViewModel.OnPackageAction: Install Completed for package Microsoft Help Viewer 2.3
[1738:173C][2020-02-12T03:38:35]i319: Applied execute package: HelpViewer2_3, result: 0x80070652, restart: None
[1738:173C][2020-02-12T03:38:35]e000: Error 0x80070652: Failed to execute MSI package.
[1738:173C][2020-02-12T03:38:35]i000: MainViewModel.OnPackageAction: Install Started for package Microsoft Help Viewer 2.3
[1738:173C][2020-02-12T03:38:35]e000: MainViewModel.OnBundleAction: Bundle action failed: Setup is blocked due to another install currently running. Please let the other install complete and then restart the computer if necessary.
[1738:173C][2020-02-12T03:38:35]i399: Apply complete, result: 0x80070652, restart: None, ba requested restart: No
[1738:0F7C][2020-02-12T03:39:38]i000: MainViewModel.OpenUrl: Opening url: C:\Users\Pinal\AppData\Local\Temp\SsmsSetup\SSMS-Setup-ENU_20200212033609.log

WORKAROUND/SOLUTION – SSMS Install Error

I didn’t understand much from the logs but I could see a hex code – “Error 0x80070652: Failed to install MSI package”. I searched on the internet and found that 0x80070652 error code means ERROR_INSTALL_ALREADY_RUNNING. In other words, it means that some previous installation has not been completed successfully.

I was in a hurry and was installing many things together. When I was installing SSMS, at the same time SQL Server installation was also in progress. That explains the error message. Now the interesting part is that there were no needs or restart of my computer. As soon as the SQL Server setup finished, I started SSMS installation again and it went smoothly.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – SSMS Install Error 0x80070652 – Setup is Blocked Due to Another Install Currently running. Please Let the Other Install Complete and then Restart the Computer if Necessary

Viewing all 594 articles
Browse latest View live