Showing posts with label sql server 2012. Show all posts
Showing posts with label sql server 2012. Show all posts

Tuesday, March 6, 2012

Installing Windows Server 8 & SQL Server 2012


Microsoft recently released Windows Server "8" Beta for download. When you launch setup you'll be asked if you want to install Server Core or Server with a GUI:
 
While I will definitely be leaning toward Server Core for production, I chose the GUI installation for now just to feel my way around for a bit on a local VM. Also because it would be tough to demo all of SQL Server 2012's features from a Server Core VM.
Next during setup you will be asked if you want to upgrade or create a new installation. The upgrade is pre-selected, so be careful about pressing Enter here since - if you are installing on a VM - there is unlikely to be a pre-existing version of Windows on the VHD you just finished allocating:
 
From there installation itself was pretty simple, a lot like previous versions of Windows. The slowest part was "Expanding files" - I'm on SSD so I can't even imagine how slow this is going to seem for you platter folks. Just a little warning. Though I did experience a snafu when installing VMWare Tools (I run VMWare Fusion) - the VM froze up. I've also heard about some issues with the VMWare Tools for VMWare Workstation. So, depending on your virtualization platform, your mileage may vary.
Two things needed to be changed immediately. One was the resolution - the default is 1024 x 768 and this is horribly unusable. Once I was up to 1680x1050 (right-click the desktop and choose "Screen Resolution"), I wanted my Start Menu back. So I ran the following command provided in Mikael Nystrom's blog post (there is also a PowerShell version):
reg.exe add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer /v RPEnabled /d 0 /t REG_DWORD /f
Sadly, these tricks were written for the Consumer Preview, but they do not seem to work for server. If you've enbled the Start Menu on server, please let me know how you did it and I will update this post (and my VM).
One other thing I wanted to change was file extensions. I tried to create a .ps1 script on my desktop and it was actually called .ps1.text. This is one of those "let's cater to dummies" features that I've always hated, and lack of disciplined extensions is actually one of the things I like less about Mac OS. Anyway Windows Explorer now has a ribbon, and some of these settings are much easier to get to compared to the old Tools / Folder Options path:
 
Once Windows Server 8 was up and running (almost) the way I like, it was time to install SQL Server 2012 RC0. Remembering my trials with an earlier preview of Windows 8, and after reading Allan Hirt's blog post, I knew that I would have to manually install .NET Framework 3.5 in order to install SQL Server 2012. Allan outlines how to do this with the command line:
dism /online /enable-feature /featurename:NetFx3 /source:d:\sources\sxs\
I did this, and it reported success:
 
However, after restarting the system, when I went into the Server Roles and Features wizard, the .NET 3.5 feature was still not enabled. So I stepped through the wizard to add the feature, and rebooted again.
 
 
 
 
 
 
 
 
 
Once I rebooted, I validated that .NET 3.5 was correctly installed according to Server Manager. I went through the SQL Server setup and, once I had made all of my feature and other configuration selections, it took about 12 minutes to install SQL Server. When it was finished, it had placed a whole slew of tiles onto the Metro start page:
 
So, a lot of cleanup necessary here. But I have SQL Server, Management Studio and I can start to play:

Source:

SQL Server 2012 (Denali)


Microsoft SQL Server 2012 RC0 was recently released. RC stands for Release Candidate which is basically the version virtually production ready. Microsoft referred to this release as SQL Server Code Named "Denali" but has settled on SQL Server 2012 as the final name for the product.. Business intelligence (BI) is critically important to organizations both large and small. In the latest release of SQL Server, there is no shortage of BI enhancements in addition to many other enhancements. This article will give you a preview of the requirements, new features and enhancements in SQL Server 2012 (code named Denali) including:
  • Hardware and Software Requirements
  • Multi-Subnet Failover Clustering
  • Programming Enhancements, including sequences, ad-hoc query paging and full-text search tweaks
  • BI and Web Development Environment Improvements
  • Web-based Visualization
  • Data Quality Services
Keep in mind that this information is for preview only and is subject to change by Microsoft.

Hardware and Software Requirements

  • Microsoft recommends using NTFS file format instead of FAT32. FAT32 will work but you should probably not use it.
  • You can't install SQL Server 2012 (code-named Denali) on mapped drives or compressed drives.
  • You have to have the "no-reboot" package installed prior to installing SQL Server 2012(code-named Denali). This is included in Windows 7 SP1 and Windows Server 2008 R2. Otherwise, you can download the no-reboot package from Microsoft.
  • SQL Server 2012 (code-named Denali) requires the .NET Framework 4.0.
  • Virtualization is supported using Microsoft's Hyper-V technology.
  • You will need at least 3.6 GB of free disk space.
  • Microsoft recommends that you do not install SQL Server 2012 (code-named Denali) on a domain controller.
  • Recommended Processors & RAM
    • 64-bit version: AMD Opteron, AMD Athlin 64, Intel Xeon with Intel EM64T Support or Intel Pentium IV with EM64T support running 2.0 GHz or faster. Recommended RAM is maximum that operating system supports or at least 2 GB.
    • 32-bit version: Pentium III or compatible running at 2.0 GHz of faster. Recommended RAM is maximum that operating system supports or at least 2 GB.
  • Windows PowerShell 2.0 is a pre-requisite for installing SQL Server 2012 (code-named Denali). You can get this software from the Windows Management Framework page.
  • Check out the step by step installation guide with screenshots to get a preview of the SQL Server 2012 install and configuration process.

Multi-Subnet Failover Clustering

With SQL Server 2012 (code-named Denali), you can configure SQL Server where failover cluster nodes can be connected to a completely different subnet. The subnets can be spread out to different geographical locations providing disaster recovery along with high availability. In order for this to work correctly, you will need to replicate the data across the databases involved in this configuration. The SQL Server failover cluster is dependent on the Windows Server failover cluster so this has to be set up first. Keep in mind that all of the subnets involved in this configuration must be in the same Active Directory domain.

Programming Enhancements

  • Sequences: Sequences have been requested by the SQL Server community for years, and it's included in this release. Sequence is a user defined object that generates a sequence of a number. Here is an example using Sequence.
    /****** Create Sequence Object ******/
    CREATE SEQUENCE MySequence
    START WITH 1
    INCREMENT BY 1;
    /****** Create Temp Table ******/
    DECLARE @Person TABLE
    (
    ID int NOT NULL PRIMARY KEY,
    FullName nvarchar(100) NOT NULL
    );
    /****** Insert Some Data ******/
    INSERT @Person (ID, FullName)
    VALUES (NEXT VALUE FOR MySequence, 'Jim Johnson'),
    (NEXT VALUE FOR MySequence, 'Bob Thompson'),
    (NEXT VALUE FOR MySequence, 'Tim Perdue');
    /****** Show the Data ******/
    SELECT * FROM @Person;
    The results would look like this:
    ID FullName
    1 Jim Johnson
    2 Bob Thompson
    3 Tim Perdue
  • Ad-Hoc Query Paging: Paging results in SQL Server has been discussed for years. The Order By option in the SQL SELECT statement has been enhanced in SQL Server 2012. Using a combination of OFFSET and FETCH along with ORDER BY gives you control of paging through a result set. Using this technique can really help performance by bring back only the results you want to show to your users when they are needed. The following TSQL code runs against the Person table in the AdventureWorks sample database (available from Microsoft). In the sample query below, SQL Server would return 10 records beginning with record 11. The OFFSET command provides a starting point for the SELECT statement in terms of paging, and the FETCH command provides how many records to return at a time.
    SELECT BusinessEntityID, FirstName, LastName
    FROM Person.Person
    ORDER BY BusinessEntityID
    OFFSET 10 ROWS
    FETCH NEXT 10 ROWS ONLY;
  • Full Text Search: The Full Text Search in SQL Server 2012 has been enhanced by allowing you to search and index data stored in extended properties or metadata. Consider a PDF document that has "properties" filled in like Name, Type, Folder path, Size, Date Created, etc. In the newest release of SQL Server, this data could be indexes and searched along with the data in the document itself. The data does have to be exposed to work, but it's possible now.
BI and Web Development Environment Improvements
Microsoft moved BI (Business Intelligence) closer to the end user with SQL Server 2008 R2. The Excel PowerPivot tool help users by creating a self-service reporting model. To understand the impact of SQL Server 2008 R2, check out the About.com article Why SQL Server 2008 R2 Matters to Small Business. The good news is PowerPivot is being enhanced in SQL Server 2012 (code-named Denali). Microsoft is adding KPIs and drill through, which will be really useful for all users.
Analysis Services will include a new BI Semantic Model (BISM). BISM is a 3-layer model that includes:
  • Data Model
  • Business Logic
  • Data Access
BISM will enhance Microsoft's front end analysis experiencing including Excel, Reporting Services and SharePoint Insights. Microsoft has said that BISM is not a replacement for the current BI Models but more of an alternative model. In simple terms, BISM is a relation model that includes BI artifact such as KPIs and hierarchies.
Web Based Visualization - Project Crescent
Project Crescent is the Microsoft code name for the new reporting and visualization tool expected in SQL Server 2012 (code-named Denali). Project Crescent provides drag and drop ad-hoc reporting functionality and was built entirely on Silverlight. It includes a powerful query tool and interactive storyboarding to allow a user to share visualizations of large datasets.
Data Quality Services
Data Quality Services is a knowledge-based approach that runs in SSIS (SQL Services Integration Services). Data quality is one of those things that you never get perfect. Microsoft is introducing "Impact Analysis and Lineage" which will give you information about what your data depends on. It also shows the lineage of the data, including where it comes from and the systems that are behind it.
Source:

Friday, March 2, 2012

Configuring and Creating An AlwaysOn Availability Group in SQL Server 2012

In the previous article on AlwaysOn Availability Groups in SQL Server 2012, we looked at The Environmental Setup for An AlwaysOn Availability Group. In this article we turn our attention to the creation and configuration of the Availability Group.
There are two primary steps to creating an AlwaysOn availability group which has to be done only after successful creation of the Windows failover cluster as discussed in the previous article. Firstly enable AlwaysOn on each instance and then create the AlwaysOn Availability Group.

Enabling AlwaysOn High Availability on each SQL Server Instance

First of all you will need to enable AlwaysOn each participating SQL Server instance of the cluster or availability group (by default AlwaysOn is not enabled). Open SQL Server Configuration Manager (Start -> All Programs -> Microsoft SQL Server 2012 -> Configuration Tools) as shown below:
In SQL Server Configuration Manager, select and right-click on the SQL Server service (select the appropriate instance service) and click Properties. On the Properties page, select AlwaysOn High Availability tab and enable AlwaysOn as shown below; notice that the name of the Windows failover cluster in which this instance participates will automatically appear :
After enabling the AlwaysOn High Availability at instance/service level, you will need to restart the service for changes to take effect. Once enabled, the IsHadrEnabled property of the instance will be set to 1. Please note, if there is any changes in the Windows failover cluster that you created, you must disable and enable AlwaysOn High Availability feature once more for the changes to take effect. Also, ensure that the TCP/IP net library/protocol is enabled on the instance as only the TCP/IP protocol is supported by the availability group listener (I will discuss more about availability group listener later in this series).

Creating an AlwaysOn Availability Group

Now to create an availability group. Connect to the primary instance/replica in SSMS (SQL Server Management Studio) and then right-click on the Availability Groups node under the AlwaysOn High Availability node and click the New Availability Group Wizard as shown below:
In the New Availability Group Wizard, skip the introduction page and on the second page, specify a unique name for the availability group that you want to create, in this case I have used AlwaysOn-Demo-AG for the availability group:
On the Select Databases page of the New Availability Group Wizard, select all the databases that you wish to be part of the availability group (all databases in this availability group will failover together as group or unit). As noted before, as with database mirroring you are not required to have only one database here in case of an availability group. Remeber also that a database can be part of one and only one availability group at any time:
Please note in the above image, you can only include databases which meet certain prerequisites for including them in the availability group, for example that database should be in full recovery mode and you should have taken at least one full or differential backup of the database. If you click on the link for the database which does not meet prerequisite, a pop as shown below will appear with details:
On the Select Replicas page, under the Replicas tab of the New Availability Group Wizard, notice that the current instance name has already been included as the primary replica (read-write databases) and next you need to add secondary replicas (you need to have at least one or up to four secondary replicas). Here, can also specify the automatic failover setting/instance or synchronous commit mode. If you set a secondary replica for automatic failover, synchronous commit mode is required and will be set automatically. Next, can specify the readability setting for the secondary replica:
On the Select Replicas page under Endpoint tab, by default endpoints (database mirroring endpoints to connect to each other servers/instances) will be created for all the servers participating in the availability group. You can customize this for specific requirements or leave the default values as is:
On the Select Replicas page (under Backup preferences tab) of the New Availability Group Wizard, you need to specify the preferred location of automated backup for the databases participating in the availability group:
  • · Prefer Secondary – Takes an automatic backup on the secondary replica if one is available alterantively it takes a backup on the primary replica
  • · Secondary Only – Takes a backup of the database belonging to this availability group which should occur on current secondary replica only. Selecting this means you are basically offloading the backup operation from the primary to the secondary replica.
  • · Primary – Backups should always be taken on the current/active primary replica irrespective of the number of secondary replicas available.
  • · Any Replica – Backup of database belonging to the availability group can happen on any replica as per the backup priority specified. You can also exclude one or more replicas from the backup operation:
Description: Description: cid:image021.png@01CCCF90.03FACC70
On the Select Replicas page and under Listener tab of the New Availability Group Wizard, you need to specify whether you want to create an availability group listener with the availability group creation itself or whether you wish to create it later on. In either case, note that you can have only one availability group listener for an availability group.
So what is an availability group listener is and what does it do?
An availability group listener provides a connection point to connect to an availability group from client applications. An availability group listener directs incoming connections/requests to the current primary replica of the availability group for read-write operations or to a readable secondary replica for read-only operation. Therefore, the client does not need to know the physical name of the instance it intends to connect to, but instead it will be using the availability group listener and the availability group listener will route requests to the appropriate replica/instance.
When creating availability group listener you need to provide the below information:
· Listener DNS Name or Virtual Network Name (VNN) : This name should be unique across the domain.
· Port – The port number on which the availability group listener will listen for incoming requests. You can use the default port 1433 of SQL Server in which case the client would not be required to provide the port number when connecting. Otherwise the client will need to provide the port number as part of connection string. This port number should be defined appropriately in the firewall to allow for connections.
· Network mode – You can use either DHCP (Dynamic Host Configuration Protocol) or static IP for the availability group listener:
Here I have used DHCP but you need to use static IP addresses for the availability group listener if the availability group is spread across subnets in a multi-subnet domain. In addition, DHCP is not recommended for use in production for an availability group listener as it requires additional time to re-register if the DHCP lease expires.
On the Select Data Synchronization page, specify how you are going to synchronize your secondary replicas’ databases with the primary replica. In this case, because the database is not that large, I have chosen the first option to take a backup from the primary replica and restore them at all on the secondary replicas and for that I provided a shared location for storing the backup files which is accessible from both the primary and secondary replicas.
Alternatively you may prefer to peform the data synchronization manually or only synchronize the data if the databases are already restored on the secondary replicas, so in effect you have three data synchronization options to choose from as shown below:
On the Validation page the wizard runs the validation process to ensure that the given configuration details for the availability group can be created. In this case I chose to restore the database on the secondary replica and hence it also validates if the location for the data/log files exist on secondary replicas. If the validation fails, you can access the details by clicking the link in the Result column. Once you are finished with the validation, click Next:
On Summary page you can review your all selections and information you provided for creating and configuring the availability group. You can go back make any necerssary changes or click Finish to start creating the availability group:
Please note, using New Availability Group Wizard is not the only way to create an availability group, you can automate the process of creating an availability group by using PowerShell cmdlets or T-SQL commands. To generate T-SQL scripts for our selection or configuration information that you provided during this wizard, you can click on Script button to generate T-SQL script commands as shown in the above image for later use.
On Result page, as shown below, you can see the progress and the final status of the availability group creation process. The wizard performs a step-by-step operation for creating availability group, joining secondary replicas, taking back from the primary replica and restoring it to secondary replicas for data synchronization etc.
In the next article in the series we will examine how to connect to an Availability Group as well as maintaining and monitoring an Availability Group.
Source: