Microsoft SQL Server

SQL Server Core Engineer Tips
  • Microsoft SQL Server

    SSAS 2000 : Cannot connect to the repository

    When you try to connect to your instance SSAS 2000, you get the following error messages:
    - Cannot connect to the repository
    - Data source name not found and no default driver specified


    In addition connection strings of the repository are empty : open Analysis Manager >> Edit Conection String >> click right on instance name of Analysis Server. Then clic on "Edit Repository Connection String"…


     
    Cause
    Analysis Services 2000 uses CryptAcquireContext to encrypt / decrypt two registers keys : RemoteRepositoryConnectionString and RepositoryConnectionString.

    These keys contain the connection information for access to the database repository used by Analysis Services. This call fails.

    The connection with a UDL file works as it does not need to contact the repository.


    Resolution
    Show hidden files. Then go to C:\Documents and Settings\<userAccount>\Application Data\Microsoft\Crypto\RSA. And rename the directories that conteint. Upon restart of the service you could edit the connection string.

    If the problem persists, create a new domain account and change the service account of SSAS 2000.


    Related Links
    - Default permissions for the MachineKeys folders
    - Specifying Service Accounts
    - Peer-to-Peer Framework APIs return a "PEER_E_NO_KEY_ACCESS" error message


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

  • Microsoft SQL Server

    Configuring Web Synchronization on Windows 2008 64Bit IIS7 for Merge Replication with SQL CE Subscribers

    • 1 Comments


    It this post, you will see how to configure Web Synchronization for Merge Replication over Windows 2008 X64, specifically for SQL Compact Subscribers. I will not cover each and every aspect of Web Sync or Merge Replication for SQL Compact.

    You could find below a merge of various KB and documentation below:

    -KB920700 : An introduction to SQL Server 2005 Compact Edition
    -KB942040 : Error message when you try to visit a Web page that is hosted on a computer that is running IIS 7.0: "HTTP Error 404.2 – Not Found"
    -KB955966 : SQL Server Compact 3.5 Service Pack 1 Server Tools are not installed in WOW mode when you run IIS 7.0 on a 64-bit Windows Server 2008-based computer
    -KB912430: You cannot replicate data from SQL Server 2005 to SQL Server Mobile Edition by using the 64-bit version of IIS

    Prerequisites.
    a. IIS on your server Windows 2008.

    b. One SQL 2005 Instance installed. (You will use this instance to create a sample publication and test it for SQL Compact Subscribers)

    c. User understanding on general Web Sync and Merge Replication process.


    Step 1.Install the Internet Information Services 6.0 (IIS 6.0) backward compatibility components. To do this, use one of the following procedures:

    a.Click Start, click Administrative Tools, and then click Server Manager.

    b.In the left navigation pane, expand Roles, right-click Web Server (IIS), and then click Add Role Services.

    c.In the Select Role Services pane, scroll down to IIS 6 Management Compatibility.

    d.Click to select the following check boxes:
    IIS 6 Metabase Compatibility
    IIS 6 Management Console
    ISAP Extensions
    CGI
    IIS 7 enable backward compatibility components


    e.In the Select Role Services pane, click Next, and then click Install in the Confirm Installations Selections pane.

    f.Click Close to exit the Add Role Services Wizard.


    Step 2.Start Registry Editor (Start >> Run... >> Regedit). And change the MajorVersion setting to 6 under the following registry subkey:
    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\InetStp

    Step 3.Install :
    How to: Install SQL Server Replication Components
    - Microsoft SQL Server Compact 3.5 Service Pack 2 Server Tools

    - Microsoft SQL Server Compact 3.5 Service Pack 2 for Windows Desktop

     


    Step 4.After the server tools installation has completed successfully, change the MajorVersion setting to 7 under the following registry subkey:
    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\InetStp

    Step 5.Check ISAPI or CGI restriction

    a.On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

    b.In the Connections pane, click the server name.

    c.In the Home pane, double-click ISAPI and CGI Restrictions.

    d.Then check the restriction of sqlcesa35.dll. If not, go in the Actions pane, click Add...

    ISAPI CGI restriction


    Step 6.Check if the application pool are running in 32Bit

    a.On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

    b.In the Connections pane, click the server name.

    c.Then click on Applications Pools

    d.Click right on the pool of your website >> Advanced setting

    e.And update Enable for 32 Bit application to TRUE.
    Enable 32 Bit application IIS 7

    Step 7. At this step, it should be work. Go to your website : http://localhost/.../sqlcesa35.dll?. You should get "Microsoft SQL Server Compact Server Agent" or http://localhost/.../sqlcesa35.dll?diag You should get "SQL Server Compact Server Agent Diagnostics"

     

     

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

  • Microsoft SQL Server

    SQL Server 2008 R2 Digital Tour

    • 0 Comments



    The SQL Server 2008 R2 Digital Tour has started. Find a host of resources on SQL Server 2008 R2, including videos, whitepapers, e-books, events, test drives and downloads . Also check out these related resources:
     

    SQL Server 2008 R2 Books Online
    - SQL server 2008 R2 Training kit
    - Download the Microsoft SQL Server 2008 R2 Trial
    - SQL Server 2008 R2 Update for Developers Training Kit

    SQL Server 2008 R2

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

    Managing memory of Analysis Services instance

    • 0 Comments


    Configuring the memory of your instance Analysis Services

    Microsoft Analysis Services (SSAS) has a capacity to improve performance by making data in cache. SSAS can benefit from increased physical memory. You will find below a summary of the limits of memory 32Bit and 64Bit.

    If your operating system and Analysis Service are in 32Bit
    By default in a 32bit environment, the process "Analysis Service" is limited to 2 GB of memory.

    The modification of the / 3GB memory pushes the limits by default. If you want to allocate more than 2Gb to "Analysis Service", you can add the / 3GB switch in the boot.ini to allow "Analysis Service" to use up to 3 GB of memory. Keep in mind that the / 3GB switch reduces the memory available by the Kernel to 1Gb and thus system contention problems can occur.

    CautionIf the machine has more than the 16Gb / 3GB is not supported.
    The 3GB switch will impact all the software on the server that can allocates more than 2Gb. Such as SQL Server Engine

    Example :
    - By default: 2Gb virtual memory for process SSAS and 2Gb for the Kernel.
    - /3GB : 3Gb of virtual memory for process SSAS and 1GB for kernel

    If your operating system is in 64Bit and Analysis Service in 32 Bit
    If your system is operating in 64-bit and Analysis Service in 32 bits, so the process "Analysis Service" is limited to 4 GB of memory.

    If your operating system and Analysis Service are in 64Bit
    For 64-bit machine, you have no limitations, other than that you configured in the properties of the SSAS instance (and of course the available memory on the machine)


    Configuring an instance SSAS
    You can configure the properties for your SSAS instance from the configuration file MSMDSRV.INI. Before you make a configuration change, you should always make a backup of the file:% \ Microsoft SQL Server \ "Instance Name" \ OLAP \ Config \ msmdsrv.ini. All changes are taken into account immediately after you save the file and without restarting the instance.

    By default an instance "Analysis Service" is set to assume almost all of the memory. The default values are appropriate for the majority of servers that have a single instance and OLAP (Analysis Services). From the moment or you  add an additional instance of OLAP or SQL Server in your server, you must change some settings.

    As for SQL Server with the parameter MEMORY MAX(http://msdn.microsoft.com/en-us/library/ms178067.aspx ), We recommend that you change the property values of the memory instance "Analysis Service" on your server multi-instances. All the properties below the value of which is less than 100 are in% while all values greater than or equal to 100 are in Bytes:

    TotalMemoryLimit : 85
    LowMemoryLimit : 75

    Unlike SQL Server, the value TotalMemoryLimit is not an absolute limit because SSAS can  run a query or processing far exceed this value. Take this as an objective value that the engine is fixed.

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

    Migrating a cube in SQL Server Analysis Services 2005 to SQL Server Analysis Services 2008

    • 0 Comments


    Migrating a cube in SQL Server Analysis Services 2005 to SQL Server Analysis Services 2008

    You should consider migrating your cubes with one of 2 methods below:
    1. Method Backup / Restore (recommended)
    2. By copying the DATA directory on the second server while ensuring the SSAS service is stopped on both servers.

    CautionYou can not move your cube (SQL Server Analysis Services 2005) via a sync to your new server (SQL Server Analysis Services 2008). If you try, you get the error message: Errors in the OLE DB provider. The server returned the following error: (The BackupLog element at line 1, column 904 (namespace ) cannot appear under Envelope/Body/Execute/Command/InternalSynch.)Backup and restore errors: An error occurred while synchronizing the MyDB' database, Database synchronization failed. . The synchronization works only with the same versions of SQL server and the same service pack level.


    Example with the method Backup/Restore:

    Step 1 : Backup of the database on the instance SSAS 2005

    Method using the Wizard
    - In Management Studio, connect to your instance SSAS 2005
    - Click right on database backups
    - Then click on « Back up… »
    - Then select the location of the backup file and click OK

    Method using a script XMLA
    - In Management Studio, connect to your instance SSAS 2005
    - Click on "File" >> "New" >> "Analysis Services XMLA Query"
    - Then execute the code below :

    <Backup xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <
    Object>
    <
    DatabaseID>MyDB</DatabaseID>
    </
    Object>
    <
    File>C:\MyDB.abf</File>
    </
    Backup>


    Step 2 :
    Move the file. Abf to the server that hosts your new instance SSAS 2008

    Step 3 : The last step is to restore the backup file in step 1.

    Method using the Wizard
    - In Management Studio, connect to your instance SSAS 2008
    - Click right on «Databases »
    - Then click on « Restore… »
    - Then select the location of the file to restore and click OK

    Method using a script XMLA
    - In Management Studio, connect to your instance SSAS 2008
    - Click right on "File" >> "New" >> "Analysis Services XMLA Query"
    - Then execute the code below :

    <Restore xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <
    File>C:\MyDB.abf</File>
    <
    AllowOverwrite>true</AllowOverwrite>
    </
    Restore>

    For more information: Managing Backing Up and Restoring (Analysis Services 2008)

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

    How to use the Sqldumper.exe utility to generate a dump file in SQL Server 2008 in T-SQL

    • 0 Comments


    How to use the Sqldumper.exe utility to generate a dump file in SQL Server 2008 in T-SQL

    If you need to generate a full memory dump, automatically when a specific SQL Alert occurs, you can use the script T-SQL below


    declare @pid int
    declare
    @str varchar(1024)
    declare @dumpdir varchar(255)
    declare @sqlbindir varchar(255)

    set @dumpdir = 'C:\'
    set @sqlbindir = 'C:\Program Files\Microsoft SQL Server\100\Shared\'
    set @pid=convert(int, SERVERPROPERTY('ProcessID'))
    set @str = 'cd ' + @sqlbindir + '&& "sqldumper.exe" '+convert(varchar(10), @pid)+' 0 0x0800 0 ' + @dumpdir

    exec xp_cmdshell @str

     More detail about SQLDumper option below :


    Usage: SqlDumper.exe [ProcessID
    [ThreadId [Flags[:MiniDumpFlags] [SqlInfoPtr [DumpDir [ExceptionRecordPtr [ContextPtr [ExtraFile]]]]]]]]
    [-I<InstanceName>]
    [-S<ServiceName>]
    [-remoteservers:[print|dump|freeze|resume|remote:guid\dumporigin\signature\localId\port\operationType]]

      Flags:
        dbgbreak            = 0x0001
        nominidump          = 0x0002
        validate_image      = 0x0004
        referenced_memory   = 0x0008
        all_memory          = 0x0010
        dump_all_threads    = 0x0020
        match_file_name     = 0x0040
        no_longer_used_flag = 0x0080
        verbose             = 0x0100
        wait_at_exit        = 0x0200
        send_to_watson      = 0x0400
        defaultflags        = 0x0800
        maximumdump         = 0x1000
        mini_and_maxdump    = 0x2000
        force_send_to_watson= 0x4000
        full_filtered_dump  = 0x8000

      MiniDumpFlags:
        Normal                           = 0x0000
        WithDataSegs                     = 0x0001
        WithFullMemory                   = 0x0002
        WithHandleData                   = 0x0004
        FilterMemory                     = 0x0008
        ScanMemory                       = 0x0010
        WithUnloadedModules              = 0x0020
        WithIndirectlyReferencedMemory   = 0x0040
        FilterModulePaths                = 0x0080
        WithProcessThreadData            = 0x0100
        WithPrivateReadWriteMemory       = 0x0200
        WithoutOptionalData              = 0x0400
        WithFullMemoryInfo               = 0x0800
        WithThreadInfo                   = 0x1000

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

    Best practice regarding the dependency to the SQL Server resource for the additional disk

    • 0 Comments


    Best practice regarding the dependency to the SQL Server resource for the additional disk.

    If a non-SQL Server resource needs to be added to the SQL Server group and depends on the SQL Server resource being available, Microsoft recommends that you add a dependency on the SQL Server Agent resource instead of adding a dependency on the SQL Server resource.

    In the case where, by mistake, you change the dependency of one disk of SQL Server, you will get the error message below.

    Error 5184: Cannot use file '%.*ls' for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sq...

    So take care when you play with the dependency to the SQL Server resource.


    See also :
    - How to: Add Dependencies to a SQL Server Resource
    - How to create databases or change disk file locations on a shared cluster drive on which SQL Server was not originally installed


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

    How to change the dump directory for SQL Server or SQL Agent

    • 0 Comments


    How to change the dump directory for SQL Server or SQL Agent

     

    SQL Server creates dump files (files with a .mdmp extension) by default under the LOG folder. If you don't know where is this folder, you can run the query below :

    CREATE TABLE #temp (logDate varchar(50), processInfo varchar(50), [Text] text);
    INSERT #temp EXEC ('sp_readerrorlog');
    SELECT [Text] FROM #temp WHERE [Text] like '%Logging SQL Server messages in file%';
    DROP TABLE #temp;

    These dump files are generally created when SQL Server encounters an exception or access violation.


    If you see these kind ofdump files :
    - First, check if you are the last service pack for your SQL server version.
    - If the issue are still facing to this issue,it might be good idea to contact SQL Server Support team to ensure everything is fine with your server.

     

    If your LOG folder is located on a disk drive that doesnt have enough space left on it, you can change that value to a location on a drive that has enough space. So, since SQL 2005, you can change the default dump directory inside Configuration Manager. Don't forget that it's not supported to change the value directly into the Registry.

     

    Step 1: Start the Configuration Manager from Configuration Tools menu.

    Step 2: Double click on SQL Server (instancename) service

    Step 3: And go to ADVANCED tab. You will see the option for DUMP DIRECTORY.

    How to change the dump directory for SQL Server or SQL Agent

    The changes will be applied only after a restart.


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

    Setup SQL Server 2008 : Service SQLBrowser start request failed

    • 0 Comments


    This week I was working on SQL server 2008 setup problem in cluster. But this issue could be occurs also in a standalone installation.


    Action: Run SQL Setup  on the second node. The SQL Server 2008 setup was working fine at the beginning but failing almost at the end of the process with the following error message: SQLBrowser start request failed. Click Retry to retry the failed action, or click Cancel to cancel this action and continue setup


    Result: Unable to add a second node on an existing cluster SQL Server  2008

    SQLBrowser: The last attempted operation: Starting the SQL Server Browser service 'SQLBrowser', and waiting for up to '900' seconds for the process to   complete. .
    Slp: Prompting user if they want to retry this action due to the following failure:
    Slp: ----------------------------------------
    Slp: The following is an exception stack listing the exceptions in outermost to innermost order
    Slp: Inner exceptions are being indented
    Slp:
    Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.ScoException
    Slp:     Message:
    Slp:         Service 'SQLBrowser' start request failed.
    Slp:     Data:
    Slp:       Feature = SQL_Browser_Redist_SqlBrowser_Cpu32
    Slp:       Timing = Startup
    Slp:       DisableRetry = true 


    Resolution:
    I solved this issue by slipstream the setup including SP1 directly. I invite you to follow the article KB below:

    How to update or slipstream an installation of SQL Server 2008
    http://support.microsoft.com/kb/955392

    For answers to frequently asked questions about slipstreaming, see the SQL Server 2008 Slipstream Frequently Asked Questions topic on the following Microsoft Web site:
    http://blogs.msdn.com/petersad/archive/2009/04/24/sql-server-2008-slipstream-frequently-asked-questions.aspx

    Step 1: Download the service pack package that matches you system architecture. For example download the x64 package of SQL Server 2008 Service Pack 1 if your system is an x64-based system.


    Step 2:
    Extract the service pack by running the following command:
    SQLServer2008SP1-KB968369-x64-ENU.exe /x:C:\SQL2008SP1
    slipstream an installation of SQL Server 2008

    Step 3:
    Run the following file to install the setup support files:
    C:\SQL2008SP1\x64\setup\1033\sqlsupport.msi


    Step 4: Run the Setup.exe file from the SQL Server 2008 source media by specifying the /PCUSource parameter. For example:
    Setup.exe /PCUSource=C:\SQL2008SP1
    slipstream an installation of SQL Server 2008

    And finish your installation


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

    Last stored procedures updated with SQL Server Management Studio 2008

    • 0 Comments


    Last stored procedures updated with SQL Server Management Studio 2008

    I would like to share with you a new feature that I found out by using SQL Server Management Studio 2008.

    With SQL Server 2005, I used to run the query below to get the list of the stored procedure whom modified by the developper recently.

    SELECT TOP(10)
                     [name]
    , [object_id], [create_date], [modify_date]
    FROM
                    
    sys.all_objects
    WHERE
                    [type]
    = 'P' AND [object_id] > 0
    ORDER BY
                     [modify_date]
    DESC


    System view : sys.all_objects
    http://msdn.microsoft.com/en-us/library/ms178618.aspx

     


    Now, with SQL Server Management Studio 2008, we can customize the Object Explorer Details window by adding and removing the columns you wish to see. To add and remove columns from the Object Explorer Details window, right-click an existing column and check or uncheck columns from the context menu as shown in the following image.

    Step 1: Open SQL Server Management Studio 2008

    Step 2: Click on view >> Object explorer details

    Step 3: In Object Explorer, connect to an instance of Database Engine and then expand that instance

    Step 4: Expand Databases, expand your database, then expand Programmability. And click on Stored procedures


     SQL 

Server Management Studio last stored procedure updated

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

    SQL Server 2008 R2 Update for Developers Training Kit

    • 0 Comments


    SQL Server 2008 R2 Update for Developers Training Kit
    SQL Server 2008 R2 developer training kit will help you to take advantage of the improvements introduced in SQL Server 2008 and SQL Server 2008 R2 in your application.

    Download :

    - SQL Server 2008 R2 Update for Developers Training Kit
    - SQL Server 2008 Developer Training Kit



    SQL Server 2008 R2

     

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

  • Microsoft SQL Server

    SSMS 2005 on IA64 shuts down suddenly after clicking on "New Query"

    • 0 Comments


    SQL Server Management Studio 2005 on IA64 shuts down

    Problem description
    SQL Server Management Studio 2005 on IA64 crashs when you click on "New Query" button. It shuts down Management Studio automatically.
    This issue arrive when you are on Windows 20003 IA64 and SQL Server 2005 IA 64

    Another symptom is that when you attach the debugger Windbg, the issue doesn't occur.

    This issue occurs just after installing the Security Update from KB 928365 for the .NET Framework 2.0.

    Solution
    You can uninstalled the Security Update from KB 928365 for the .NET Framework 2.0 and apply Microsoft .NET Framework 2.0 Service Pack 1 (IA64). After this the management Studio will work properly.
    http://www.microsoft.com/downloads/details.aspx?FamilyId=32E77AE0-96EF-4ECD-A157-9BF61A7C8DAA&displaylang=en 

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

    Apply a service pack or hotfix SQL Server 2008 to a failover cluster instance

    • 0 Comments




    Apply a service pack or patch SQL Server 2008 in a clustered environment
        Step 1 : Validation wizard
        Step 2 : Pre-check
        Step 3 : Installation of the first node
        Step 4 : Add a new node
        Step 5: Apply a service pack or hotfix on a SQL cluster



    Installing Service Pack SQL Server 2008 in failover cluster is very different than the SQL Server 2005 cluster failover.

    With SQL Server 2005, when you start installing cluster service pack (or hotfix), it must be launched on the active node (node that hosts the instance). When installing the Setup will launch simultaneously  "remote silence" on all passive nodes. All nodes in the cluster containing the SQL Server instance are updated in the same time.

    With SQL Server 2008, to reduce the downtime, we have revised the method of deployment. Now if you want to apply a service pack (or hotfix), you must install in first on the passive nodes. The passive nodes are updated before the active node.

    Therefore, for your instance SQL Server 2008  in failover cluster, you must follow the scenario below for the application of Service Pack, Cumulative Update or Hotfix :

    1.  Apply the hotfix on pasive node N2
    2.  Reboot the passive node N2
    3.  Failover on SQL resource : the passive node become the active node
    4.  Apply the hotfix on the passive node N1
    5.  Reboot the passive node N1

    You can check the version of SQL server with the following query:

    SELECT   

          SERVERPROPERTY('IsClustered') as _1_Means_Clustered ,  
         
    SERVERPROPERTY('Edition') as Edition ,  
         
    SERVERPROPERTY('ProductVersion') as Version  ,
         
         
    SERVERPROPERTY('ComputerNamePhysicalNetBIOS') as ActiveNode

     

    SQL 2008 cluster failover
    SQL 2008 Cluster failover
    SQL 2008 Cluster Failover

    SQL Server 2008 failover cluster rolling patch and service pack process
    http://support.microsoft.com/kb/958734

    How to update or slipstream an installation of SQL Server 2008
    http://support.microsoft.com/kb/955392


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

    End of Service Pack Support for SQL Server 2005 SP2

    • 0 Comments


    End of Service Pack Support for SQL Server 2005 SP2

    Just a reminder, the Service Pack Support for SQL Server 2005 Service Pack 2 (SP2) is ending on January 12, 2010.  Microsoft is ending support for this product as part of our Service Pack support policy, found in http://support.microsoft.com/lifecycle.  SQL Server 2005 SP2 will no longer receive assisted support or security updates. 

    I invite you to upgrade quickly in Microsoft SQL Server 2005 Service Pack 3.

    More details:
    - What's New in SQL Server 2005 SP3
    - Which Service Pack do I have to install on SQL Server ? (SQL Server 2000, 2005, 2008)

    PS : I would like to profit of this post, to remind you that support for SQL Server 2008 RTM will end on April 13, 2010.



    Microsoft SQL Server 2005 Service Pack




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

    Installation of SQL Server 2008 clusters on Windows 2008 Step 4 : Add a new node

    • 0 Comments


    Installation step by step of SQL Server 2008 clustering on Windows 2008
        Step 1 : Validation wizard
        Step 2 : Pre-check
        Step 3 : Installation of the first node
        Step 4 : Add a new node
        Step 5: Apply a service pack or hotfix on a SQL cluster

    1. Start the installation from the passive node and select "Add node to a SQL Server failover cluster"

    Cluster 2008 add nove
    2. The System Configuration Checker runs a discovery operation on your computer. To continue, click "OK". You can view the details on the screen by clicking "Show Details", or as an HTML report by clicking "View detailed report".
    cluster 2008 add node 

    3. On the License Terms page, read the license agreement, and then select the check box to accept the license terms and conditions. Click Next to continue. Then, on the Setup Support Files page, click Install to install the setup support files.

    Cluster SQL 2008 add node
    4. The System Configuration Checker verifies the system state of your computer before Setup continues. After the check is complete, click Next to continue. You can view the details on the screen by clicking Show Details, or as an HTML report by clicking View detailed report.

    Correct problems that are carryovers from the list of rules. Errors are blocking, but not warnings. A good practice is to correct all errors and warnings.

    5. On the Cluster Node Configuration, using field SQL Server instance name to select the name of the instance of SQL Server 2008 failover cluster that must be added during installation

    Cluster SQL 2008 Add nove
     
    6. The "Service Accounts", specify the account to the SQL Server. Services that are configured on this page are the components you selected during installation. For a clustered installation, account information and the startup type will be informed automatically based elements of the first installation. You need to provide the passwords for each account.
    SQL 2008 cluster failover add nove 

    Security note: Do not use the password blank. Use a strong password.

    7. When you specify the information password for the SQL Server, click Next.

    8. The "Ready to Add Node" appears and shows the installation options that you specified during setup.

    Cluster SQL 2008 add node
     
    9. The Add Node Progress page provides status so you can monitor add node progress as Setup proceeds.
    Cluster failover SQL 2008 add node 

    10. To complete the SQL Server installation process, click Close.

    Cluster failover SQL 2008 add node


     The installation of your cluster 2 nodes is completed :-)


    How to: Add or Remove Nodes in a SQL Server Failover Cluster (Setup)
    http://msdn.microsoft.com/en-us/library/ms191545.aspx




    Previous

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

    Installation of SQL Server 2008 clusters on Windows 2008 Step 3 : Installation of the first node

    • 0 Comments


    Installation step by step of SQL Server 2008 clustering on Windows 2008
        Step 1 : Validation wizard
        Step 2 : Pre-check
        Step 3 : Installation of the first node
        Step 4 : Add a new node
        Step 5: Apply a service pack or hotfix on a SQL cluster


    1. Enter the PID key production for the product SQL Server 2008.
    Cluster Failover SQL 2008 
    2. On the "License Terms page", select "I accept the License Terms". Click "Next" to continue
    Cluster failover SQL 2008 
    3. On the "Feature" Selection page, select the components for your installation
    SQL Server 2008 Cluster Failover 
    Only "Database Engine" and "Analysis Services" are cluster aware. Other components will be installed locally if they are selected.

    Warning: Microsoft does not recommend installing the client tools on the cluster nodes. It is best to install on a machine dedicated to the administration of the various instances of the park.

    4. On the configuration page, specify if you want a default instance or a named instance.
    SQL Server 2008 Cluster Failover 
    In "SQL Server Network Name" specify a network name for the new SQL Server failover cluster. This name is the name that will be used to identify your virtual server on the network. Click "Next" to continue.
     
    5. On the selection of disks cluster, select the resource shared disk for your SQL Server failover cluster.
    SQL Server 2008 Cluster Failover 
    The disk cluster will be used to host the SQL Server. Several drives can be specified. The field "Available shared disks" displays a list of available disks, click "Next" to continue.

    6. On the Cluster Network Configuration, specify the network resource for your failover cluster instance. Specify the type of IP and the IP address for your failover cluster instance. Click Next to continue.
    SQL Server 2008 Cluster Failover 
    7. The following image shows the cluster security policies available for Windows Server 2008. In Windows Server 2008 and later, services SIDs (security IDs server) are recommended. For more information about the services functionality SIDs on Windows Server 2008, see Setting Up Windows Service Accounts (http://msdn.microsoft.com/en-us/library/ms143504.aspx ). Click "Next" to continue.
    SQL Server 2008 Cluster Failover

    8. On the Service Accounts tab, specify the login components for SQL Server services. View accounts previously created SQL SQLAgent 
    SQL Server 2008 Cluster Failover
    You can set the same account for each SQL Server, or you can configure one account per SQL Server. Microsoft recommends setting up a service account individually for each SQL Server to provide a minimum of privileges for each service. Services and SQL Servers have the minimum permissions to perform their respective tasks. For more information, see Setting Up Windows Service Accounts (http://msdn.microsoft.com/en-us/library/ms143504.aspx ) and SQL Server Configuration - Service Accounts ( http://msdn.microsoft.com/en-us/library/cc281953.aspx ) in SQL Server Books Online

    9. Use the "Collation" tab to specify a different collation than the default collation for the Database Engine and Analysis Services. Collation of recommendations depends on the application vendor. In case of error, you will then have to do a Master Rebuild or relocate the clustered instance.
    SQL Server 2008 Cluster Failover 
    10. Use the "Account Provisioning" tab to specify the following information: "Authentication Mode" - select Windows authentication or Mixed Mode Authentication 'for your instance of SQL Server. If you select Mixed Mode authentication, you must provide a strong password for the group built-in Administrator SQL Server.

    For more information, see Database Engine Configuration - Account Provisioning (http://technet.microsoft.com/en-us/library/cc281849.aspx).
    SQL Server 2008 Cluster Failover
    11. Use the "Data Directories" tab to specify additional directories setup as the default directories, click "Next" 
    SQL Server 2008 Cluster Failover
    Important: If you specify other directories directories default installation, verify that the installation directories are unique for each instance of SQL Server. None of the directories should be shared with the directory of another instance of SQL Server. The data directories must be accommodated by a disk cluster.

    12. Use this tab "FILESTREAM" to enable Filestream on your SQL Server instance.
     SQL Server 2008 Cluster Failover
    13. The validation system configuration then performs some rules to validate the configuration of SQL Server components that you specified.
    SQL Server Cluster Failover  
    14. The page "Ready to Install" displays the setup information about your selection of components. To continue, click Install. During installation, the installation process provides a status to monitor the progress of the installation.
    SQL Server 2008 Cluster Failover
    15. After installation, the page to finalize the installation provides a link to the logs of the installation.
    SQL Server 2008 Cluster Failover
    To complete the installation process of SQL Server, click Close.



    Previous - Next



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

    Installation of SQL Server 2008 clusters on Windows 2008 Step 2 : Pre-check

    • 0 Comments


    Installation step by step of SQL Server 2008 clustering on Windows 2008
        Step 1 : Validation wizard
        Step 2 : Pre-check
        Step 3 : Installation of the first node
        Step 4 : Add a new node
        Step 5: Apply a service pack or hotfix on a SQL cluster




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

     Stop anti-virus
     Perform a failover test by Moving disk resource
      Configure a Windows Firewall for Database Engine Access
     Creating service accounts for SQL and SQL Agent
      The node [NODE1]  is started
      The node [NODE2]  is started
      The shared storage system is started
     A domain controller is available


    2. Prerequisites

    The. NET Framework 3.5 SP1 and Windows Installer 4.5 are required components to install SQL2008. (http://msdn.microsoft.com/en-us/library/ms189910.aspx )

    Installation of SQL Server 2008 clusters on Windows 2008

    Download :
    - Framework 3.5   or from SQL installation's CD inside  /redist/DotNetFrameworks
    - Windows installer 4.5


    3. Setup Support Files : Run setup installation of  SQL server

    click on "New SQL Server Failover Cluster Installation"

    SQL server 2008 cluster failover
    Sur la page du Setup Support Files, cliquez sur "Install" pour installer les support Files.
    SQL server 2008 cluster failover

    3. The System Configuration Checker runs a discovery operation on your computer. To continue, click "OK".  

    SQL Server 2008 cluster failover
     
    You can view the details on the screen by clicking "Show Details", or as an HTML report by clicking "View detailed report".

    SQL server 2008 cluster failover

    SQL Server 2008 cluster failover

    Correct problems that are carryovers from the list of rules. Errors are blocking, but not warnings. A good practice is to correct all errors and warnings.



    Previous - Next

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

    Installation of SQL Server 2008 clusters on Windows 2008 Step 1 : Validation wizard

    • 0 Comments



    Installation step by step of SQL Server 2008 clustering on Windows 2008
        Step 1 : Validation wizard
        Step 2 : Pre-check
        Step 3 : Installation of the first node
        Step 4 : Add a new node
        Step 5: Apply a service pack or hotfix on a SQL cluster


    Before to  begin I invite you to read my previous article: Installation SQL Server 2005/2008 failover clusters on MSCS Windows 2003/2008


    For your cluster configuration is supported by Microsoft, it's imperative to run the validation wizard. The outcome of this report wizard should indicate that all components are compliant. This report is stored in c:\windows\cluster\report. It must be preserved. Then every time you modify an element constituting the hardware or software configuration of your cluster, it will be necessary to rerun the Validation Wizard.

    1. Run the component by : Start /Administratives tools/ Failover Cluster Management

    Cluster SQL 2008

    2. Then into Failover Cluster Management, clic on  Validate Configuration
    SQL 2008 Cluster


    3. Enter the name of the cluster components nodes
    SQL 2008 Cluster
     

    4. Prior to production, we must run all tests. Then during normal operation, the wizard disables validation tests for hard disks allocated to Services/Application existing.
    SQL 2008 Cluster

    5. Click on next
    SQL 2008 Cluster

    6. Click on next, all elements should be green
    SQL 2008 Cluster



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

    The SQL Network Interface library was unable to register SPN

    • 0 Comments




    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

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

    Changes to the Virtualization Support Policy for SQL Server

    • 0 Comments



    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 |

  • Microsoft SQL Server

    Which logs do I have to collect when I am victim of an unexpected failover?

    • 0 Comments



    Cluster failover SQL : Which Service log do I have to collect when I am victim of an unexpected failover?

    Several of my customers uses to ask me : "what kind of information they have collect to make a root cause analysis of the unexpected failover on their SQL Server 2005/2008 failover cluster instance on their Windows 2008? "

    You could find below 2 methods:


    Method 1: This method is the best one to be ensured to get all information that we need for an RCA. Just run the MPS Report tool. it will take a snapshot of all your logs.

    http://www.microsoft.com/downloads/details.aspx?FamilyId=CEBF3C7C-7CA5-408F-88B7-F9C79B7306C0&displaylang=en 
    Use administrator account
    Please, when you run MPS Report, be ensure that the checkbox below are checked:
    -              General
    -              Internet and Networking
    -              Server component
    -              SQL and other Data Stores (MDAC)


    Method 2: You can collect the 5 most important logs by using the command below:

    Cluster info:

    @ECHO OFF
    ECHO %DATE% > C:\temp\clusterinfo.output.txt
    ECHO %TIME% >> C:\temp\clusterinfo.output.txt
    CLUSTER /QUORUM >> C:\temp\clusterinfo.output.txt
    CLUSTER RES >> C:\temp\clusterinfo.output.txt
    CLUSTER RES /PROP >> C:\temp\clusterinfo.output.txt

    Cluster log:

    CLUSTER /CLUSTER:cluster_name LOG /GENERATE /COPY:”c:\temp”

    Event windows:

    Step 1: Start >> Administration tools >> Event viewer

    Step 2: On Application et System save as in .CVS

    Step 3: Also observe the cluster Operational log – Microsoft >> Windows >>FailoverClustering Operational.


     

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

    How to install SQL Server 2008 32Bit on Windows 2008 X64

    • 0 Comments


    How install SQL Server 2008 32Bit on Windows 2008 X64

    In a specific case, you have to install SQL Server 2008 32Bit (X86) on Windows 2008 X64. It can be due to the provider of your end application who supports only on a SQL 32Bit his application.

    If you want to install SQL server 2008 from the command prompt, you can specify that Setup should install into WOW64 by adding the parameter X86="True". This command line argument is not supported on an IA64 or a 32-bit system.

    How to: Install SQL Server 2008 from the Command Prompt
    http://msdn.microsoft.com/en-us/library/ms144259.aspx

    If you want to run the setup by using the wizard, you can also specify the architecture of SQL Server 2008 to install. You can choose between X86(32bit) and X64 in the tab "Options".


    How to install SQL server 2008 32Bit on Windows 2008 X64

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

    Determining SQL Server Table Size

    • 0 Comments



    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 |
  • Microsoft SQL Server

    SQL Server Management Studio spends over 10 seconds to load

    • 0 Comments



    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 |
  • Microsoft SQL Server

    Moving Database Files on the secondary server in Log Shipping

    • 0 Comments


    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 |
Page 1 of 2 (36 items) 12