The SQL Network Interface library was unable to register SPN
20 November 09 08:05 AM




The SQL Network Interface library was unable to register SPN.


Problem

In the SQL Server error log you got the following message:


The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x2098, state: 15. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.

To understand the error you can transcribe the error message 0x2098 in a more readable.

ERROR_DS_INSUFF_ACCESS_RIGHTS

8344 (0x2098)

Insufficient access rights to perform the operation.


This error message indicates that the service account SQL server does not have sufficient rights to register the SPN.


Cause

SPNs are used by the Kerberos authentication protocol. If the account of the proceeding is known, the Kerberos authentication can be used to provide mutual authentication by the client and server. If the account of the proceedings is not known, NTLM authentication, which provides only authentication of the client by the server is used.

If you run SQL Server under the LocalSystem account, the SPN is automatically registered as SQL registering with the machine account that has the right to create an SPN default. So Kerberos interacts successfully with the server running SQL Server.

However, if you run SQL Server under a domain account or a local account, the attempt to create the SPN may fail. When creating the service principal name fails, this means that no SPN is set for the service that is running SQL Server.



Solution


Therefore, you must implement a solution to that the SPN is created for your SQL Server instance where you want to use the Kerberos protocol.


Method 1 : The method recommended by Microsoft Support. You can give in Active Directory rights below to the service account of SQL Server:
- Read servicePrincipalName
- Write servicePrincipalName

Method 2 : You can also give him the rights manually using the tool SetSPN.(http://msdn.microsoft.com/fr-fr/library/cc280459.aspx )

For SQL server Standalone

SetSPN -A MSSQLSvc/<ComputerName>.<DomainName>:<port> <AccountName>

So for a multi-server instance you must configure the SPN for each instance, for each instance of SQL Server usefulness port TCP / IP only. For the port of the proceeding open SQL Server Configuration Manager>> Right click the instance>> TCP / IP protocol (default port)

Pour un cluster

SetSPN -A MSSQLSvc/<virtualName>.<DomainName>:<port> <AccountName>
SetSPN -A MSSQLSvc/<virtualName>.<DomainName> <AccountName>

For an instance of SQL Server cluster, you must use the FQDN of the virtual SQL server. You must also configure the SPN with a port and a second SPN without the port.


Verification

Then you can confirm that the operation went smoothly with the following command:
SetSPN -L <AccountName>

SQL server side to check, you can use the DMV sys.dm_exec_connections with the column auth_scheme :
select auth_scheme from sys.dm_exec_connections where session_id=@@spid
If kerberos is used, you should see "KERBEROS".


Documentation



How to: Enable Kerberos Authentication on a SQL Server Failover Cluster
http://msdn.microsoft.com/en-us/library/ms189585(SQL.90).aspx

Registering a Service Principal Name
http://msdn.microsoft.com/en-us/library/ms191153.aspx

How to configure SQL Server 2005 Analysis Services to use Kerberos authentication
http://support.microsoft.com/kb/917409

How to make sure that you are using Kerberos authentication when you create a remote connection to an instance of SQL Server 2005
http://support.microsoft.com/kb/909801

You cannot start the SQL Server Agent service of a failover cluster of SQL Server 2005 if the build of SQL Server is 3179 or a later build
http://support.microsoft.com/kb/943525

Registering Kerberos Service Principal Names
http://msdn2.microsoft.com/en-us/library/ms178119.aspx

How to Configure the Service Principal Name
http://msdn.microsoft.com/en-us/library/ms942980.aspx

How to troubleshoot the "Cannot generate SSPI context" error message
http://support.microsoft.com/kb/811889

Enable Kerberos authentication for virtual servers
http://technet.microsoft.com/en-us/library/cc780918.aspx

How to: Enable Kerberos Authentication on a SQL Server Failover Cluster
http://msdn.microsoft.com/en-us/library/ms189585(SQL.90).aspx

Best practices for configuring and operating server clusters
http://technet.microsoft.com/en-us/library/cc785714.aspx

How to use Kerberos authentication in SQL Server
http://support.microsoft.com/kb/319723/en-us
Postedby mdegre | 0 Comments    
Changes to the Virtualization Support Policy for SQL Server
08 November 09 10:10 PM



Policy Support for Virtual Environments

Our policy of support for virtual environments has evolved, we now support almost all our applications to virtual environments. Some recommendations are to be considered depending on the product, I invite you to read the articles and using corresponding product below.

Platform for non-Microsoft virtualization, a certification program has been implemented (http://windowsservercatalog.com/svvp ). Only the configurations certified through this program are supported.

For more information, I invite you to visit the following items:

- Virtualization Troubleshooting and Support

- Microsoft server software and supported virtualization environments

- Support policy for Microsoft SQL Server products that are running in a hardware virtualization environment

- Support partners for non-Microsoft hardware virtualization software

- Support policy for Microsoft software running in non-Microsoft hardware virtualization software

- New Microsoft Licensing and Support Eases Path to Virtualization

- Another update for the Support Policy for Virtualization for SQL Server


Microsoft has a Virtualization Support Wizard on the internet that can help them determine if a virtualization configuration is supported: Virtualization Support Policy Wizard


 

Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Postedby mdegre | 0 Comments    
Filed under:
Determining SQL Server Table Size
14 October 09 09:22 AM



Determining SQL Server Table Size

There a few days, I had to identify areas of my database that were taking up the most physical storage space.

The process that the stored procedure goes through is very simple. I create a temporary table to store the individual data elements for each table.

The Script has been tested and used on a SQL Server 2005 and 2008 instance to display the sizes of SQL Server's Database's Tables.


CREATE PROCEDURE getAllTablesSize

AS

BEGIN

      DBCC UPDATEUSAGE (0) WITH NO_INFOMSGS;

      CREATE TABLE

            #temp (

                  [name] varchar(250),

                  [rows] varchar(50),

                  [reserved] varchar(50),

                  [data] varchar(50),

                  [index_size] varchar(50),

                  [unused] varchar(50)

                  );

      INSERT #temp EXEC ('sp_msforeachtable ''sp_spaceused ''''?''''''');

      UPDATE

            #temp

      SET

            [rows] = LTRIM(RTRIM(REPLACE(t.rows,'KB',''))),

            [reserved] = LTRIM(RTRIM(REPLACE(t.reserved,'KB',''))),

            [data] = LTRIM(RTRIM(REPLACE(t.data,'KB',''))),

            [index_size] = LTRIM(RTRIM(REPLACE(t.index_size,'KB',''))),

            [unused] = LTRIM(RTRIM(REPLACE(t.unused,'KB','')))

      FROM #temp AS t

      SELECT

            SUM(CAST([reserved] as decimal))/1024 AS 'Total reserved MB',

            SUM(CAST([data] as decimal))/1024 AS 'Total data MB',

            SUM(CAST([index_size] as decimal))/1024 AS 'Total index_size MB',

            SUM(CAST([unused] as decimal))/1024 AS 'Total unused MB'

      FROM

            #temp

      SELECT

            [name] ,

            CAST([rows] as INT)'rows' ,CAST([reserved] as INT)/1024 'reserved MB',

            CAST([data] as INT)/1024 'data MB' ,

            CAST([index_size]/1024 as INT)'index_size MB',

            CAST([unused] as INT)/1024 'unused MB'

      FROM

            #temp

      ORDER BY

            CAST(reserved as INT) DESC

      DROP  TABLE #temp;

      -- rows : Number of rows existing in the table. If the object specified is a Service Broker queue, this column indicates the number of messages in the queue.

      -- reserved : Total amount of reserved space for objname.

      -- data : Total amount of space used by data in objname.

      -- index_size : Total amount of space used by indexes in objname.

      -- unused : Total amount of space reserved for objname but not yet used.

      -- unused : Total amount of space reserved for objname but not yet used.

      -- More detail here : http://msdn.microsoft.com/en-us/library/ms188776.aspx

 

END

GO

EXECUTE getAllTablesSize

 



Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Postedby mdegre | 0 Comments    
Filed under: ,
SQL Server Management Studio spends over 10 seconds to load
11 October 09 06:22 PM



Problem description
SQL Server Management Studio spends over 10 seconds to load.


Cause
In general, this behavior is due to 2 things:

1. The host computer not has access. By default "SQL Server Management Studio" is configured to use online help resources.

2. The host computer not has access. SSMS tries to go on internet to check for server certificate revocation until "SQL Server Management Studio" got a timeout, is like hanging.


Resolution
To fix the issue, you can follow the 3 steps below :

Step 1 : Following the article : When running "SQL Server Management Studio" the application may load slowly.
http://support.microsoft.com/kb/555686/

Step 2 : Disable "Check for publishers certificate revocation" and "check for server certificate revocation" option under the Internet Explorer -> "Internet Options" -> Advanced".

Step 3 : Add a switch to the Management Studio shortcut by using /nosplash :
Start > Programs > SQL Server 2005 program group > 'SQL Server Management Studio' program.
Then, right-clicking and open the General tab, then select shortcut tab to add 'nosplash' switch.
Sample : "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" /nosplash


These tree steps combined should improve the load time of SQL Server Management Studio.

Enjoy SQL Server :-)





Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Moving Database Files on the secondary server in Log Shipping
25 September 09 11:46 PM


Moving Database Files on the secondary server in Log Shipping

You are using Microsoft SQL Server Logshipping for one of your VLDB (very large database). You would like to move data files on another disk on the secondary server without reconfiguring log shipping.

As you cannot use the detach/attach database, you could follow the way below :

This solution is inspired of the documentation "Moving Database Files" http://technet.microsoft.com/en-us/library/ms345483.aspx


Step 1 : If your secondary is with the option "Standby Mode", you must change by "no recovery mode". And perform a transaction (insert, delete or update)
After, you have to manually run the job of backup, Then the jog of copy and the restore job.

Step 2 : Collect the logical name :

SELECT
  name as logicalname, physical_name as filename
FROM 
  sys.master_files
WHERE
  database_id = DB_ID('yourDatabaseName');

Step 3 : Move the file on the path expected :

ALTER DATABASE yourDatabaseName

MODIFY FILE( NAME = logicalname, FILENAME = 'M:\newpath.mdf')

Step 4 : Stop SQL server service, move the database file and start SQL server Service

Step 5 : Check that the update is ok with the query below :

SELECT
  name as logicalname, physical_name as filename
FROM 
  sys.master_files
WHERE
  database_id = DB_ID('yourDatabaseName');


You can follow the same way to add a file to a log shipped database.






Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Postedby mdegre | 0 Comments    
SQL Server Express 2008
11 September 09 10:08 PM


SQL Server Express 2008 and Service Pack

SQL Server 2008 Express Edition is the new version of MSDE or SQL Server 2005 Express. This version includes SQL Server 2008 is free, easy to use and light. You can compare the various features by looking up the documentation :

- Compare SQL server Editions
- Features Supported by the Editions of SQL Server 2008


You have various version of SQL Server 2008 Express :

Microsoft® SQL Server® 2008 Express Edition
SQL Server 2008 Express is a free edition of SQL Server that is ideal for learning and building desktop and small server applications, and for redistribution by ISVs.

Microsoft® SQL Server® 2008 Express with Tools
Microsoft SQL Server 2008 Express with Tools is a free, easy-to use version of the SQL Server Express data platform. This edition includes graphical management tools that make it easier than ever to start developing powerful data-driven applications for the Web or local desktop.

Microsoft® SQL Server® 2008 Express with Advanced Services
Microsoft SQL Server 2008 Express with Advanced Services is a free, easy-to use version of the SQL Server Express data platform. This edition includes an advanced graphical management tool and powerful reporting features to make it easier than ever to start developing powerful data-driven applications for the Web or local desktop.


As with SQL Server 2005 Express, when a service package is delivered for SQL server SQL Server 2008 Express Edition, a special version is put online including directly the service pack : Microsoft® SQL Server® 2008 Express Edition Service Pack 1 


Donwload SQL Server Express

If your system is? If your system is? If your system is?

Microsoft® SQL Server® 2008 Express Edition with Service Pack 1

X86

X64

WOW64

Microsoft® SQL Server® 2008 Express with Tools

X86

X64

.

Microsoft® SQL Server® 2008 Express with Advanced Services

X86

X64

.

Microsoft® SQL Server® 2008 Management Studio Express

X86

X64

.

Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |

Postedby mdegre | 0 Comments    
Configuring SSIS
08 September 09 11:33 AM


Configure SSIS

When you want to use SSIS with a named instance or cluster or remote, you must configure the SSIS service in accordance with the recommendations of the article below:

Configuring the Integration Services Service
http://msdn2.microsoft.com/en-us/library/ms137789.aspx 

To avoid problems related to the ambiguity of names msdb, you must also change the names of the tag <Name>MSDB</Name>  of file MsDtsSrvr.ini.xml to differentiate each instance.

Código de ejemplo :<?xml version="1.0" encoding="utf-8"?>
<
DtsServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <
StopExecutingPackagesOnShutdown>true</StopExecutingPackagesOnShutdown>
  <
TopLevelFolders>
  <
Folder xsi:type="SqlServerFolder">
  <
Name>MSDB_instanceName</Name>
  <
ServerName>serverName\instanceName1</ServerName>
  </
Folder>
  <
Folder xsi:type="SqlServerFolder">
  <
Name>MSDB_instanceName2</Name>
  <
ServerName>serverName\instanceName1</ServerName>
  </
Folder>
  <
Folder xsi:type="FileSystemFolder">
  <
Name>File System application 1</Name>
  <
StorePath>C:\Packages\application1</StorePath>
    </
Folder>
  <
Folder xsi:type="FileSystemFolder">
  <
Name>File System application 2</Name>
  <
StorePath>C:\Packages\application2</StorePath>
    </
Folder>
  </
TopLevelFolders>
</
DtsServiceConfiguration>

 

Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |   

Postedby mdegre | 0 Comments    
How to insert data from one table to another table
04 September 09 11:45 PM


How to insert data from one table to another table by using SQL Server

There are various ways to insert data from one table to another table. I will present you the most efficently.

Using INSERT INTO

This method is used when the table is already existing in the database. The datas will be inserted into this table from another table.

You don't have to list the columns If columns listed in insert clause and select clause are egual and with the same type. But to avoid any mistake, I recommand you to list each column.

You  can create an Insert From query, when you specify:
- The database table to copy rows to (the destination table).
- The table or tables to copy rows from (the source table).
- The source table or tables become part of a subquery.
- Sort order, if you want to copy the rows in a particular order.
- Group By options, if you want to copy only summary information.

Sample:

CREATE TABLE [tempdb].[dbo].[myTempTable](

      [backup_set_id] [int] NOT NULL,

      [name] [nvarchar](128) NOT NULL,

      [filegroup_id] [int] NOT NULL,

      [filegroup_guid] [uniqueidentifier] NULL,

      [type] [char](2) NOT NULL,

      [type_desc] [nvarchar](60) NOT NULL,

      [is_default] [bit] NOT NULL,

      [is_readonly] [bit] NOT NULL,

      [log_filegroup_guid] [uniqueidentifier] NULL

) ON [PRIMARY]

GO

INSERT INTO [tempdb].[dbo].[myTempTable]  (

         [backup_set_id]

      ,[name]

      ,[filegroup_id]

      ,[filegroup_guid]

      ,[type]

      ,[type_desc]

      ,[is_default]

      ,[is_readonly]

      ,[log_filegroup_guid])

SELECT

         [backup_set_id]

      ,[name]

      ,[filegroup_id]

      ,[filegroup_guid]

      ,[type]

      ,[type_desc]

      ,[is_default]

      ,[is_readonly]

      ,[log_filegroup_guid]

FROM

      [msdb].[dbo].[backupfilegroup]

GO

SELECT * FROM [tempdb].[dbo].[myTempTable] ;

GO

DROP TABLE [tempdb].[dbo].[myTempTable] ;



 Inserting Rows by Using SELECT INTO

With this method you don't need to create the table before the insert. Table will be created when data from one table will be inserted from another table. This new table will be created with same data types as selected columns. SELECT INTO can be used to combine data from several tables or views into one table. It can also be used to create a new table that contains data selected from a linked server.

Sample:

SELECT [backup_set_id]
      ,[name]
      ,[filegroup_id]
      ,[filegroup_guid]
      ,[type]
      ,[type_desc]
      ,[is_default]
      ,[is_readonly]
      ,[log_filegroup_guid]
INTO
      [tempdb].[dbo].[myTempTable]
FROM
      [msdb].[dbo].[backupfilegroup]
GO
SELECT
* FROM [tempdb].[dbo].[myTempTable] ;
GO
DROP TABLE [tempdb].[dbo].[myTempTable] ;


SELECT INTO is non-logged operation when the db is in bulk_logged mode.You can use BCP too... Read the the following article for more info. http://support.microsoft.com/?scid=kb;en-us;Q272093  INSERT INTO is recommended over SELECT INTO since the later requires more lock resources.


Don't ask you which one is  the best. You have to keep in mine that this both solution are different and adapted to a specific value.
 
 
 
 


Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
 
Postedby mdegre | 0 Comments    
Filed under: ,
Microsoft SQL server and Antivirus
26 August 09 09:36 AM


Many of you wondered if it is necessary to use an antivirus on the server hosting your SQL Server Database. Some DBAs will say to not run anti-virus software on a server hosting SQL Server and the other say that you have to do.

In general, Antivirus are to protect file systems, SQL database services are not file services. So, there is not reason to do scans. My 2 cents, if malware gets into the DB, that means it is already past your primary environment anyway and in a far greater position to cause damage.

For this reason, the article KBs below denoting why certain files, folders, DB’s locations must be excluded. The official exceptions in the KB are:
- SQL Server data files (*.mdf, *.ldf, *.ndf)
- Backup files (*.trn, *.tuf, *.bak usually)
- Full text catalog files. This is the FTData folder in SQL Server
- The directory that holds Analysis Services data
- Trace files (*.trc)
- The Log Folder. Something like "MSSQL\Log

Antivirus Software May Cause Problems with Cluster Services
http://support.microsoft.com/kb/250355/en-us


Guidelines for choosing antivirus software to run on the computers that are running SQL Server
http://support.microsoft.com/kb/309422/en-us



However, with the introduction of file streams and remote blob storage on SQL server 2008 there may be situations where the data could be or should be scanned. I invite you to read the article KB below :

Virus scanning recommendations for computers that are running Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows 2000, Windows XP, or Windows Vista
http://support.microsoft.com/kb/822158/en-us



Another important point, some Antivirus are intrusive and are injected into the SQL Server process. This kind of feature can cause serious problems in SQL Server: particular problems of IO, the Hang of Acces_violation. In addition, it's formally not supported see the article KB below. So, take care, when you enable a special option
:-)

The use of third-party detours or similar techniques is not supported in SQL Server
http://support.microsoft.com/kb/920925/en-us




Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer | 
Postedby mdegre | 0 Comments    
Filed under: ,
Installation of SQL Server 2005/2008 clusters on Windows 2003/2008
20 August 09 08:11 PM



Installation SQL Server 2005/2008 failover clusters on MSCS Windows 2003/2008

The installation process between SQL Server 2008 and 2005 failover clusters are different.

With SQL Server 2008 in cluster you must run the setup process for SQL Server individually on each node of the failover cluster. To add a node to an existing SQL Server failover cluster, you must run SQL Server Setup on the node that is to be added to the SQL Server failover cluster instance.

Whereas with SQL Server 2005 must run the setup from the active node. Then a silence installation will be performing automatically on each node.



Windows Server 2003/2008 MSCS validation

Before run the setup SQL Server installation, you must validate the hardware configuration by using the cluster validation wizard for Windows Server 2008 and the Windows Server Catalog (http://www.windowsservercatalog.com/) to search for complete cluster solutions for previous Windows Server versions.

SQL Server 2008 failover clusters and stand-alone instances of SQL Server 2008 are not supported on Windows Server 2008 Server Core.

The Microsoft Support Policy for Windows Server 2008 Failover Clusters
http://support.microsoft.com/kb/943984

Failover Cluster Step-by-Step Guide: Validating Hardware for a Failover Cluster
http://technet.microsoft.com/en-us/library/cc732035.aspx

Clustering and High Availability
http://blogs.msdn.com/clustering/archive/2008/01/18/7151154.aspx

Recommended hotfixes for Windows Server 2003 Service Pack 2-based server clusters
http://support.microsoft.com/kb/935640  



Before the installation
Before to start the installation, I invite you to read the documentation below:

Planning a SQL Server Installation
http://msdn.microsoft.com/en-us/library/bb500442.aspx  

Before Installing Failover clustering
http://msdn.microsoft.com/en-us/library/ms189910.aspx  


Important:
1.  The nodes must share a common disk subsystem.
2.  The nodes must live on the same local area network (LAN)/subnet.*
3.  The nodes must have a network heartbeat with low latency, less the 500ms.


* Separate subnets for cluster nodes: Although Windows Server 2008 failover clusters support separate subnets for cluster nodes, SQL Server 2008 failover clusters do not.


What versions of SQL are supported on Windows 2008 Server R2?
 
•  SQL Server 2005: SP3 is the minimum requirement for all editions of SQL Server 2005 with the exception of SQL Server 2005 Express.

•  SQL Server 2008: SP1 is the minimum requirement for all editions of SQL Server 2008 with the exception of SQL Server 2008 Express
 
 
List of known issues when you install SQL Server 2005 on Windows Server 2008
http://support.microsoft.com/kb/936302/en-us  

List of known issues when you install SQL Server Windows Server 2008 R2
http://support.microsoft.com/kb/955725/en-us  

The Microsoft SQL Server support policy for Microsoft clustering
http://support.microsoft.com/kb/327518/en-us  



Start the installation

Step 1: Pre-check the system to be ready for setup procedure :

o  Stop monitoring services (MOM or equivalent)
o  Stop anti-virus services
o  Verify that Terminal service is NOT running on any cluster node. Log off all Terminal Server/Remote Sessions from all secondary nodes before you start setup for SQL 2005.
o  Ensure that Windows Cryptographic Service Provider and Task Schedule service is running on all nodes.
o  Move disk resource (on which SQL Server will be installed) from 1 node to the other just to make a test.


Step 2: Run the SQL Server setup to properly install the instance :

o  Go on the node owning the targeted cluster group.
o  Use a local copy of the setup folder. Setup files should be based on active machine

How to: Create a New SQL Server Failover Cluster
http://msdn.microsoft.com/en-us/library/ms179530.aspx

Microsoft SQL Server 2005 Failover Clustering on Windows Server 2008
http://support.microsoft.com/default.aspx?kbid=953170

Failover Cluster troubleshooting
http://msdn.microsoft.com/en-us/library/ms189117.aspx
 
Changing SQL Server parameters in a clustered environment when SQL Server is not online
http://support.microsoft.com/kb/953504/en-US
 

Step 3: Post-installation checklist

Install the latest service pack for SQL Server in the article Microsoft Support Policies regarding SQL Server: http://blogs.technet.com/mdegre/archive/2009/07/15/microsoft-support-policies.aspx
 
Move disk resource (on which SQL Server was installed) from 1 node to the other just to make a test  and Run the query below  :

SELECT * FROM sys.dm_os_cluster_nodes
GO
SELECT * FROM sys.dm_io_cluster_shared_drives
GO
SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS')
GO 
SELECT    SERVERPROPERTY('IsClustered') as _1_Means_Clustered ,
  SERVERPROPERTY('Edition') as Edition , 
  SERVERPROPERTY('ProductVersion') as Version , 
  SERVERPROPERTY('ProductLevel') as versionNameWithoutHotfixes,
  SERVERPROPERTY('ResourceVersion') as 'ResourceVersion',
  SERVERPROPERTY('ResourceLastUpdateDateTime') as 'last updated',


SQL Server Failover Clustering White Paper

SQL Server 2005 Failover Clustering White Paper
http://www.microsoft.com/downloads/details.aspx?FamilyID=818234dc-a17b-4f09-b282-c6830fead499&displaylang=en

SQL Server 2008 Failover Clustering White Paper
http://download.microsoft.com/download/6/9/D/69D1FEA7-5B42-437A-B3BA-A4AD13E34EF6/SQLServer2008FailoverCluster.docx

Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Logshipping secondary server is out of sync and LSRestore job failing
11 August 09 07:10 PM




Logshipping secondary server is out of sync and transaction log restore job failing.


Problem
You can see that your logshipping is broken. In the SQL Error log,  the message below is displayed :

Error: 14421, Severity: 16, State: 1.
The log shipping secondary database myDB.logshippingPrimary has restore threshold of 45 minutes and is out of sync. No restore was performed for 6258 minutes.

Description of error message 14420 and error message 14421 that occur when you use log shipping in SQL Server
http://support.microsoft.com/default.aspx?scid=329133



Cause
Inside the LSRestore job history, you can find out two kind of messages  :

- Restore job skipping the logs on secondary server
Skipped log backup file. Secondary DB: 'logshippingSecondary', File: '\\myDB\logshipping\logshippingPrimary_20090808173803.trn'

- Backup log older is missing
*** Error 4305: The file '\\myDB\logshipping\logshippingPrimary_20090808174201.trn' is too recent to apply to the secondary database 'logshippingSecondary'.
**** Error : The log in this backup set begins at LSN 18000000005000001, which is too recent to apply to the database. An earlier log backup that includes LSN 18000000004900001 can be restored.

Transaction Log backups can only be restored if they are in a sequence. If the LastLSN field and the FirstLSN field do not display the same number on consecutive transaction log backups, they are not restorable in that sequence. There may be several reasons for transaction log backups to be out of sequence. Some of the most common reasons are a redundant transaction log backup jobs on the primary server that are causing the sequence to be broken or the recovery model of the database was probably toggled between transaction log backups.


Resolution
At this time, to check if there are a gaps in the Restore Process. You can run the query below to try to find out whether a redundant Backup Log was performed :

SELECT
    s.database_name,s.backup_finish_date,y.physical_device_name
FROM
    msdb..backupset AS s INNER JOIN
   
msdb..backupfile AS f ON f.backup_set_id = s.backup_set_id INNER JOIN
   
msdb..backupmediaset AS m ON s.media_set_id = m.media_set_id INNER JOIN
   
msdb..backupmediafamily AS y ON m.media_set_id = y.media_set_id
WHERE
    (s.database_name = 'databaseNamePrimaryServer')
ORDER BY
    s.backup_finish_date DESC;

Microsoft SQL server logshipping

You can see that another Backup Log was running out of logshipping process. Now, you have just to restore this backup on the secondary and run the LSRestore  Job.




Understanding Logging and Recovery in SQL Server

Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Postedby mdegre | 0 Comments    
Filed under:
Disaster Recovery Plan using Microsoft SQL Server Logshipping
04 August 09 08:41 PM




Disaster Recovery Plan using Microsoft SQL Server Logshipping

The purpose of this post is to give you a quick view of Logshipping with Microsoft SQL Server 2005/2008 for a scenario Disaster Recovery Plan.


Description
The log shipping is a SQL Server to maintain a backup server to date by applying to regular transaction logs of a database on a secondary database An optional third server instance, known as the monitor server, records the history and status of backup and restore operations and, optionally, raises alerts if these operations fail to occur as scheduled.

The principle is simple:
1. Backup of Transaction Log on the primary server
2. Copy of Transaction Log on the primary to the secondary server
3. Restore Transaction Log on the machine secondary

The method of recovery must be in FULL or Bulk-Logged.

Log Shipping Overview
http://msdn.microsoft.com/en-us/library/ms187103.aspx
 


Benefits

• No need for specialized equipment
• Possibility to have multiple secondary servers
• Ability to access the database in read-only secondary
• Possibility to have a cluster on the production site and a simple machine on the backup site


Constraints

• Operating base by base (not server)
• Need to keep the OS on both machines in parallel
• Need to retain both SQL (options, logins, ...)
• Large network bandwidth to copy the databases and logs.
• More input / output discs due to copy transaction logs from one machine to another. It is recommended to stagger the various backup jobs each database.
• Asynchronous operation can thus shift between primary and secondary server. In the case of failover on the secondary site, may be the last transaction logs were not copied, the data from the backup site would then not be in phase with the production site.
• Both machines must be on the same network to communicate and make copies of files. They will have different names.
• Failover and clients connection string must be manually .
• Plan and monitor the capacity directories backup and restore to ensure that storage space is sufficient for newspapers sent.

If you want a solution without data loss synchronous and automatic failover you must choose SQL Server Mirroring instead of Logshipping


Maintenance

• Maintenance must be duplicated on the main server and all secondary servers .
• Any changes to SQL Server such as a configuration change, adding login ... must be made on different servers

Managing Metadata When Making a Database Available on Another Server Instance
http://msdn.microsoft.com/en-us/library/ms187580.aspx



Applying patch or hotfix
• Applying a service pack or hotfix on a SQL Server must be on each machine.SQL Server logshiping allows for rolling patches an upgrades :
- You have to upgrade secondary first
- Then perform a failover
- And upgrade the original primary (now secondary)


Test server backup
• Possible without affecting the production.
• Need to resynchronize the databases on the server after the backup test
• Manual Switches

Failing Over to a Log Shipping Secondary
http://msdn.microsoft.com/en-us/library/ms191233.aspx

Changing Roles Between Primary and Secondary Servers
http://msdn.microsoft.com/en-us/library/ms178117.aspx







Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Migration SQL Server 2000 DTS to SSIS 2005/2008
29 July 09 07:26 AM


Migration DTS packages to SSIS 2005/2008


Setup SSIS with DTS 2000

On the migration of 2000 DTS to SSIS 2005/2008. There are many known issues in the migration of DTS 2000. It is recommended to execute the DTS inside SSIS 2005/2008 without migration. And if you need to edit a DTS in 2000 it will be better to recreate from scratch.

Known issues related to migration packages
SQL Server 2005 : http://msdn.microsoft.com/en-us/library/ms143462(SQL.90).aspx 
SQL Server 2008 : http://msdn.microsoft.com/en-us/library/ms143462.aspx

Support for Data Transformation Services (DTS) in SQL Server 2008
http://msdn.microsoft.com/en-us/library/bb500440.aspx


What should I install for SSIS developers

You will find the answers in the documentation below:

Installing SQL Server Integration Services by Using Setup
SQL Server 2005 : http://msdn.microsoft.com/en-us/library/ms143510(SQL.90).aspx 
SQL Server 2008 : http://msdn.microsoft.com/en-us/library/ms143510.aspx

"When you select Integration Services for installation, Setup also installs support for SQL Server 2000 Data Transformation Services (DTS) packages, including the DTS runtime and DTS package enumeration in SQL Server Management Studio. Run-time support has been updated to allow DTS packages to access SQL Server 2005 data sources. If you are not installing Integration Services, but you need support for DTS packages, then you need to make sure that Legacy Components is selected on the Feature Selection page."

There are some interesting components to you:

Microsoft SQL Server 2000 DTS Designer Components
SQL Server 2005 : http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=fr 

How to: Install Support for Data Transformation Services Packages
http://msdn.microsoft.com/en-us/library/ms143755.aspx  

Microsoft SQL Server 2005 Backward Compatibility Components
SQL Server 2005 : http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=fr
SQL Server 2008 : http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=fr


Sample


With SQL Server Management Studio 2005/2008

Import the package DTS 2000
in SQL Instance >> Management >> Legacy >> DTS : Import

Migrate the package DTS 2000 to SSIS
package Instance >> Management >> Legacy >> DTS : Migrate wizard




Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |

Postedby mdegre | 0 Comments    
Migration SQL Server 2000 to SQL Server 2008
21 July 09 10:00 PM


The purpose of this post is to explain the minimum required for the migration of Microsoft SQL Server 2000 to Microsoft SQL Server 2008. You can use the same principles to migrate a Microsoft SQL Server 2005 to Microsoft SQL Server 2008.


1. SQL server 2008 upgrade advisor

1.1. Before migrating
Microsoft provides a tool called "Microsoft SQL Server 2008 Upgrade Advisor" to alert you of any changes in design between Microsoft SQL Server 2000/2005 and SQL Server 2008. It is strongly recommended to run this software before migration.

1.2. Download
You can download this tool from the link below:

“Download the Microsoft SQL Server 2008 Upgrade Advisor. Upgrade Advisor analyzes instances of SQL Server 2000 and SQL Server 2005 to help you prepare for upgrades to SQL Server 2008.”
http://www.microsoft.com/downloads/details.aspx?familyid=F5A6C5E9-4CD9-4E42-A21C-7291E7F0F852&displaylang=en 

After installation, a new tab appears in: Start>> All Programs >> Microsoft SQL server 2008 >> SQL Server 2008 Upgrade Advisor

1.3. Report before migration
Run “SQL Server 2008 Upgrade Advisor”.
Then click on “Launch Upgrade Advisor Analysis Wizard”.
Then click on "Detect". The tool will automatically select the components installed on your platform.
It is also interesting to give a trace profiler tool containing a representative of your business so that it detects all the elements that would longer supported or recommended in Microsoft SQL Server 2008.
migration SQL Server 2005 to SQL Server 2008

Then configure the connection to your SQL server 2000 instance. After a few minutes a report will be generated with warning or points on which you must bring your attention. These items may include Full Text Search, replication, objects that no longer exist or have been modified in the new version, plans to maintain ...
The tool will provide two other types of information:
1. Objects affected
2. Advice you can find a workaround or fix the problem.

Sample report provided by the tool:
migration SQL Server 2005 to SQL Server 2008

3. Migration with the database restore method

3.1. Restoring a database SQL server 2000
On your new instance Microsoft SQL Server 2008, connect to Management Studio 2008. Then click on the "Restore Database". Then follow the instructions.

RESTORE (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms186858.aspx

How to: Restore a Database Backup (SQL Server Management Studio)
http://msdn.microsoft.com/en-us/library/ms177429.aspx
 
3.2. Compatibility Level SQL 2000/ SQL 2008
If you restore your database in SQL Server 2000 SQL Server 2008, the level of compatibility will default mode "SQL Server 2000 (80).
To know the level of compatibility, Make a right click on the name of the database>> "Property"
Then in the dialog "Database Properties", click "Options"

migration SQL Server 2005 to SQL Server 2008

To enjoy all the new features in the new engine SQL server 2008, you must change the compatibility level to 100.

To know the differences between compatibility 80, 90 or 100, I invite you to read the following article
http://msdn.microsoft.com/en-us/library/bb510680.aspx

sp_dbcmptlevel (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms178653.aspx 
 

3.3. Transferring SQL Server logins and Windows
There are different ways to migrate your users
- SQL Server Intégration Services, with component « "transfer Login task ».
- SQL Server Management Studio, with “Copy Database Wizard”
- You can also draw on examples of script between SQL Server 2000 and 2005 KB Article http://support.microsoft.com/kb/246133

3.4. SQL Server Agent jobs
You can migrate your SQL Server Agent jobs using Enterprise Manager 2000. You can find more detail in the documentation below:

How to script jobs using Transact-SQL (Enterprise Manager)
http://msdn.microsoft.com/en-us/library/aa177024(SQL.80).aspx

3.5. Other components
You must also reconfigure the components such as SQL database Mail extended stored procedures, linked servers...

3.6. Update statistics
It is recommended that, after having committed or changed the compatibility mode to 100, execute the stored procedure: sp_updatestats

The procedure allows sp_updatestats system to recalculate the statistics and make an update for all the statistics on each table in your base data. To avoid errors related to the statistics of the previous version.

sp_updatestats (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms173804.aspx





Related Resources

Resources for Upgrading to SQL Server 2008
http://msdn.microsoft.com/en-us/library/cc936623.aspx
 
SQL Server 2008 Upgrade Technical Reference Guide
http://www.microsoft.com/downloads/details.aspx?FamilyID=66d3e6f5-6902-4fdd-af75-9975aea5bea7&displaylang=en

Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |
Postedby mdegre | 0 Comments    
Which Service Pack do I have to install on SQL Server ?
15 July 09 10:12 AM


The model of delivery patch for Microsoft SQL server follows a very precise process that is described in the following article : http://support.microsoft.com/kb/935897/ 

We always recommend applying the latest Service Pack (SP) for SQL. However, you should apply it only after validation on your test platform.

How to obtain the latest service pack for SQL Server 2000 : http://support.microsoft.com/kb/290211/en-us

How to obtain the latest service pack for SQL Server 2005 : http://support.microsoft.com/kb/913089/en-us

How to obtain the latest service pack for SQL Server 2008 : http://support.microsoft.com/kb/968382/en-us 

What is the policy of publication of the cumulative update?

The Cumulative Updates (CU) should be applied that knowledge to question, to address a specific issue (pro-active or re-active). The systematic application of the last internal CU can lead to changes in unwanted behavior of SQL Server.

Lifecycle Supported Service Packs http://support.microsoft.com/gp/lifesupsps 

SQL Server build :
SQL 2008   
10.0 SP1 CU4 10.00.2734
10.0 SP1 CU3 10.00.2723
10.0 SP1 CU2 10.00.2714
10.0 SP1 CU1 10.00.2710
10.0 SP1 10.00.2531.00
   
10.0 RTM CU8 10.00.1823
10.0 RTM CU7 10.00.1818
10.0 RTM CU6 10.00.1812
10.0 RTM CU5 10.00.1806
10.0 RTM CU4 10.00.1798
10.0 RTM CU3 10.00.1787
10.0 RTM CU2 10.00.1779
10.0 RTM CU1 10.00.1763
10.0 RTM 10.00.1600.22
SQL 2005   
9.0 SP3 CU6 9.00.4230
9.0 SP3 CU5 9.00.4230
9.0 SP3 CU4 9.00.4226
9.0 SP3 CU3 9.00.4220
9.0 SP3 CU2 9.00.4211
9.0 SP3 CU1 9.00.4207
9.0 SP3 9.00.4035
   
9.0 SP2 CU16 9.00.3355 
9.0 SP2 CU15 9.00.3330 
9.0 SP2 CU14 9.00.3328
9.0 SP2 CU13 9.00.3325
9.0 SP2 CU12 9.00.3315
9.0 SP2 CU11 9.00.3301
9.0 SP2 CU10 9.00.3294
9.0 SP2 CU9+MS08-052 9.00.3282
9.0 SP2 CU8 9.00.3257
9.0 SP2 CU7 9.00.3239
9.0 SP2 MS08-040 9.00.3233
9.0 SP2 CU6 9.00.3228
9.0 SP2 CU5 9.00.3215
9.0 SP2 CU4 9.00.3200
9.0 SP2 CU3 9.00.3186
9.0 SP2 CU2 9.00.3175
9.0 SP2 CU1 9.00.3161
9.0 SP2 Rollup 9.00.3152
9.0 GDR MS08-052 9.00.3073
9.0 GDR MS08-040 9.00.3068
9.0 SP2 9.00.3042
   
9.0 SP1 Rollup 9.00.2153
9.0 SP1 9.00.2047
   
9.0 RTM 9.00.1399.06
SQL 2000  
8.0 MS09-004 8.00.2282
8.0 MS08-040 8.00.2273
8.0 SP4 8.00.2039


Microsoft Security Bulletin Search : http://www.microsoft.com/technet/security/current.aspx


The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 1 was released
http://support.microsoft.com/kb/956909 
  
The SQL Server 2008 builds that were released after SQL Server 2008 was released
http://support.microsoft.com/kb/956909/

The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
http://support.microsoft.com/kb/937137/en-us
 
 Michel Degremont | Microsoft EMEA | Product Support Services Developer - SQL Server Core Engineer |

More Posts Next page »

This Blog

Syndication

Page view tracker