Thursday, April 29, 2010

How to change the server collation in SQL 2008 cluster

I was forced to change the collation sense a crap application didn’t support Latin1 collation. First I was sure that I needed to reinstall wholes SQL server with the correct collation. But after som googling I recognized that this is possible to do if I rebuild the systemdatabases. In books online you can find the solution to run the following setup command:

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts /[ SAPWD= StrongPassword ]
/SQLCOLLATION=CollationName

But when it comes to cluster you have to know these things before running the rebuild command.
1. You have to run it from the cluster node who is holding the instace.
2. The instance name shall not be written with servername\ instansname. Only the instancename shall be here.

Setup /ACTION=REBUILDDATABASE /INSTANCENAME=xxxxxxxx /SQLSYSADMINACCOUNTS=xxxxxxxxx /SAPWD=password /SQLCOLLATION=Finnish_Swedish_CI_AS

Wednesday, April 7, 2010

Unable to start SQL service SSL encryption fails

I did get some lovely errors in the SQL server log when try to start the service

Unable to initialize SSL encryption
because a valid certificate could not be found, and it is not possible to
create a self-signed certificate.
TDSSNIClient initialization failed with error 0x80092004, status code 0x80.
TDSSNIClient initialization failed with error 0x80092004, status code 0x1.v
Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log

My environment was a two node cluster with windows 2008 and SQL 2008, SP1, CLU4. The error just appears on one of the nodes. On the first one SQL start as it shall do.
After a lot of digging I find a solution on the error. I just changed the account running SQL server. My theory is that the account has too many characters in the name. I have no true proof for this but I have seen some other stupid errors when using account over 16 characters. For example I have not been able to change the password or when add a node to a cluster it will not take the password even if I know I type the correct one. Anyone else who has experience about this? Please let me know.

Wednesday, March 17, 2010

Problem to setup a linked server from a x64 edition to 2000 32 bit edition

When I did a setup of a linked server to an old SQL 2000 32 bit server I got this error when trying to do a select on a table in the linked server. There was no problem to setup the linked server.

OLE DB provider "SQLNCLI10" for linked server "BTC_SERVER" returned message "Unspecified error".
OLE DB provider "SQLNCLI10" for linked server "BTC_SERVER" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.".
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI10" for linked server "BTC_SERVER". The provider supports the interface, but returns a failure code when it is used.

For any reason SQL try to use stored procedure that is missing. If I add this sp everything works fine for me.


create procedure [dbo].[sp_tables_info_rowset_64]
@table_name sysname,
@table_schema sysname = null,
@table_type nvarchar(255) = null

as

declare @Result int set @Result = 0
exec @Result = sp_tables_info_rowset @table_name, @table_schema, @table_type

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.