Sit back,Relax and Enjoy ! – Unattended uninstall of SQL Server instances


Today I had to remove multiple named instances of SQL2012 RC 0 editions. Suddenly an idea came to my mind. Is there a way were we can remove multiple named instances all at once.

If you look the below screen, you can see that there are multiple instances available in the same server, and I need to remove the first three instances all at once.

If we use add/remove option, then the above screen will only allow us to choose 1 Instance at a time for removal. This was indeed time consuming, and I was thinking of better ways to remove instances all at once.

Is it possible to remove all the required instances at once? Apparently the answer is NO, you cannot remove all the required instances (Selected ones) using GUI.

I was then looking for ways to speed up the whole process of uninstall and then the idea of cmdline uninstall came to my mind. Using command line we can also make the uninstall unattended.This simply means that SQL Server instance can be uninstalled in quite mode without any user interaction.

The below command line statement was quickly prepared, and this helped me with uninstall with more ease, and I don’t have to involve much rather than running the command for the first time.

You will need to run this command from the setup boot strap folder of the respective version of SQL Server

Setup.exe /Action=Uninstall /FEATURES=SQL /INSTANCENAME=SERVER2012B /Q

/Features  = SQL will remove Engine,Replication,Full Text and Data Quality and this option should be used with lot of care.

/Q  = Will do the silent mode work and it’s called as Quite mode.

Conclusion


I found cmdline option as much easy and flexible solution and won’t mind to leverage them for non – production environments.

These cmdline options can also be used for Installation purpose, and I will write about the same during coming days.

Thanks for reading.

Advertisements

Avoid a server reboot while installing SQL Server 2008 R2?


If you are in a situation that you need not want server to be rebooted after SQL Server 2008 R2 install,then follow the below steps

You can bypass the “Restart computer” rule when installing SQL Server 2008 r2 and work around this by following these steps:
1. Open Registry Editor. Click Start –> Run, input “regedit” and press Enter.
2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager, and delete any value in “PendingFileRenameOperations” key.


Can I upgrade SQL Server 2005 Express SP3 to SP4,which setup should I use?


Many people have this question in mind on how they can upgrade exisiting SQL 2005 Express to SP4,which setup should they use.

Answer is –

Microsoft SQL Server 2005 Express Edition Service Pack 4 can be used as a service pack to upgrade existing instances of SQL Servver 2005 Express to SP4, as well for new installations of SQL Server 2005 Express (with SP4).

SQL Server 2005 Performance Dashboard Report Error ‘Difference of two datetime columns caused overflow at runtime’


Recently I was deploying SQL Server 2005 performance dashboard for a SQL Server 2005 Instance and after I ran Setup.SQL I tried to pull the report using performance_dashboard_man.rdl and instantly got an error ‘Difference of two date time columns caused overflow at runtime’.

It was clear that there is issue with DATE conversion and after some research found that a workaround was already in place for the issue. I would like to share this to all my friends –

Workaround –

Open the Setup.SQL script (which is installed along with the performance dashboard – you’ll find it at C:\Program Files\Microsoft SQL Server\90\Tools\PerformanceDashboard\). Find line 276, which says:

sum(convert(bigint, datediff(ms, login_time, getdate()))) – sum(convert(bigint, s.total_elapsed_time)) as idle_connection_time,

and replace this line with

sum(convert(bigint, CAST ( DATEDIFF ( minute, login_time, getdate()) AS BIGINT)*60000 + DATEDIFF ( millisecond, DATEADD ( minute, DATEDIFF ( minute, login_time, getdate() ), login_time ),getdate() ))) – sum(convert(bigint, s.total_elapsed_time)) as idle_connection_time,

This workaround will work for you.

SQL Service failed to start during 2005 install – Multicore Processor Issue


Recently came across an interesting situation where I was installing SQL Server 2005 Developer(RTM) and Enterprise on QA and PRODUCTION environments respectively.

During install I got an error, which said “The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, “How to: View SQL Server 2005 Setup Log Files” and “Starting SQL Server Manually.”

You are prompted to Retry or Cancel the setup.

 I ensured that proper service accounts where used and permissions where set properly, still the issue was not resolved. I was sure that the setup is not corrupted, as the same was used enormous amount of times.

Was going through System configuration and strange fact attracted me, ie number of processors. Both servers had 24 processors. A quick check on Microsoft KB list proved that this was a known issue.

This issue happens when The number of physical cores is not a power of 2.

Fix :

http://support.microsoft.com/kb/954835/en-us

The workaround I used for both PROD and QA was :

Copied sqlservr.exe and sqlos.ddl from a different server which was having the same build which I was expecting for the new servers and pasted the same at Bin directory soon after I get the error message, Retry option was selected and the installation was completed.

Note: You need to patch sql server once again to ensure that it’s in supported state.

Microsoft has ensured that this glitch is resolved in 2008 and SP’s of 2005.Unfortunately 2005 doesn’t support slipstreaming, hence this KB needs to be referred.

I am interested to understand if anyone of you have faced this before.