One of my clients approach me that after patching of SQL instances, database mirroring stopped working. As usual, I asked them to share ERRORLOG file SQL SERVER – Where is ERRORLOG? Various Ways to Find ERRORLOG Location . In this blog post we will learn about how to fix error 26023 TCP Port is Already in Use. Here are the interesting messages in ERRORLOG file 2016-11-03 22:11:04.32 spid24s The Service Broker protocol transport is disabled or not configured. 2016-11-03 22:11:04.33 spid18s Database mirroring has been enabled on this instance of SQL Server. 2016-11-03 22:11:04.32 spid24s Error: 26023, Severity: 16, State: 1. 2016-11-03 22:11:04.32 spid24s Server TCP provider failed to listen on [ ‘any’ 5022]. Tcp port is already in use. 2016-11-03 22:11:04.50 spid24s Error: 9692, Severity: 16, State: 1. 2016-11-03 22:11:04.50 spid24s The Database Mirroring protocol transport cannot listen on port 5022 because it is in use by another process. I asked them if they have multiple instances of SQL and other are also using port 5022? They told that they have other instances, but they are not using mirroring. To be doubly sure, I suggested to run from command prompt. netstat -aon | find /I "5022" Here is the output. As we can see above that port 5022 is already in use by PID 1452 (last column) SOLUTION/WORKAROUND We found that PID 1452 was for another instance and it was having an endpoint created on the same port but they were not using Database mirroring. I have asked them to either remove the endpoint from the other instance or if they want to use mirroring, use a different port of an endpoint. Once we deleted the endpoint from another instance of SQL Server and restarted the endpoints here, database mirroring came back to life again. Reference: Pinal Dave ( http://blog.sqlauthority.com ) First appeared on SQL SERVER – FIX – Error: 26023 – TCP Port is Already in Use
↧
Blog Post: SQL SERVER – FIX – Error: 26023 – TCP Port is Already in Use
↧
Blog Post: Linux – How to Change Group and User Ownership of a Directory – using chown & chgrp
In this post, let’s learn how to use chgrp and chown commands to change group and user ownership of a directory On a Linux server, by default, the group owner of a file or directory is the primary group of the user who created the file directory. And it is highly likely in most cases […]
↧
↧
Blog Post: TDE Recovery
This week’s TSQL Tuesday is being held by the mighty Kenneth Fisher – Backup and Recovery- see this link, how can I not get involved with this one? I have been blogging for about a year now and have covered … Continue reading →
↧
Blog Post: SQL SERVER Management Studio – Taking DB Offline Made Easier
I have an appetite to observe and learn from what happens around me more. These are the best ways we realize how life has been gifted to us. Since I have been traveling lately like mad with families where there has been enough vacation filled with some work sporadically, I got to see how my family enjoys the moment they have in hand. I know it is difficult to get the fee time, but it is a great break from the norm. In my recent Europe trip with my family, I was to travel in a train for close to 3+ hours and I was wondering what I am going to do. Obviously, I had some books to kill my time, but I chose not to do that because my daughter was around. As we boarded the train and started our journey, the initial excitement moved to become “What next?” . As I started to think, I saw my daughter quickly jump into her grandfather’s seat and started to say something and they both got busy watching the sky. Getting curious, I was trying to figure out what both were up to. Interestingly, my daughter made-up a game to create shapes and characters from the moving clouds. And both got busy. Let us learn in this blog post how we can take a database offline. This scene is still fresh and has etched into my memories to how the small things in life can still be made enjoyable. The boredom of sitting alone was absorbed by doing something that has been already around you. Well, the story must be experienced as the words don’t do justice to what happened. This brings to one of the tips that I had presented at the Europe tour in one of the sessions. I was playing around with SQL Server Management Studio 2016 and when I was about to take the database to offline mode, I was presented with a neat checkbox to “Drop All Active Connections” as part of the dialog box. Also by side of it is the number of active connections currently that is stopping us from taking the database Offline. If there are no active connections to a database, then the message box would look like as shown below: As you can see, this is a neat addition to the dialog box and the small pleasures of life of something already existing and we never taking notice. I was pleasantly surprised to see this in the SSMS for the first time. Do let me know if you ever encountered such gems hidden inside our tooling that we use every other day. Reference: Pinal Dave ( http://blog.sqlauthority.com ) First appeared on SQL SERVER Management Studio – Taking DB Offline Made Easier
↧
Blog Post: Microsoft R Server 9.0 now available
Microsoft today announced the availability of R Server 9.0 on MSDN and Visual Studio Dev Essentials. This new release is built on top of the latest open source R engine, and comes with several new capabilities. In MRS 9.0, you can combine the algorithms delivered in this package with pre-existing parallel external memory algorithms such as the RevoScaleR package as well as open source tech like CRAN R packages to deliver the best predictive analytics. Read more at https://mspoweruser.com/microsoft-r-server-9-0-now-available-download/ http://www.cio.com/article/3147822/analytics/microsoft-pushes-r-sql-server-integration.html http://dbfriend.blogspot.com/feeds/posts/default?alt=rss
↧
↧
Blog Post: SQL SERVER – Error: 26014 – Unable to Load User-Specified Certificate
After seeing various issues with SQL Server startup problem, I felt that I know almost most of the errors, but I was wrong till someone contacted me with a new error. But I learned that Errorlog is always a good place to start with. SQL SERVER – Where is ERRORLOG? Various Ways to Find ERRORLOG Location . Let us learn in this blog post we are going to learn how to fix unable to load user-specified certificate. Here is what I saw in my client’s machine. 2016-11-03 08:55:09.64 spid9s Server name is ‘SQLSAPPROD\BILLING’. This is an informational message only. No user action is required. 2016-11-03 08:55:09.64 spid9s The NETBIOS name of the local node that is running the server is ‘SQLSAPNODE1’. This is an informational message only. No user action is required. 2016-11-03 08:55:09.64 Server Error: 26014, Severity: 16, State: 1. 2016-11-03 08:55:09.64 Server Unable to load user-specified certificate [Cert Hash(sha1) “FD757A4A777966D5EEB2BD5445D151528E47A62E”]. The server will not accept a connection. You should verify that the certificate is correctly installed. See “Configuring Certificate for Use by SSL” in Books Online. 2016-11-03 08:55:09.64 Server Error: 17182, Severity: 16, State: 1. 2016-11-03 08:55:09.64 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property. Above snippet of ERRORLOG has interesting message “Unable to load user-specified certificate [Cert Hash(sha1) “FD757A4A777966D5EEB2BD5445D151528E47A62E”]. The server will not accept a connection. You should verify that the certificate is correctly installed. See “Configuring Certificate for Use by SSL” in Books Online” The certificate hash value if picked via “Certificate” registry key and once value is picked, certificate store is checked for the certificate (type, subject, thumbprint etc. would be checked) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL . \MSSQLServer\SuperSocketNetLib Below is the registry key on my client’s computer. The value of would be dependent on SQL Server version: MSSQL10 SQL Server 2008 MSSQL10_50 SQL Server 2008 R2 MSSQL11 SQL Server 2012 MSSQL12 SQL Server 2014 MSSQL13 SQL Server 2016 When I asked my client, they said there is no certificate they are using. WORKAROUND If you are not using a certificate, then you can go ahead and clean up the value in the registry. If you are using the certificate, then make sure it is installed correctly and it is having right thumbprint, subject etc. Reference: Pinal Dave ( http://blog.sqlauthority.com ) First appeared on SQL SERVER – Error: 26014 – Unable to Load User-Specified Certificate
↧
Blog Post: NOLOCK
NOLOCK, some say it’s a fast option for queries and will never cause blocking, I say it’s quite dirty and MAY cause blocking. I used to think that a NOLOCK (which is the same as read uncommitted) hint actually meant … Continue reading →
↧
Blog Post: Why won’t my SP work THIS time?
Why won't my SP work? I did this exact thing. You're never too old to do something like this. The post Why won’t my SP work THIS time? appeared first on The MidnightDBA Star-Times .
↧
Blog Post: SQL SERVER – Unable to create login AlwaysOn availability group secondary replica
One of my clients reported a usual behavior of the AlwaysOn availability group. He informed me that he is trying to add a login on the secondary replica in the AlwaysOn AG environment but it is failing with below error: Msg 3906, Level 16, State 1, Line 3 Failed to update database “SCCMDB” because the database is read-only. As a normal troubleshooting, I asked to do it from SQL Server Management Studio and got below error. Create failed for Login ‘TestLogin’. (Microsoft.SqlServer.Smo) Failed to update database “SCCMDB” because the database is read-only. (Microsoft SQL Server, Error: 3906) One strange this which he informed me that it works well on primary replica. I was curious to know why would creating a login would try to write information into a user database? As a part of troubleshooting, I asked to capture a profile trace while reproducing the error. I was able to see that there is a trigger getting fired while creating a login. SOLUTION/WORKAROUND We executed this query SELECT t.name ,t.object_id ,t.is_disabled ,te.type_desc FROM master.sys.server_triggers t INNER JOIN master.sys.server_trigger_events te ON t.object_id = te.object_id And found that there was a DDL trigger defined for the login creation which was logging an entry in SCCMDB. Once we disabled the trigger, the issue was resolved. Reference : Pinal Dave ( http://blog.SQLAuthority.com ) First appeared on SQL SERVER – Unable to create login AlwaysOn availability group secondary replica
↧
↧
Blog Post: Linux – How to generate and configure SSH Key authentication to connect to a remote system
Using SSH keys provide a more secure way of logging into a remote computer when compared to password authentication, and today I will walk you through how we can achieve this in 3 simple steps For this demo I will be configuring SSH key authentication for the user account accountsguru to connect to the remote system mylinuxlab.net, […]
↧
Blog Post: Analysis Services and Power BI: Time-travel, Space-warping and Teleportation
As I visit businesses, consulting clients and training classes, to teach data reporting and analytics; there is a recurring conversation. It is one that I have had for eighteen years. The audiences change and the technology implementations are a little different over time, but the essential conversation is still the same. This happened again last … Continue reading →
↧
Blog Post: SQL SERVER – Clustered Instance Online Error – SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]
While I was playing with SQL Cluster in my lab, I restarted the VMs and found that I was not able to bring SQL Server online. As always I was looking for error message, but there was nothing interesting. Let us see in this blog post how to fix Clustered Instance Online Error. Here were the observations: SQL ERRORLOG is getting created. If I start SQL from the services it runs fine. If I try to bring SQL resource online in the cluster, it stays for “Online Pending” and then it goes to “Failed” state To get more about failure in the cluster, I generated cluster log using steps in my own article. INFO [API] s_ApiGetQuorumResource final status 0. INFO [RES] Network Name: Agent: Sending request Netname/RecheckConfig to NN:5447358a-a102-4fc9-95f4-c040e8716859:Netbios ERR [RES] SQL Server : [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. (268435455) ERR [RES] SQL Server : [sqsrvres] ODBC Error: [HYT00] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0) ERR [RES] SQL Server : [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (268435455) INFO [RES] SQL Server : [sqsrvres] Could not connect to SQL Server (rc -1) INFO [RES] SQL Server : [sqsrvres] SQLDisconnect returns following information ERR [RES] SQL Server : [sqsrvres] ODBC Error: [08003] [Microsoft][ODBC Driver Manager] Connection not open (0) INFO [RES] Network Name: Agent: Sending request Netname/RecheckConfig to NN:52cf277d-234b-4a81-a9a7-0f078fca2a17:Netbios As per cluster logs, the cluster is not able to connect to SQL Service. WORKAROUND / SOLUTION Here are the normal causes of the above error: Incorrect client alias created in the configuration manager SQL Browser isn’t running when SQL is listening on a non-default port or a named instance. TCP port connection issue. I already have detailed checklist for common causes. SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) In my lab, I found that I had a TCP alias created and port of SQL Server was changed after reboot, causing the SQL cluster issue. To fix that forever, I changed SQL Server to listen on a static port instead of dynamic port. Have you ever encountered same situation where the cluster log has helped you? Reference: Pinal Dave ( http://blog.SQLAuthority.com ) First appeared on SQL SERVER – Clustered Instance Online Error – SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]
↧
Blog Post: Monday Coffee 2016-12-12
Speaking and presenting One of my biggest fears is public speaking and judging by this article , I’m not alone. However it’s something that I’ve always wanted to do and as such this year I’ve done a few lightening talk sessions at various events. For those that don’t know, a lightening talk is a short (5 to 15 min) session on any subject that you are free to pick and they’re bundled up together so you’ll get 4/5 speakers within an hour. They’re a great way to get into public speaking, the time goes incredibly fast and there’s no time for Q&A afterwards (usually). I would advise anyone looking to get into presenting to do a couple of these sessions first, just to get a feel for it. I’d also say that, as the session is so short, you should memorise your entire presentation. Practice it over and over so that you can do it in your sleep! I’d also say that even though I’ve just said you need to memorise your presentation, don’t have a script that you need to stick to. If you plan what you’re going to say word for word and lose your way, you’ll get lost and find it difficult to recover. Instead have a general guide in your head that allows for things to be moved around a bit. Now demos, if you’re going to do a demo, it needs to be flawless. There’s no time for you to be fixing things. There’s also no time for typing so have everything prepared to be run immediately. Time is short but I’ve seen a few great demos done in lightening talks! Hopefully that’s a bit of advice that will help you out if you’re thinking of doing one of these talks. I’m going to move onto some longer talks in 2017, I’ll post up any that I do and let you know how they go! Thanks for reading.
↧
↧
Blog Post: SQL SERVER – Error After Cluster Patching – Error: 5184, Severity: 16, State: 2
During my last consulting engagement, I was pulled by my client to consider an issue which they were facing. They informed that they have applied service pack on one of their clustered environment and since than SQL Server is not coming online. I asked to share ERRORLOG from the SQL instance. SQL SERVER – Where is ERRORLOG? Various Ways to Find ERRORLOG Location . Let us learn about how to fix error after cluster patching. 2016-11-20 21:09:49.44 spid9s Starting execution of PREINSTMSDB100.SQL 2016-11-20 21:09:49.44 spid9s —————————————- 2016-11-20 21:10:01.67 spid9s Error: 5184, Severity: 16, State: 2. 2016-11-20 21:10:01.67 spid9s Cannot use file ‘D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\temp_MS_AgentSigningCertificate_database.mdf’ for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it. 2016-11-20 21:10:01.67 spid9s Error: 1802, Severity: 16, State: 1. 2016-11-20 21:10:01.67 spid9s CREATE DATABASE failed. Some file names listed could not be created. Check related errors. 2016-11-20 21:10:01.67 spid9s Error: 912, Severity: 21, State: 2. 2016-11-20 21:10:01.67 spid9s Script level upgrade for database ‘master’ failed because upgrade step ‘sqlagent100_msdb_upgrade.sql’ encountered error 598, state 1, severity 25. 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. 2016-11-20 21:10:01.67 spid9s Error: 3417, Severity: 21, State: 3. 2016-11-20 21:10:01.67 spid9s 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. 2016-11-20 21:10:01.67 spid9s SQL Trace was stopped due to server shutdown. Trace ID = ‘1’. This is an informational message only; no user action is required. The start of the problem is Error: 5184, Severity: 16, State: 2. If we look at error message is clear that the D drive is not having dependency with the SQL Server resource. We checked failover cluster manager and found below. As we can see we have only cluster disk 4 which was E drive. We added by clicking on a highlighted area. Once we added the disk we found that issue was still not solved and SQL was not coming online. Checked ERRORLOG again and found a new problem. 2016-11-20 21:09:48.32 Logon Error: 18456, Severity: 14, State: 11. 2016-11-20 21:09:48.32 Logon Login failed for user ‘NT AUTHORITY\SYSTEM’. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: 100.168.11.171] I asked them series of action and they informed that they have already attempted to rebuild the system databases – which was a news to me. So now the problem was that this login was not existing in SQL Server as System databases were rebuilt. Here were the steps to fix this issue. Start SQL using command prompt NET START MSSQLSERVER /m Added ‘NT AUTHORITY\SYSTEM’ account Stopped SQL Server NET STOP MSSQLSERVER After this we could bring SQL Server online and issue was resolved. Have you seen a similar issue where rebuild was done in the cluster and it didn’t work? Reference: Pinal Dave ( http://blog.sqlauthority.com ) First appeared on SQL SERVER – Error After Cluster Patching – Error: 5184, Severity: 16, State: 2
↧
Blog Post: Announcing Spotlight Developer v6.5
Spotlight Developer v6.5 The key features added in this release SQL Server Discovery. Scanning SQL Server instances can very useful especially in large and dynamic environment. The scan engine can be filtered by constraining IP address range and/or selecting one or more network domains. Each scan result can be kept and used to compare previous scan results. Thus able to determine new instances and retired instances. I will go deeper into this feature in a follow up blog (stay tuned). Configurable Port Numbers. As you are aware Spotlight Developer is multi-tiered. The “client” installed into SSMS, the Diagnostic Server on your network and Spotlight Essentials’ Cloud services. The communication between these use http(s) which means tcp/ip ports are required. The default installation uses ports 443, 60000, 59883. Sometimes customer have installed other vendor software using these one or both port(s) (i.e. 60000, 59883). Thus customers had to find another machine to install. In previous releases these ports where hard coded! Now we have configurable files for both the SSMS component and the Diagnostic Server. Please contact Spotlight Developer support (SpotlightDeveloper@quest.com) to apply non default ports. Fixed an issue when the installer cannot connect to a SoSSE 11.x DS. Some Customer reported difficulty configuring to connect to a Spotlight on SQL Server Diagnostic Server during the install process. The workaround was to install a local Diagnostic Server, then launch Spotlight Developer to change to the desired SQL Server Diagnostic Server via the Settings. Change the support email to spotlightdeveloper@quest.com . Spotlight Developer now has its own support email address (previously shared with Spotlight Cloud services). For you the customer this change has little impact.
↧
Blog Post: Don’t blink you might READPAST it
Following on from my previous post on NOLOCK (https://blobeater.blog/2016/12/09/nolock/) I want to talk about another hint called READPAST. This hint tells the database engine not to read rows that are locked by other transactions. It is best explained with an example. … Continue reading →
↧
Blog Post: SQL SERVER – Performance Analysis of Backup to Azure
It is second to human nature to compare when given options. When I wrote about the blog, SQL SERVER – Playing with Backups and Compression , I did compare some of the space savings one will achieve when working with backups and compression. Though the space savings were significant, one of the blog readers wanted to understand how this would be on time? Is it faster or slower to do the same. I went about taking the same script and I collected the time taken. Let us learn about Performance Analysis of Backup to Azure. SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 0 ms. 10 percent processed…. > 70 percent processed. Processed 53423 pages for database ‘AdventureWorks2016’, file ‘AdventureWorks2016CTP3_Log’ on file 1. 100 percent processed. BACKUP DATABASE successfully processed 93263 pages in 1.970 seconds (369.852 MB/sec). SQL Server Execution Times: CPU time = 140 ms, elapsed time = 2180 ms. SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 0 ms. 10 percent processed…… > Processed 53425 pages for database ‘AdventureWorks2016’, file ‘AdventureWorks2016CTP3_Log’ on file 1. 100 percent processed. BACKUP DATABASE successfully processed 93264 pages in 2.149 seconds (339.052 MB/sec). SQL Server Execution Times: CPU time = 109 ms, elapsed time = 2373 ms. As you can see, there is hardly any difference in time when it comes to working with backup compressions. Even for large backups, the difference is not significant that one can complain as a DBA. On a completely different note, I wanted to play around and see what will be the effect when working with Azure based backup to the URL. I wanted to test the same database and check on performance. I used the following script: On completion of the above script, the backup was taken to a blob as mentioned in the URL. I took the same performance metrics of time to check the difference. It is shown below: SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 0 ms. 10 percent processed. 20 percent processed…. 100 percent processed. BACKUP DATABASE successfully processed 93266 pages in 3.809 seconds (191.293 MB/sec). SQL Server Execution Times: CPU time = 94 ms, elapsed time = 4385 ms. As you can see, in this case the time difference is significant for sure. This is fundamentally because as the backup is being taken, it must be streamed onto Azure in parallel. This increased network bandwidth usage is going to take a toll on the overall process. As you can see based on my small database, it is close to twice the time. In this case, I wanted to bring this to notice because as a DBA we need to make sure this has been considered when working with Backup to Azure. I hope you enjoyed Performance Analysis. On a completely side note, I would love to learn if you are using the backup to Azure capability in your environments? How big are these databases? Do let me know via comments about your experience. Reference: Pinal Dave ( http://blog.sqlauthority.com ) First appeared on SQL SERVER – Performance Analysis of Backup to Azure
↧
↧
Blog Post: Using Non-default Ports for SQL Server
The contentious issue here is the use of a non-default port for SQL Server. The post Using Non-default Ports for SQL Server appeared first on Thomas LaRock . If you liked this post then consider subscribing to the IS [NOT] NULL newsletter: http://thomaslarock.com/is-not-null-newsletter/
↧
Blog Post: SQL SERVER – Discovery Report – How to Find Information About Installed Features?
Many times, we need to find information about the various features / version of SQL Server installed on a machine. If you ask a DBA, he can provide you information by looking at services and tell what all are installed. He might run some WMI/T-SQL queries to list the services of SQL Server and their versions. Let us learn about the Discovery Report. Well, we don’t need a DBA to do that and even Windows Admin (good news for Wintel team J) can do it. The SQL Server setup provides an option called “Installed SQL Server features Discovery Report” under Tools in Installation Center which can provide this information in a single place. Here is the installation center of the Start Menu. Alternatively, we can also double click on setup.exe, which also launches installation center. Once launched, we can go to below option and click it. (Tools > Installed SQL Server features discovery report) Once we click, it would fire setup.exe in the background and report various components installed and provide an HTML page as below. As we can see it shows the version of all components installed not just SQL Engine. Additional information: The SQL Server Discovery Report is saved to %ProgramFiles%\Microsoft SQL Server\ version \Setup Bootstrap\Log\ \SqlDiscoveryReport.htm. In above version would be 100 for SQL 2008 and SQL 2008 r2 110 for SQL 2012 120 for SQL 2014 130 for SQL 2016 … and so on We can also run this same report without coming to UI by running below command from a command prompt. Setup.exe /q /Action=RunDiscovery I have put /q for silent installation. Have ever used this tool? I have used it for one of my clients today and they were surprised to see that they had an evaluation version of SQL installed. Reference: Pinal Dave ( http://blog.sqlauthority.com ) First appeared on SQL SERVER – Discovery Report – How to Find Information About Installed Features?
↧
Blog Post: CHECKDB and Page Restoring from SSMS
Did you know that you can run DBCC CHECKDB (WITH PHYSICAL_ONLY) and issue page restores from SSMS (SQL Server Management Studio). I never, and I probably will never because I rather use TSQL – however I have only just seen … Continue reading →
↧