Saturday, June 20, 2015

Security Enhancements in SQL Server 2012

The following list shows a few of the improvements that will appeal to organizations looking to gain
maximum security and control of their database platform:

1. Security manageability improvements
• Default schema for groups
• User-defined server roles

2. Audit enhancements
• Audit supported on all SKUs
• Improved resilience
• User-defined audit event
• Record filtering
• T-SQL stack information

3.Database authentication enhancement: contained databases authentication

4. Crypto changes
• Hashing algorithms
• Certificate key length
• Service master key and database master key encryption changes from 3DES to AES

5. Miscellaneous security enhancements
• Tight Integration with SharePoint and Active Directory
• Provisioning enhancements
• New permissions

This chapter describes each of these new security enhancements introduced in SQL Server 2012,
starting with security manageability improvements.
Read More

SQL Server 2012 Editions

SQL Server 2012 is obtainable in three main editions. All three editions have tighter alignment than
their predecessors and were designed to meet the needs of almost any customer with an increased investment in business intelligence. Each edition comes in a 32-bit and 64-bit version. The main
editions, as shown in Figure 1-7, are the following:
  • Standard edition
  • Business Intelligence edition
  • Enterprise edition

Enterprise Edition

The Enterprise edition of SQL Server 2012 is the uppermost SKU; it is meant to meet the highest
demands of large-scale datacenters and data warehouse solutions by providing mission-critical
performance and availability for Tier 1 applications, the ability to deploy private-cloud, highly
virtualized environments, and large centralized or external-facing business-intelligence solutions.

The Enterprise edition features include the following:
  • Maximum number of cores is subject to the operating system being used
  • Advanced high availability can be achieved with AlwaysOn
  • Unlimited virtualization if the organization has software insurance
  • Support for the new columnstore indexing feature
  • Advanced auditing
  • Transparent Data Encryption (TDE)
  • Compression and partitioning
  • Includes all of the Business Intelligence edition’s features and capabilities:
  • Reporting
  • Analytics
  • Multidimensional BI semantic model
  • Data-quality services
  • Master data services
  • In-memory tabular BI semantic model
  • Self-service business intelligence

Standard Edition

The Standard edition is a data-management platform tailored toward departmental databases and limited business-intelligence applications that are typically appropriate for medium-class solutions,
smaller organizations, or departmental solutions. It does not include all the bells and whistles of the
Enterprise and Business Intelligence editions; however, it continues to offer best-in-class manageability and ease of use. Compared to the Enterprise and Business Intelligence editions, the Standard edition supports up to 16 cores and includes the following:
  • Spatial support
  • FileTable
  • Policy-based management
  • Corporate business intelligence
  • Reporting
  • Analytics
  • Multidimensional BI semantic model
  • Basic high availability can be achieved with AlwaysOn 2-Node Failover Clustering
  • Up to four processors, up to 64 GB of RAM, one virtual machine, and two failover clusterin nodes

Business Intelligence Edition

For the first time in the history of SQL Server, a Business Intelligence edition is offered. The Business Intelligence edition offers organizations the full suite of powerful BI capabilities such as scalable reporting and analytics, Power View, and PowerPivot. It is tailored toward organizations trying to achieve corporate business intelligence and self-service capabilities, but that do not require the full online transactional processing (OLTP) performance and scalability found in the Enterprise edition of SQL Server 2012. Here is a high-level list of what the new Business Intelligence edition includes:
  • Up to a maximum of 16 cores for the Database Engine
  • Maximum number of cores for business intelligence processing
  • All of the features found in the Standard edition
  • Corporate business intelligence
  • Reporting
  • Analytics
  • Multidimensional BI semantic model
  • Self-service capabilities
  • Alerting
  • Power View
  • PowerPivot for SharePoint Server
  • Enterprise data management
  • Data quality services
  • Master data services
  • In-memory tabular BI semantic model
  • Basic high availability can be achieved with AlwaysOn 2-Node Failover Clustering

Specialized Editions

Above and beyond the three main editions discussed earlier, SQL Server 2012 continues to deliver
specialized editions for organizations that have a unique set of requirements. Some examples include
the following:
  • Developer The Developer edition includes all of the features and functionality found in the Enterprise edition; however, it is meant strictly for the purpose of development, testing, and demonstration. Note that you can transition a SQL Server Developer installation directly into production by upgrading it to SQL Server 2012 Enterprise without reinstallation.
  • Web Available at a much more affordable price than the Enterprise and Standard editions, SQL Server 2012 Web is focused on service providers hosting Internet-facing web services environments. Unlike the Express edition, this edition doesn’t have database size restrictions, it supports four processors, and supports up to 64 GB of memory. SQL Server 2012 Web does not offer the same premium features found in Enterprise and Standard editions, but it still remains the ideal platform for hosting websites and web applications.
  • Express This free edition is the best entry-level alternative for independent software vendors, nonprofessional developers, and hobbyists building client applications. Individuals learning about databases or learning how to build client applications will find that this edition meets all their needs. This edition, in a nutshell, is limited to one processor and 1 GB of memory, and it can have a maximum database size of 10 GB. Also, Express is integrated with Microsoft Visual Studio.
Read More

SQL Server Security Enhancements

It has been approximately 10 years since Microsoft initiated its trustworthy computing initiative. Since then, SQL Server has had the best track record with the least amount of vulnerabilities and exposures among the major database players in the industry. The graph shown in Figure 1-6 is from the National Institute of Standards and Technology (Source: ITIC 2011: SQL Server Delivers Industry-Leading Security). It shows common vulnerabilities and exposures reported from January 2002 to June 2010. With SQL Server 2012, the product continues to expand on this solid foundation to deliver enhanced security and compliance within the database platform. For detailed information
of all the security enhancements associated with the Database Engine “ Security Enhancements.” For now, here is a snapshot of some of the new enterprise-ready security capabilities and controls that enable organizations to meet strict compliance policies and regulations:User-defined server roles for easier separation of duties
  • Audit enhancements to improve compliance and resiliency
  • Simplified security management, with a default schema for groups
  • Contained Database Authentication, which provides database authentication that uses self-contained access information without the need for server logins
  • SharePoint and Active Directory security models for higher data security in end-user reports
Programmability Enhancements
There has also been a tremendous investment in SQL Server 2012 regarding programmability.
Specifically, there is support for “beyond relational” elements such as XML, Spatial, Documents, Digital Media, Scientific Records, factoids, and other unstructured data types. Why such investments? Organizations have demanded they be given a way to reduce the costs associated with managing both structured and nonstructured data. They wanted to simplify the development of applications over all data, and they wanted the management and search capabilities for all data improved. Take a minute to review some of the SQL Server 2012 investments that positively impact programmability. For more information associated with programmability and beyond relational elements.
  • FileTable Applications typically store data within a relational database engine; however, a myriad of applications also maintain the data in unstructured formats, such as documents, media files, and XML. Unstructured data usually resides on a file server and not directly in a relational database such as SQL Server. As you can imagine, it becomes challenging for organizations to not only manage their structured and unstructured data across these disparate systems, but to also keep them in sync. FileTable, a new capability in SQL Server 2012, addresses these challenges. It builds on FILESTREAM technology that was first introduced with SQL Server 2008. FileTable offers organizations Windows file namespace support and application compatibility with the file data stored in SQL Server. As an added bonus, when applications are allowed to integrate storage and data management within SQL Server, fulltext and semantic search is achievable over unstructured and structured data.
  • Statistical Semantic Search By introducing new semantic search functionality, SQL Server 2012 allows organizations to achieve deeper insight into unstructured data stored within the Database Engine. Three new Transact-SQL rowset functions were introduced to query not only the words in a document, but also the meaning of the document.
  • Full-Text Search Enhancements Full-text search in SQL Server 2012 offers better query performance and scale. It also introduces property-scoped searching functionality, which allows organizations the ability to search properties such as Author and Title without the need for developers to maintain file properties in a separate database. Developers can now also benefit by customizing proximity search by using the new NEAR operator that allows them to specify the maximum number of non-search terms that separate the first and last search terms in a match.
  • Extended Events Enhancements This new user interface was introduced to help simplify the management associated with extended events. New extended events for functional and performance troubleshooting were also introduced in SQL Server 2012.
Read More

SQL Server Manageability Enhancements

SQL Server deployments are growing more numerous and more common in organizations. This fact demands that all database administrators be prepared by having the appropriate tools to successfully manage their SQL Server infrastructure. Recall that the previous releases of SQL Server included many new features tailored toward manageability. For example, database administrators could easily
leverage Policy Based Management, Resource Governor, Data Collector, Data-tier applications, and
Utility Control Point. Note that the product group responsible for manageability never stopped investing in manageability. With SQL Server 2012, they unveiled additional investments in SQL Server tools and monitoring features. The following list articulates the manageability enhancements in SQL Server 2012:
  • SQL Server Management Studio With SQL Server 2012, IntelliSense and Transact-SQL debugging have been enhanced to bolster the development experience in SQL Server Management Studio.
  • IntelliSense Enhancements A completion list will now suggest string matches based on partial words, whereas in the past it typically made recommendations based on the first character.
  • A new Insert Snippet menu This new feature is illustrated in Figure 1-4. It offers developers a categorized list of snippets to choose from to streamline code. The snippet picket tooltip can be launched by pressing CTRL+K, pressing CTRL+X, or selecting it from the Edit menu.
  • Transact-SQL Debugger This feature introduces the potential to debug Transact-SQL scripts on instances of SQL Server 2005 Service Pack 2 (SP2) or later and enhances breakpoint functionality.
  • Resource Governor Enhancements Many organizations currently leverage Resource Governor to gain predictable performance and improve their management of SQL Server workloads and resources by implementing limits on resource consumption based on incoming requests. In the past few years, customers have also been requesting additional improvements to the Resource Governor feature. Customers wanted to increase the maximum number of resource pools and support large-scale, multitenant database solutions with a higher level of isolation between workloads. They also wanted predictable chargeback and vertical isolation of machine resources.
The SQL Server product group responsible for the Resource Governor feature introduced new capabilities to address the requests of its customers and the SQL Server community. To begin, support for larger scale multitenancy can now be achieved on a single instance of SQL Server because the number of resource pools Resource Governor supports increased from 20 to 64. In addition, a maximum cap for CPU usage has been introduced to enable predictable chargeback
and isolation on the CPU. Finally, resource pools can be affinitized to an individual schedule or a group of schedules for vertical isolation of machine resources. A new Dynamic Management View (DMV) called sys.dm_resource_governor_resource_pool_affinity improves database administrators’ success in tracking resource pool affinity. Let’s review an example of some of the new Resource Governor features in action. In the following example, resource pool Pool25 is altered to be affinitized to six schedulers (8, 12, 13, 14, 15, and 16), and it’s guaranteed a minimum 5 percent of the CPU capacity of those schedulers. It can receive no more than 80 percent of the capacity of those schedulers. When there is contention for CPU bandwidth, the maximum average CPU bandwidth that will be allocated is 40 percent.

ALTER RESOURCE POOL Pool25
WITH(
MIN_CPU_PERCENT = 5,
MAX_CPU_PERCENT = 40,
CAP_CPU_PERCENT = 80,
AFFINITY SCHEDULER = (8, 12 TO 16),
MIN_MEMORY_PERCENT = 5,
MAX_MEMORY_PERCENT = 15,
);
  • Contained Databases Authentication associated with database portability was a challenge in the previous versions of SQL Server. This was the result of users in a database being associated with logins on the source instance of SQL Server. If the database ever moved to another instance of SQL Server, the risk was that the login might not exist. With the introduction of contained databases in SQL Server 2012, users are authenticated directly into a user database without the dependency of logins in the Database Engine. This feature facilitates better portability of user databases among servers because contained databases have no external dependencies.
  • Tight Integration with SQL Azure A new Deploy Database To SQL Azure wizard, pictured in Figure 1-5, is integrated in the SQL Server Database Engine to help organizations deploy an on-premise database to SQL Azure. Furthermore, new scenarios can be enabled with SQL Azure Data Sync, which is a cloud service that provides bidirectional data synchronization between databases across the datacenter and cloud.
  • Startup Options Relocated Within SQL Server Configuration Manager, a new Startup Parameters tab was introduced for better manageability of the parameters required for startup. A DBA can now easily specify startup parameters compared to previous versions of SQL Server, which at times was a tedious task. The Startup Parameters tab can be invoked by right-clicking a SQL Server instance name in SQL Server Configuration Manager and then selecting Properties.
  • Data-Tier Application (DAC) Enhancements SQL Server 2008 R2 introduced the concept of data-tier applications. A data-tier application is a single unit of deployment containing all of the database’s schema, dependent objects, and deployment requirements used by an application. SQL Server 2012 introduces a few enhancements to DAC. With the new SQL Server, DAC upgrades are performed in an in-place fashion compared to the previous side-byside upgrade process we’ve all grown accustomed to over the years. Moreover, DACs can be deployed, imported and exported more easily across premises and public cloud environments, such as SQL Azure. Finally, data-tier applications now support many more objects compared to the previous SQL Server release.
Read More

Friday, June 19, 2015

The Foundation Statements of T-SQL

At last! You’ve fi nally ingested the most boring stuff. It doesn’t get any worse than basic objects and tools, does it? As it goes, you have to lay down a foundation before you can build a house. The nice thing is that the foundation is now down. Having used the clichéd example of building a house, I’m going to turn it all upside down by talking about the things that let you enjoy living in the house before you’ve even talked about the plumbing. You see, when working with databases, you have to get to know how data is going to be accessed before you can learn all that much about the best ways to store it. This chapter covers the most fundamental Transact-SQL (T-SQL) statements. T-SQL is SQL Server’s own dialect of Structured Query Language (SQL). The T-SQL statements that you learn about in this chapter are:
  • SELECT
  • INSERT
  • UPDATE
  • DELETE
These four statements are the bread and butter of T-SQL. You’ll learn plenty of other statements as
you go along, but these statements make up the basis of T-SQL’s Data Manipulation Language (DML). Because you’ll generally issue far more commands meant to manipulate (that is, read and modify) data than other types of commands (such as those to grant user rights or create a table), you’ll fi nd that these will become like old friends in no time at all. In addition, SQL provides many operators and keywords that help refi ne your queries. You’ll learn some of the most common of these in this chapter.

GETTING STARTED WITH A BASIC SELECT STATEMENT

If you haven’t used SQL before, or don’t feel like you’ve really understood it yet, pay attention here!
The SELECT statement and the structures used within it are the lion’s share of all the commands you
will perform with SQL Server. Let’s look at the basic syntax rules for a SELECT statement:
SELECT [ALL|DISTINCT] [TOP (<expression>) [PERCENT] [WITH TIES]]
<column list>
[FROM <source table(s)/view(s)>]
[WHERE <restrictive condition>]
[GROUP BY <column name or expression using a column in the SELECT list>]
[HAVING <restrictive condition based on the GROUP BY results>]
[ORDER BY <column list>]
[[FOR XML {RAW|AUTO|EXPLICIT|PATH [(<element>)]}[, XMLDATA]
[, ELEMENTS][, BINARY base 64]]
[OPTION (<query hint>, [, ...n])]
Wow — that’s a lot to decipher. Let’s look at the parts.

The SELECT Statement and FROM Clause
The verb — in this case a SELECT — is the part of the overall statement that tells SQL Server what you are doing. A SELECT indicates that you are merely reading information, as opposed to modifying it. What you are selecting is identifi ed by an expression or column list immediately following the SELECT. You’ll see what I mean by this in a moment. Next, you add in more specifi cs, such as where SQL Server can fi nd this data. The FROM statement specifi es the name of the table or tables from which you want to get your data. With these, you have enough to create a basic SELECT statement. Fire up the SQL Server Management Studio and take a look at a simple SELECT statement:
SELECT * FROM INFORMATION_SCHEMA.TABLES;

Let’s look at what you’ve asked for here. You’ve asked to SELECT information; when you’re working in SQL Server Management Studio, you can also think of this as requesting to display information. The * may seem odd, but it actually works pretty much as * does everywhere: it’s a wildcard. When you write SELECT *, you’re telling T-SQL that you want to select every column from the table. Next, the FROM indicates that you’ve fi nished writing which items to output and that you’re about to indicate the source of the information — in this case, INFORMATION_SCHEMA.TABLES.

TRY IT OUT Using the SELECT Statement
Let’s play around with this some more. Change the current database to be the AdventureWorks
database. Recall that to do this, you need only select the AdventureWorks entry from the combo box in the toolbar at the top of the Query window in the Management Studio.

Now that you have the AdventureWorks database selected, let’s start looking at some real data from
your database. Try this query:
SELECT * FROM Sales.Customer;

After you have that in the Query window, just click Execute on the toolbar (the F5 key is a shortcut
for Execute and becomes a refl ex for you) and watch SQL Server give you your results. This query
lists every row of data in every column of the Sales.Customer table in the current database (in this case, AdventureWorks). If you didn’t alter any of the settings on your system or the data in the AdventureWorks database before you ran this query, you should see the following information if you
click the Messages tab:
(19820 row(s) affected)

For a SELECT statement, the number shown here is the number of rows that your query returned. You can also fi nd the same information on the right side of the status bar (found below the results
pane), with some other useful information, such as the login name of the user you’re logged in as, the
current database as of when the last query was run (this will persist, even if you change the database in the database dropdown box, until you run your next query in this query window), and the time it took for the query to execute.

How It Works
Let’s look at a few specifi cs of your SELECT statement. Notice that I capitalized SELECT and FROM. This is not a requirement of SQL Server — you could run them as SeLeCt and frOM and they would work just fi ne. I capitalized them purely for purposes of convention and readability. You’ll fi nd that many SQL coders use the convention of capitalizing all commands and keywords, and then use mixed case for table, column, and non-constant variable names. The standards you choose or have forced upon you may vary, but live by at least one rule: be consistent. The SELECT is telling the Query window what you are doing, and the * is saying what you want
(remember that * = every column). Then comes the FROM. A FROM clause does just what it says — that is, it defi nes the place from which your data should come. Immediately following the FROM is the names of one or more tables. In your query, all the data came from a table called Customer.
Now let’s try taking a little bit more specifi c information. Let’s say all you want is a list of all your
customers by last name:
SELECT LastName FROM Person.Person;

Your results should look something like:
Abbas
Abel
Abercrombie
...
Zukowski
Zwilling
Zwilling
Note that I’ve snipped rows out of the middle for brevity. You should have 19,972 rows. Because the
last name of each customer is all that you want, that’s all that you’ve selected.

Let’s try another simple query. How about:
SELECT Name FROM Production.Product;

Again, assuming that you haven’t modifi ed the data that came with the sample database, SQL Server
should respond by returning a list of 504 products that are available in the AdventureWorks database:
Name
----------------------------------------
Adjustable Race
Bearing Ball
BB Ball Bearing
...
...
Road-750 Black, 44
Road-750 Black, 48
Road-750 Black, 52

The columns that you have chosen right after your SELECT clause are known as the SELECT list. In
short, the SELECT list is made up of the columns that you have requested be output from your query.
Read More

RDBMS Basics: What Makes Up a SQL Server Database?

What makes up a database? Data for sure. (What use is a database that doesn’t store anything?) But a Relational Database Management System (RDBMS) is actually much more than data. Today’s advanced RDBMSs not only store your data, they also manage that data for you, restricting the kind of data that can go into the system, and facilitating getting data out of the system. If all you want is to tuck the data away somewhere safe, you could use just about any data storage system. RDBMSs allow you to go beyond the storage of the data into the realm of defi ning what that data should look like, or the business rules of the data.
Don’t confuse what I’m calling the “business rules of the data” with the more generalized business rules that drive your entire system (for example, preventing someone from seeing anything until they’ve logged in, or automatically adjusting the current period in an accounting system on the fi rst of the month). Those types of rules can be enforced at virtually any level of the system (these days, it’s usually in the middle or client tier of an n-tier system). Instead, what I’m talking about here are the business rules that specifi cally relate to the data. For example, you can’t have a sales order with a negative amount. With an RDBMS, you can incorporate these rules right into the integrity of the database itself. The notion of the database taking responsibility for the data within, as well as the best methods to input and extract data from that database, serves as the foundation for this book. This chapter provides an overview of the rest of the book. Most items discussed in this chapter are covered again in later chapters, but this chapter is intended to provide you with a road map or plan to bear in mind as you progress through the book. With this in mind, I’ll give you a high-level look into:
Database objects
Data types
Other database concepts that ensure data integrity

AN OVERVIEW OF DATABASE OBJECTS

An instance of an RDBMS such as SQL Server contains many objects. Object purists out there may quibble with whether Microsoft’s choice of what to (and what not to) call an object actually meets the normal defi nition of an object, but, for SQL Server’s purposes, the list of some of the more important database objects can be said to contain such things as:
  • The database itself
  • The transaction log
  • Tables
  • Indexes
  • Filegroups
  • Diagrams
  • Views
  • Stored procedures
  • User-defi ned functions
  • Sequences
  • Users
  • Roles
  • Assemblies
  • Reports
  • Full-text catalogs
  • User-defi ned data types
  • The Database Object
The database is effectively the highest-level object that you can refer to within a given SQL Server. (Technically speaking, the server itself can be considered to be an object, but not from any real “programming” perspective, so I’m not going there.) Most, but not all, other objects in a SQL Server are children of the database object.

A database is typically a group of constructs that include at least a set of table objects and, more often than not, other objects, such as stored procedures and views that pertain to the particular grouping of data stored in the database’s tables.
What types of tables do you store in just one database, and what goes in a separate database? I’ll discuss that in some detail later in the book, but for now I’ll take the simple approach of saying that any data that is generally thought of as belonging to just one system, or is signifi cantly related, will be stored in a single database. An RDBMS, such as SQL Server, may have multiple databases on just
one server, or it may have only one. The number of databases that reside on an individual SQL
Server depends on such factors as capacity (CPU power, disk I/O limitations, memory, and so on),
autonomy (you want one person to have management rights to the server this system is running
on, and someone else to have admin rights to a different server), and just how many databases your
company or client has. Some servers have only one production database; others have many. Also,
any version of SQL Server that you’re likely to fi nd in production these days has multiple instances
of SQL Server — complete with separate logins and management rights — all on the same physical
server. (SQL Server 2000 was already fi ve years old by the time it was replaced, so I’ll assume most
shops have that or higher.)

When you fi rst load SQL Server, you start with at least four system databases:
  • master
  • model
  • msdb
  • tempdb

All of these need to be installed for your server to run properly. (Indeed, without some of them, it won’t run at all.) From there, things vary depending on which installation choices you made. Examples of some of the databases you may see include the following:
  • ReportServer: The database that serves Reporting Server confi guration and model storage needs
  • ReportServerTempDB: The working database for Reporting Server
  • AdventureWorks: The sample database
  • AdventureWorksDW: Sample for use with Analysis Services
In addition to the system-installed examples, you may, when searching the web or using other
tutorials, fi nd reference to a couple of older samples:
pubs
Northwind
Because these examples were no longer used in the prior edition of this book, I won’t deal with them
further here, but I still mention them mostly because they carry fond memories from simpler times,
and partly because you might fi nd them out there somewhere.
Read More

SQL Server 2012 Scalability and Performance Enhancements


The SQL Server product group has made sizable investments in improving scalability and
performance associated with the SQL Server Database Engine. Some of the main enhancements that
  • allow organizations to improve their SQL Server workloads include the following:Columnstore Indexes More and more organizations have a requirement to deliver breakthrough and predictable performance on large data sets to stay competitive. SQL Server 2012 introduces a new in-memory, columnstore index built directly in the relational engine. Together with advanced query-processing enhancements, these technologies provide blazing-fast performance and improve queries associated with data warehouse workloads by 10 to 100 times. In some cases, customers have experienced a 400 percent improvement in performance. For more information on this new capability for data warehouse workloads, review Chapter 3, “Blazing-Fast Query Performance with Columnstore Indexes.”
  • Partition Support Increased To dramatically boost scalability and performance associated with large tables and data warehouses, SQL Server 2012 now supports up to 15,000 partitions per table by default. This is a significant increase from the previous version of SQL Server, which was limited to 1000 partitions by default. This new expanded support also helps enable large sliding-window scenarios for data warehouse maintenance.
  • Online Index Create, Rebuild, and Drop Many organizations running mission-critical workloads use online indexing to ensure their business environment does not experience downtime during routine index maintenance. With SQL Server 2012, indexes containing varchar(max), nvarchar(max), and varbinary(max) columns can now be created, rebuilt, and dropped as an online operation. This is vital for organizations that require maximum uptime and concurrent user activity during index operations.
  • Achieve Maximum Scalability with Windows Server 2008 R2 Windows Server 2008 R2 is built to achieve unprecedented workload size, dynamic scalability, and across-the-board availability and reliability. As a result, SQL Server 2012 can achieve maximum scalability when running on Windows Server 2008 R2 because it supports up to 256 logical processors and 2 terabytes of memory in a single operating system instance.
Manageability Enhancements
SQL Server deployments are growing more numerous and more common in organizations. This fact
demands that all database administrators be prepared by having the appropriate tools to successfully
manage their SQL Server infrastructure. Recall that the previous releases of SQL Server included
many new features tailored toward manageability. For example, database administrators could easily
leverage Policy Based Management, Resource Governor, Data Collector, Data-tier applications, and
Utility Control Point. Note that the product group responsible for manageability never stopped
investing in manageability. With SQL Server 2012, they unveiled additional investments in SQL Server tools and monitoring features. The following list articulates the manageability enhancements in SQL Server 2012:SQL Server Management Studio With SQL Server 2012, IntelliSense and Transact-SQL debugging have been enhanced to bolster the development experience in SQL Server Management Studio.IntelliSense Enhancements A completion list will now suggest string matches based on
partial words, whereas in the past it typically made recommendations based on the first
character.
  • A new Insert Snippet menu This new feature is illustrated in Figure 1-4. It offers developers a categorized list of snippets to choose from to streamline code. The snippet picket tooltip can be launched by pressing CTRL+K, pressing CTRL+X, or selecting it from the Edit menu.
  • Transact-SQL Debugger This feature introduces the potential to debug Transact-SQL scripts on instances of SQL Server 2005 Service Pack 2 (SP2) or later and enhances breakpoint functionality.
  • Resource Governor Enhancements Many organizations currently leverage Resource Governor to gain predictable performance and improve their management of SQL Server workloads and resources by implementing limits on resource consumption based on incoming requests. In the past few years, customers have also been requesting additional improvements to the Resource Governor feature. Customers wanted to increase the maximum number of resource pools and support large-scale, multitenant database solutions with a higher level of isolation between workloads. They also wanted predictable chargeback and vertical isolation of machine resources. The SQL Server product group responsible for the Resource Governor feature introduced new capabilities to address the requests of its customers and the SQL Server community. To begin, support for larger scale multitenancy can now be achieved on a single instance of SQL Server because the number of resource pools Resource Governor supports increased from 20 to 64. In addition, a maximum cap for CPU usage has been introduced to enable predictable chargeback and isolation on the CPU. Finally, resource pools can be affinitized to an individual schedule or a group of schedules for vertical isolation of machine resources.
A new Dynamic Management View (DMV) called sys.dm_resource_governor_resource_pool_ affinity improves database administrators’ success in tracking resource pool affinity. Let’s review an example of some of the new Resource Governor features in action. In the following example, resource pool Pool25 is altered to be affinitized to six schedulers (8, 12, 13, 14, 15, and 16), and it’s guaranteed a minimum 5 percent of the CPU capacity of those schedulers. It can receive no more than 80 percent of the capacity of those schedulers. When there is contention for CPU bandwidth,
the maximum average CPU bandwidth that will be allocated is 40 percent.
ALTER RESOURCE POOL Pool25
WITH(
MIN_CPU_PERCENT = 5,
MAX_CPU_PERCENT = 40,
CAP_CPU_PERCENT = 80,
AFFINITY SCHEDULER = (8, 12 TO 16),
MIN_MEMORY_PERCENT = 5,
MAX_MEMORY_PERCENT = 15,
);
  • Contained Databases Authentication associated with database portability was a challenge in the previous versions of SQL Server. This was the result of users in a database being associated with logins on the source instance of SQL Server. If the database ever moved to another instance of SQL Server, the risk was that the login might not exist. With the introduction of contained databases in SQL Server 2012, users are authenticated directly into a user database without the dependency of logins in the Database Engine. This feature facilitates better portability of user databases among servers because contained databases have no external dependencies.
  • Tight Integration with SQL Azure A new Deploy Database To SQL Azure wizard, pictured in Figure 1-5, is integrated in the SQL Server Database Engine to help organizations deploy an on-premise database to SQL Azure. Furthermore, new scenarios can be enabled with SQL Azure Data Sync, which is a cloud service that provides bidirectional data synchronization between databases across the datacenter and cloud.
  • Startup Options Relocated Within SQL Server Configuration Manager, a new Startup Parameters tab was introduced for better manageability of the parameters required for startup. A DBA can now easily specify startup parameters compared to previous versions of SQL Server, which at times was a tedious task. The Startup Parameters tab can be invoked by right-clicking a SQL Server instance name in SQL Server Configuration Manager and then selecting Properties.
  • Data-Tier Application (DAC) Enhancements SQL Server 2008 R2 introduced the concept of data-tier applications. A data-tier application is a single unit of deployment containing all of the database’s schema, dependent objects, and deployment requirements used by an application. SQL Server 2012 introduces a few enhancements to DAC. With the new SQL Server, DAC upgrades are performed in an in-place fashion compared to the previous side-byside upgrade process we’ve all grown accustomed to over the years. Moreover, DACs can be deployed, imported and exported more easily across premises and public cloud environments, such as SQL Azure. Finally, data-tier applications now support many more objects compared to the previous SQL Server release.
Read More