Monday, July 13, 2020

Move Data From one file to another file in same filegroup in SQL Server

Problem:-

We need to delete the second data file (.ndf) from the database without deleting the data itself.in another saying merge or move data from second data file(.ndf) to Primary data file(.mdf).

Tuesday, January 14, 2020

Fix Large packet loss at the guest level on the VMXNET3 vNIC in ESXi Using Powershell

Problem:-
Most of SQL Server, today hosted on VMware, especially if that Server host very critical databases with high OLTP. When using the VMXNET3 driver on ESXi 4. x, 5. x, 6. x There is a known issue on the VMware regarding the network communications. VMware published an article on this issue. to change the Small Rx Buffer size and Rx Ring #1 Size on the NICs. you see significant packet loss during periods of very high traffic. 

also, the obvious problem if we need to apply that configuration at a very large number of servers, as usual, the answer is Powershell 😊

Sunday, October 20, 2019

Set Jumbo Frames to MAX for Improving Data Transfer Setting using Powershell

Brief about Jumbo Frame:-
a Jumbo frame is something that can have a very positive impact on your network given the right circumstances. The maximum size of a packet on an Ethernet network is typically 1,514 bytes, called the Maximum Transmission Unit (MTU). 
With Jumbo frames, you can transmit packets as large as 9 KB. As you can imagine it takes significantly less effort to send one 9 KB packet as it does many 1,514-byte packets as long as your network supports it. 

Monday, October 14, 2019

Kerberos Configuration Manager issue when retrieve SPN

Problem:- 
If you face below error when trying to connect Locally retrieve SPN using Kerberos Configuration Manager Microsoft tool.

SQL Server Configuration Manager Cannot Connect to WMI Provider

Problem:- 
Hi, when trying to open SQL Server Configuration Manager and it won’t with below error use the below script based on the SQL version to fix it and it will open normally.


Wednesday, September 11, 2019

Determine Hosted SQL Server if running on VM or Physical Using Powershell

Problem:- 
You had hundreds of servers and for any kind of reporting or analysis, you need to know current SQL Server hosted environment if it Virtual or Physical Server, so we will use PowerShell to achieve that goal in a simple way as usual😊

Tuesday, August 20, 2019

Delete Update Cache folder in SQL Server

Problem:-
You got a disk space issue in C drive for more than one production server because of the bad configuration you had inherited.
Or
if you got a question from your system admin about that update cache folder if you needed or not seeking Clean up by this question?

Wednesday, August 14, 2019

Test SQL Server listening ports for hundreds of servers Using Powershell

Problem:-
As one of dba's every day manage hundreds of servers including dealing with lots of connectivity issues between application servers and database servers throw specific port, or because security team perform segregation between clients, apps and database servers bypassing only traffic between source IP and destination IP throw specific port, of course for good reasons including security best practice too.

Tuesday, August 13, 2019

Find sqlcmd.exe Path for SQL Server Using Powershell

Problem:-
In somehow we can’t find sqlcmd.exe location easily and that may be stress in a difficult situation like the down of one critical production server and for that, I figure out a solution for that problem by running below script to find where sqlcmd.exe in my server regardless of the location of SQL Server setup files, commonly that used when using Windows Core as an OS with SQL Server.


I want to point out that yes, we can use Powershell instead by using Invoke-sqlcmd cmdlet. I know not all of us know Powershell and most of us do know T-SQL. Until that changes happen and I expect it will 😃 SQLCMD will be around.

Saturday, August 10, 2019

Connect SQL Server When Lost SA Credential

Problem:-
You may inherited MSSQL Database Server from another dba without any documentation for sysadmin user name and password or lost all password even sa password or sa account is disabled or no one knows the password  or get lab machine without taken a password from your trainer or any good intention reasons 😃