Friday, December 18, 2009

Problem doing delete against a linkedserver in SQL 2005

I received a problem from one of our customer that a delete statement they run was taking very long time. The query looked like this:

DELETE FROM linkedserver.database.dbo.table
WHERE ID IN (SELECT ID FROM linkedserver.database.dbo.anothertable)

Just to generate the execution plan took nearly one hour. This was realy confused. The select statement in the IN clause took just a second. No to the interesting part of this, when I was looking in the remote server I saw that the server where I run the query did a SELECT * FROM on the table. It is not surprising that the query took long time when the table was on nearly 30GB with 21 million of rows. But why did the query returned all columns? Anyway, after some googling I find out to use OPENQUERY instead. So after changing the query to the following it worked well. Actually I was shrinking the execution time from 1 hour to 2-3 seconds.

DELETE OPENQUERY(linkedserver,
'SELECT * FROM database.dbo.table WHERE ID IN (SELECT ID FROM database.dbo.anothertable)')

Tuesday, November 10, 2009

Faila över diskar i Windows kluster fungerar inte

Vid en failover kommer inte diskarna igång på den andra noden. Lösningen kan vara att disksignaturerna har försvunnigt från registret på den felande noden. Titta i clusterloggen om liknande felet nedan finns:
ERR Physical Disk : Online: Unable to open ClusDisk signature key 5d1005cb. Error: 2

Om så är fallet så titta i registret under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ClusDisk\Parameters\Signatures
Finns inte signaturen där så lägg till den. Lägg sedan till ett stringvärde som heter DiskName och låt det peka ut den disken som det gäller. Tex. \Device\Harddisk3 Titta I diskmanager för att se vilken enhet som mappat till vilken disk.

Tuesday, March 24, 2009

Fulltext Indexing Pausar

Fulltextindexeringen pausar vilket man inte vill. Detta orsakar en fördröjning när klienten skall söka med den. En lösning på detta problem kan vara att den försöker gå ut på Internet för att verifiera, detta kan man sätta av med kommandot sp_fulltext_service 'verify_signature', 0; Läs mer här:
http://support.microsoft.com/kb/915850

Thursday, March 12, 2009

The Distributed Transaction Coordinator service terminated with service-specific error 3221229584

During a cluster maintenance where I removed one of the cluster nodes from the cluster and installed the SQL server as a standard standalone server I went in to problem to start the MSDTC. I got the specified error described above. It was quite simple to find out the solution. When paging thru the Registry I finded a path to the MSDTC log pointing to the old Qorum disk in the cluster. Just change this path and it works fine afterwards.