Wednesday, May 23, 2012

SQL Server 2005 Unintall Issue

While uninstalling SQL Server 2005 from the server i got below errors. After doing 15 minutes of R&D i came to know the solution, Let me explain error details and workaround for this. 

Error Message: 
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\setup.exe ===
MSI (c) (50:A4) [15:39:40:509]: Resetting cached policy values
MSI (c) (50:A4) [15:39:40:509]: Machine policy value 'Debug' is 0
MSI (c) (50:A4) [15:39:40:509]: ******* RunEngine:
           ******* Action:
           ******* CommandLine: **********
MSI (c) (50:A4) [15:39:40:509]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (50:A4) [15:39:40:509]: Grabbed execution mutex.
MSI (c) (50:A4) [15:39:40:525]: Failed to connect to server. Error: 0x80070422

MSI (c) (50:A4) [15:39:40:525]: Failed to connect to server.
MSI (c) (50:A4) [15:39:40:525]: MainEngineThread is returning 1601
=== Verbose logging stopped: 5/11/2012  15:39:40 ===





Workaround:
From above error messages and error log it is very difficult to understand the exact issue, it was not clear at-all. Let me explain workaround to this error. From which server i had uninstalled sql server 2005 is a SOX server, as per SOX Control we have disabled Windows Installer, after enabling and Start the Windows Installer, the uninstall successfully completed without any failure.

Step 1: Click 'Run' from the Start menu. 


Step 2: Type services.msc and click Enter.
 

Step 3: In services check for Windows Installer.

Step 4: Right click on Windows installer and select Properties like below image.


Step 5: After clicking Properties, new pop-up box will open like below.

Step 6:  From Startup type select Automatic, and click apply after that click Start button and click ok. 

Step 7:  Now open Add/Remove program from control panel and follow the uninstall procedure.

How can I completely uninstall SQL Server. Uninstall SQL Server 2008. SQL Server 2008 R2. Uninstall and Remove Multiple Database Instances of Microsoft SQL. How to Uninstall SQL Server. How to complete uninstall SQL Server 2008 R2. how to remove sql server 2000 completly. sql server uninstall cleanup sql server uninstall service pack. sql server uninstall error code 0x84b30002. sql server uninstall named instance. sql server uninstall 0x84b30002. sql server uninstall analysis services. sql server uninstall tool sql server 2008 uninstall. Uninstall SQL SERVER 2005 from command prompt. SQL Server won't uninstall! Databases. How to Uninstall Reporting Services from SQL Server 2008 R2. Not able to uninstall SQL Server 2005 default instance. how to install sql server 2012. How to uninstall an instance of SQL Server 2008. How to manually remove SQL Server 2000 default. How to uninstall SQL Server Management Studio. HOW TO: Remove a SQL Server Service Pack. how to uninstall sql server service pack completly.

Thursday, May 17, 2012

Script To Find Out Heap Tables

Table without a clustered index is called Heap Table. You can find out the heap Table by querying the sys.indexes / sys.partitions against the index_id column. As recommended all tables should have clustered indexes.

Here’s a the script written using dynamic management views that can list all the Heap Tables where Tables without have any clustered Indexes in a SQL Server 2005/2008 Database. 

use AdventureWorks
GO
SELECT SCHEMA_NAME(o.schema_id) AS [Schema]
,object_name(A1.object_id ) AS [Table Name] , B1.rows ,user_seeks ,user_scans
,user_lookups ,user_updates ,last_user_seek ,last_user_scan ,last_user_lookup
FROM sys.indexes A1
INNER JOIN sys.objects o ON A1.object_id = o.object_id
INNER JOIN sys.partitions B1 ON A1.object_id = B1.object_id AND A1.index_id = B1.index_id
LEFT OUTER JOIN sys.dm_db_index_usage_stats ius ON A1.object_id = ius.object_id AND A1.index_id = ius.index_id
WHERE A1.type_desc = 'HEAP'
ORDER BY rows desc

Here is the Out Put of above query:

Clustered Tables vs Heap Tables. Script To Find Out Heap Tables. Script List all heap tables. SQl Server tables to heap or not to heap. Find all HEAP tables in SQL 2000. Find all HEAP tables in SQL 2005. Find all HEAP tables in SQL 2008. Find all HEAP tables in SQL 2008 r2. Find all HEAP tables in SQL 2012. Find Tables Without Primary Keys. Removing Forwarded Records from Heap Tables. table types. Script to find out Heap Table. Table without clustered Index. SQL Server Tables without a Clustered Index. Find all tables that are missing clustered index. Determine fragmentation of HEAP table. Clustered Index Tables and Heap Tables. Heap Structures. Indexes and Index Organized Tables. Heap Table in SQL 2012.

Saturday, May 12, 2012

FIX: SQL Server 2000 Unintall Issue

How to fix errors while uninstalling SQL Server 2000.

This is very simple error but i would like to share workaround for this to all my readers. Yesterday I had trying to Uninstall SQL Server 2000 completely from the server, while doing it is throwing an error like below.



My Server Configuration:
OS version:                              Windows Server 2003
OS service pack:                      Service Pack 2
OS architecture:                      x86
Process architecture:              32 Bit
SQL Server Version:               2000 SP4


Let me explain what are the steps I had taken prior to uninstall SQL Server 2000.

Step 1: I was logged Into the server with full Admin access.
Step 2: Stopped all the SQL Server Services
Step 3: In Control Panel, under Add/Remove programs.
Step 4: Selected default instance of SQL Server 2000, and clicked Remove.

Immediate after clicking remove I got one warning box like below, i was completely ignored and clicked Continue. After clicking continue I got above error.



Workaround:

It is very clear with the above warning box, "There are other users logged on to this computer"

Step 1: Right Click on Task Manager Click  "Task Manager"
Step 2: Select Users
Step 3: Check Is there any other user logged into the server or not?
Step 4: If anyone logged into the server apart from you, then simply select that user and click log-off.
Step 5: Now go to control Panel from Start menu, select Add/Remove programs.
Step 6:  Select default instance of SQL Server 2000, and click Remove.
Step 7:  Now follow the steps.
How can I completely uninstall SQL Server. Uninstall SQL Server 2008. SQL Server 2008 R2. Uninstall and Remove Multiple Database Instances of Microsoft SQL. How to Uninstall SQL Server. How to complete uninstall SQL Server 2008 R2. how to remove sql server 2000 completly. sql server uninstall cleanup sql server uninstall service pack. sql server uninstall error code 0x84b30002. sql server uninstall named instance. sql server uninstall 0x84b30002. sql server uninstall analysis services. sql server uninstall tool sql server 2008 uninstall. Uninstall SQL SERVER 2005 from command prompt. SQL Server won't uninstall! Databases. How to Uninstall Reporting Services from SQL Server 2008 R2. Not able to uninstall SQL Server 2005 default instance. how to install sql server 2012. How to uninstall an instance of SQL Server 2008. How to manually remove SQL Server 2000 default. How to uninstall SQL Server Management Studio. HOW TO: Remove a SQL Server Service Pack. how to uninstall sql server service pack completly.