SQL Server 2012 Upgrade Technical Reference Guide White Paper
SQL Server 2012 Upgrade Technical Reference Guide White Paper
Technical Reviewer: Erick Ellis, Sarah McDevitt, Michael Rys, Mahadevan Venkatraman,
Chaitanya Medikonduri, Robert Hutchison, Ed Katibah, Milan Stojic, RobAnn Mateja, Umachandar
Jayachandran, Jan Engelsberg, Miles Trochesset, Tobias Ternstrom, Wee Hyong Tok, Nathaniel
Scharer, Krzysztof Kozielczyk, Edward Melomed, Heidi Steen, Jack Richins, Gregory Leake, T.K.
Anand, Sanjay Nagamangalam, Daryush Laqab, Syam Kumar Nair, Joe Yong, Darmadi Komo
Summary: This technical guide takes you through the essentials for upgrading SQL
Server 2005, SQL Server 2008, and SQL Server 2008 R2 instances to SQL Server 2012.
Copyright
This document is provided "as-is". Information and views expressed in this
document, including URL and other Internet Web site references, may change
without notice. You bear the risk of using it.
This document does not provide you with any legal rights to any intellectual
property in any Microsoft product. You may copy and use this document for your
internal, reference purposes.
2012 Microsoft Corporation. All rights reserved.
Contents
SQL Server 2012 Upgrade Technical Guide ....................................................... 1
Copyright .......................................................................................................................................... 2
Introduction ......................................................................................................... 17
Chapter 1: Upgrade Planning and Deployment .............................................. 18
Introduction ...................................................................................................................................18
Feature Changes in SQL Server 2012 ..................................................................................18
Upgrading SQL Server 2008 to SQL Server 2008 R2 ....................................................19
Preparing to Upgrade ................................................................................................................20
Upgrade Strategies........................................................................................................................................ 20
Upgrade Tools ................................................................................................................................................. 36
SQL Server 2012 Setup................................................................................................................................. 42
Allowable Upgrade Paths ............................................................................................................................ 48
Application and Connection Requirements ......................................................................................... 55
Upgrading Applications that Use the .NET Framework ................................................................... 56
Plan for Backups ............................................................................................................................................. 58
Upgrading Both Windows and SQL Server .......................................................................................... 59
Upgrading Multiple Instances ................................................................................................................... 61
Upgrading Very Large Databases ............................................................................................................ 62
Upgrading High Availability Servers ....................................................................................................... 62
Minimizing Upgrade Downtime ............................................................................................................... 62
Conclusion ......................................................................................................................................94
Additional References ...............................................................................................................94
Chapter 3: Relational Databases ........................................................................ 95
Introduction ...................................................................................................................................95
Relational Database Configurations ....................................................................................95
Upgrade Considerations...........................................................................................................96
Full-Text Search .............................................................................................................................................. 97
What Can Be Upgraded? ............................................................................................................................. 98
What Cannot Be Upgraded? ...................................................................................................................... 99
10
Upgrading from SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2 280
In-Place Upgrade.......................................................................................................................................... 280
Side-by-Side Upgrade ................................................................................................................................ 281
11
12
Upgrading from SSAS 2005, SSAS 2008, or SSAS 2008 R2 .................................... 339
Side-By-Side Upgrade ................................................................................................................................ 340
In-Place Upgrade.......................................................................................................................................... 340
13
14
Updating Report Projects and Definitions for Use in BIDS .......................................................... 395
Upgrade Tools ............................................................................................................................................... 396
64-Bit Considerations ................................................................................................................................. 396
Known Issues and Workarounds ............................................................................................................ 396
Backup and Rollback Plan ......................................................................................................................... 397
15
16
Introduction
To attain a smooth and trouble-free upgrade to SQL Server 2012, you must plan for the
upgrade and address the complexities of your application. Like all IT projects, planning
and then testing your plan gives you confidence that you will succeed. But if you ignore
the planning process, you increase the chances of running into difficulties that can
derail and delay your upgrade.
This document takes you through the essential technical details for planning and
testing an upgrade of existing SQL Server 2005, 2008, and 2008 R2 instances to SQL
Server 2012. You will be presented with best practices for preparation, planning, preupgrade tasks, and post-upgrade tasks. All the SQL Server components are covered,
each in its own chapter.
This document is a supplement to SQL Server 2012 Books Online. It is not intended to
supersede any information in SQL Server Books Online or in the Microsoft Knowledge
Base articles. The reader will notice many links to SQL Server Books Online topics and
Knowledge Base articles. In all such cases, the information in this document is included
to provide the context you need to decide whether to spend the time to read the
linked article. If there are any discrepancies between this document and a linked article,
the linked article is assumed to be more accurate.
17
Cloud on Your Terms: Enables you to create and scale business solutions fact.
To better understand the SQL Server 2012 features that make upgrading helpful, see
the SQL Server 2012 Home page
(http://www.microsoft.com/sqlserver/en/us/default.aspx).
18
SQL Server 212 introduces important new features in the mission critical area, most
notably with new AlwaysOn features, as well as the new PowerView application for
Analysis Services reporting. For more information about these and other new features,
see SQL Server 2012 Editions (http://www.microsoft.com/sqlserver/en/us/editions.aspx)
and download the SQL Server 2012 Product Guide (http://www.microsoft.com/enus/download/details.aspx?id=29418).
SQL Server 2008 failover clustering has some important considerations because
Windows Server 2008 R2 was released after SQL Server 2008, and SQL Server
2008 R2 takes advantage of new Windows Server 2008 R2 failover clustering
features. For information about these new features, see the failover clustering
sections of Chapter 4, High Availability.
Because SQL Server 2008 and SQL Server 2008 R2 instances share many of the
same components, running them together on the same server over a long
period of time has a number of implications:
o You must update both the SQL Server 2008 and SQL Server 2008 R2
instances separately with service packs and cumulative updates.
o Installing SQL Server 2008 R2 on the same server as SQL Server 2008 will
automatically upgrade the Management Tools to the SQL Server 2008 R2
version, amounting to an automatic in-place upgrade of the Management
Tools.
o Uninstalling the SQL Server 2008 R2 instance will prompt you about
removing shared components. If you remove shared components
required by the SQL Server 2008 instance, you will be warned that doing
so may make the SQL Server 2008 instance unusable.
19
Most components of SQL Server do not differ significantly from SQL Server 2008 to
SQL Server 2008 R2 and can be upgraded using either the in-place or side-by-side
strategies, as described in the next section and in the remaining chapters of this
document. For more information about SQL Server 2008 and SQL Server 2008 R2, see
Considerations for Side-by-Side Instances of SQL Server 2008 R2 and SQL Server 2008
(http://msdn.microsoft.com/en-us/library/ee210714.aspx) in SQL Server 2008 R2 Books
Online.
Preparing to Upgrade
To prepare for an upgrade, begin by collecting information about the effect of the
upgrade and the risks it might involve. When you identify the risks up front, you can
determine how to lessen and manage them throughout the upgrade process.
Upgrade scenarios will be as complex as your underlying applications and instances of
SQL Server. Some scenarios within your environment might be simple, other scenarios
complex. Start to plan by analyzing upgrade requirements, including reviewing upgrade
strategies, understanding SQL Server 2012 hardware and software requirements, and
discovering any blocking problems caused by backward-compatibility issues.
Upgrade Strategies
An upgrade is any kind of transition from SQL Server 2005, 2008, or 2008 R2 to SQL
Server 2012. There are two fundamental strategies for upgrading, with two main
variations in the second strategy:
In-place upgrade: Using the SQL Server 2012 Setup program to directly
upgrade an instance of SQL Server 2005, 2008, or 2008 R2. The older instance of
SQL Server is replaced.
Side-by-side upgrade: Using steps to move all or some data from an instance
of SQL Server 2005, 2008, or 2008 R2 to a separate instance of SQL Server 2012.
There are two main variations of the side-by-side upgrade strategy:
One server: The new instance exists on the same server as the target instance.
Two servers: The new instance exists on a different server than the target
instance.
In-Place Upgrade
By using an in-place upgrade strategy, the SQL Server 2012 Setup program directly
replaces an instance of SQL Server 2005, 2008, or 2008 R2 with a new instance of SQL
SQL Server 2012 Upgrade Technical Guide
20
Server 2012 on the same x86 or x64 platform. (An in-place upgrade requires that the
old and new instances of SQL Server be on the same x86 or x64 platform. See the note
in "Extended System Support (WOW64)" later in this chapter.) This kind of upgrade is
called "in-place" because the upgraded instance of SQL Server 2005/2008/2008 R2 is
actually replaced by the new instance of SQL Server 2012. You do not have to copy
database-related data from the older instance to SQL Server 2012 because the old data
files are automatically converted to the new format. When the process is complete, the
old instance of SQL Server 2005/2008/2008 R2 is removed from the server, with only
the backups that you retained being able to restore it to its previous state.
Note: If you want to upgrade just one database from a legacy instance of SQL
Server and not upgrade the other databases on the server, use the side-by-side
upgrade method instead of the in-place method.
Figure 1 shows the before and after states of an in-place upgrade.
Figure 1: In an in-place upgrade, SQL Server 2012 Setup replaces a legacy instance of
SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2
SQL Server 2012 Setup requires that all SQL Server components be upgraded
together. Setup will detect all the components of the instance to be upgraded
and will require that they all be upgraded immediately. In other words, you
cannot upgrade only an instance of the SQL Server 2008 R2 Database Engine
without also upgrading the Analysis Services component.
SQL Server 2012 Upgrade Technical Guide
21
Here are the major steps that the SQL Server 2012 Setup program takes when you
perform an in-place upgrade:
1. The SQL Server 2012 Setup prerequisitesMicrosoft .NET Framework 3.5 Service
Pack 1 (SP1) or a later version, SQL Server Native Client, and so onare
installed. The legacy instance databases continue to be available.
2. Setup checks for upgrade blocking issues, a small set of issues that will
completely block an upgrade. If it finds any, Setup will list them. You must fix
them and restart the upgrade process.
3. If a pending restart exists, you will have to restart the computer.
4. Setup installs the required SQL Server 2012 executables and support files.
5. Setup stops the legacy SQL Server service. At this point, the legacy instance is no
longer available.
6. SQL Server 2012 updates the selected component data and objects.
7. Setup removes the legacy executables and support files in addition to the legacy
SQL Server 2000 R2 tools. Legacy SQL Server 2005/2008/2008 R2 tools are not
removed. (See Chapter 2, "Management and Development Tools," for more
information).
The new instance of SQL Server 2012 is now fully available. The legacy instance of SQL
Server has been replaced and must be reinstalled from a backup if the need arises.
Side-by-Side Upgrade
In a side-by-side upgrade, instead of directly replacing the older instance of SQL Server,
required database and component data is transferred from a legacy instance of SQL
Server 2005/2008/2008 R2 to a separate instance of SQL Server 2012. It is called a
"side-by-side" method because the new instance of SQL Server 2012 runs alongside the
legacy instance of SQL Server, either on the same server or on a different server.
There are two important options when you use the side-by-side upgrade method:
22
You can transfer data and components to an instance of SQL Server 2012 that is
located on a different physical server or on a different virtual machine.
You can transfer data and components to an instance of SQL Server 2012 on the
same physical server.
Both options let you run the new instance of SQL Server 2008 R2 alongside the legacy
instance of SQL Server 2005/2008/2008 R2. Typically, after the upgraded instance is
accepted and moved into production, you can remove the older instance.
Figure 2 shows the before and after states of a side-by-side upgrade on two servers.
23
Data files
Database objects
Configuration settings
Security settings
Here are the main steps that you must perform when doing a side-by-side upgrade of
SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2 to SQL Server 2012:
1. Install a separate instance of SQL Server 2012 on the legacy server or on a
separate server. The legacy instance continues to be available.
2. Run the SQL Server 2012 Upgrade Advisor against the legacy instance, and
remove any upgrade blocker issues it finds.
SQL Server 2012 Upgrade Technical Guide
24
3. Stop all update activity to the legacy instance. This might involve disconnecting
all users or forcing applications to read-only activity.
4. Transfer data, packages, and other objects from the legacy instance to the
instance of SQL Server 2012.
5. Apply supporting objects such as SQL Server Agent jobs, security settings, and
configuration settings to the new instance of SQL Server 2012.
6. Upgrade SSIS (and potentially Data Transformation ServicesDTS) packages to
SSIS (see Chapter 17, "Integration Services," for more information).
7. Verify that the new instance supports the required applications by using
validation scripts and user-acceptance tests.
8. If the new instance passes validation and acceptance tests, redirect applications
and users to the new instance. At this point, the new instance is available and
databases are online.
9. Keep your legacy instance for data recovery until you are absolutely confident
that no problems exist on your new production database instance.
A side-by-side upgrade to a new server offers the best of both worlds: You can take
advantage of a new and potentially more powerful server and platform, but the legacy
server remains as a fallback if you encounter a problem. This method could also
potentially reduce upgrade downtime by letting you have the new server and instances
tested, up, and running without affecting a current server and its workloads. You can
test and address hardware or software problems encountered in bringing the new
server online without any downtime of the legacy system. Although you would have to
find a way to export data out of the new system to go back to the old system, rolling
back to the legacy system would still be less time-consuming than a full SQL Server
reinstall and restoring the databases, which a failed in-place upgrade would require.
The downside of a side-by-side upgrade is that increased manual interventions are
required, so it might take more preparation time by an upgrade/operations team.
However, the benefits of this degree of control can often be worth the additional effort.
Upgrading SQL Server 2000 to SQL Server 2012
You cannot upgrade a SQL Server 2000 instance or database to SQL Server 2012.
For an in-place upgrade, upgrade the SQL Server 2000 instance to SQL Server
2005, SQL Server 2008, or SQL Server 2008 R2. Then apply SQL Server 2012
Setup.
SQL Server 2012 Upgrade Technical Guide
25
For a side-by-side upgrade, first restore the SQL Server 2000 databases to SQL
Server 2005, 2008, or 2008 R2 and then restore the resulting database to SQL
Server 2012.
In-Place Upgrade
Side-by-Side Upgrade
One only
Two
One
One or more
Automatic
Manual
Automatic
Manual
Supporting tool
Another way to view the differences between an in-place upgrade and a side-by-side
upgrade is to focus on how much of the legacy instance you want to upgrade. Table 2
shows how you can use the component level of the upgrade, combined with the
resulting number of instances, to determine what upgrade strategies are available for
your needs.
Table 2: Upgrade Strategies and Components
Single Resulting Instance
Component Level
All components
In-place
Side-by-side
Single component
In-place
Side-by-side
Single database
Not available
Side-by-side
An in-place upgrade can be easier and faster, especially for small systems,
because data and configuration options do not have to be manually transferred
to a new server.
26
The resulting upgraded instance has the same name as the original.
You must upgrade the whole instance or a major SQL Server component. For
example, you cannot directly upgrade a single database.
You must inspect the whole instance for backward-compatibility issues and
address any blocking issues before SQL Server 2012 Setup can continue.
Upgrading in place is not recommended for all SQL Server components, such as
some DTS packages. See Chapter 17, "Integration Services," for more
information about how to upgrade DTS packages.
Because the new instance of SQL Server 2012 replaces the legacy instance, you
cannot run the two instances side by side to compare them. Instead, you should
use a test environment for comparisons.
It gives more granular control over which database objects are upgraded.
The legacy database server can run alongside the new server. You can perform
test upgrades and research and resolve compatibility issues without disturbing
the production system.
The legacy database server remains available during the upgrade, although it
cannot be updated for at least the time that is required to transfer data.
Users can be moved from the legacy system in a staged manner instead of all at
the same time. Even though your system might have passed all validation and
acceptance tests, a problem could still occur. But if a problem does occur, you
will be able to roll back to the legacy system.
SQL Server 2012 Upgrade Technical Guide
27
You must manually transfer dataas well as security, configuration settings, and
other supporting objectsto the new instance.
Synchronization of data from the legacy server to a new server will be required
to capture data modifications that occurred to the legacy system while setting
up the new system and its original copy of the data.
In-Place Upgrade
Advantages
Setup automatically upgrades
data and settings in place,
without the need for a manual
transfer of data or settings.
The resulting upgraded
instance has the same name as
the original.
Applications continue to
connect to the same instance
name.
28
Consideration
In-Place Upgrade
Advantages
DBA available to
implement the
upgrade)
interventions. Setup
automates the upgrade
process.
Require minimal user
downtime
strategy.
revert/rollback in case
issue encountered
Schedule different
different user
can be removed.
same instance
Preserve the server and
instance name
instance name.
Server consolidation
project
Applications required
original system.
operating system
29
Consideration
Shortage of disk space
In-Place Upgrade
Advantages
Because there is only one
in production
Nonenot supported.
2012 Setup
requirements.
requirements for
installation
Changing to a lower
Nonenot supported.
Nonenot supported.
Nonenot supported.
window is available
Upgrading from a
Nonenot supported.
Server 7.0
nonclustered legacy
instance of SQL Server
to a clustered instance
of SQL Server 2012
instances
30
Consideration
Upgrading very large
In-Place Upgrade
Advantages
Setup converts existing data
databases (VLDBs)
Data must be
upgrade window
Localization: change of
Upgrading Notification
Nonenot supported.
Services
Application integration
Server integration
31
32
Editions. The in-place upgrade strategy does not support all paths between
editions. For example, to upgrade a SQL Server 2005 Enterprise instance to SQL
Server 2012 Standard Edition, you must perform a side-by-side upgrade because
Setup does not support an in-place upgrade path. See "Allowable Upgrade
Paths" later in this chapter for more information.
33
Some factors alone might be enough for you to decisively choose one strategy over
another. Regardless of what strategy you select, do not forget testing and validation.
Even if you select an in-place upgrade strategy, test the upgrade process and results on
a separate server first. For more testing information, see the "Test the Upgrade Plan"
section later in this chapter.
Backward Compatibility
When planning for an upgrade to SQL Server 2012, you have to understand what
features are deprecated, discontinued, or changed in the new version. Being aware of
these changes beforehand can help you prevent both performance problems and
issues related to making the application available.
Generally, SQL Server 2012 is backward compatible with SQL Server 2005/2008/20008
R2. However, you should examine some feature changes during the planning process.
The most serious backward-compatibility issues that will affect planning are those that
will block an in-place upgrade and prevent an installation of SQL Server 2012. If the
SQL Server 2012 Setup program detects these issues during an in-place upgrade, it will
exit the installation, leaving the legacy instance unchanged. The SQL Server 2012
Upgrade Advisor is the best tool for finding these kinds of blocking issues beforehand.
Chances are good that you will encounter only a few issues, if any.
In the component- and feature-specific chapters in this document, you can review the
relevant details for each of these categories. For more information, see SQL Server
Backward Compatibility (http://technet.microsoft.com/enus/library/cc707787(SQL.110).aspx ) in SQL Server 2012 Books Online.
Note: The most serious backward-compatibility issues that will affect your planning
are those that will block an in-place upgrade and prevent the installation of SQL
Server 2012. If the SQL Server 2012 Setup program detects these issues during an
in-place upgrade, it will exit the installation, leaving the legacy instance unchanged.
You must resolve the blocking issues to continue.
Deprecated Features
Features that are deprecated in SQL Server 2012 still operate the same as in the legacy
versions. However, they will be removed in the next version of SQL Server. Access to
these features does not necessarily have to be removed to complete an upgrade.
However, you should eventually address them because they could cause problems with
upgrades after SQL Server 2012. For more information, see Deprecated SQL Server
Features in SQL Server 2012 (http://msdn.microsoft.com/enSQL Server 2012 Upgrade Technical Guide
34
35
Upgrade Tools
We have talked about the value of the SQL Server 2012 Upgrade Advisor several times
already in this chapter. Some other tools are also available to help automate the
upgrade process to SQL Server 2012. Each tool has its own purpose and timing, so it is
best to become familiar with all the tools and then use those most appropriate to each
upgrade project.
SQL Server 2012 Upgrade Advisor
Perhaps the most important tool of the tools typically used for upgrade planning is
Upgrade Advisor. Upgrade Advisor smoothes the transition to SQL Server 2012 by
predicting issues in your legacy instances of SQL Server. It analyzes objects and code
within legacy instances and produces reports detailing upgrade issues, if there are any,
organized by SQL Server component. The resulting reports show detected issues and
provide guidance about how to fix the issues or work around them. The reports are
stored on disk, and you can review them by using Upgrade Advisor or export them to
Microsoft Excel for further analysis.
In addition to analyzing data and database objects, Upgrade Advisor can analyze
Transact-SQL (T-SQL) scripts and SQL Server Profiler/SQL Trace traces. Upgrade Advisor
examines SQL code for syntax that is no longer valid in SQL Server 2012. It generates a
report listing the code in question, together with links to where you can find more
information to help resolve the questionable code. For information about how to
upgrade T-SQL queries, stored procedures, scripts, and application code, see Chapter
10, "Transact-SQL Queries."
Requirements for running Upgrade Advisor are as follows:
The Microsoft .NET Framework 4 (the same version of the .NET Framework
included with SQL Server 2012 and Visual Studio 2010)
36
server, and you can execute it from the Command Prompt window by using a
configuration filename as an input parameter.
Note: You can run the SQL Server 2012 Upgrade Advisor only against instances of
SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2. You cannot run it
against instances of SQL Server 2000 or SQL Server 7.0.
Upgrade Advisor is a separate download. The most recent downloadable version is
available as part of the Microsoft SQL Server 2012 Feature Pack
(http://www.microsoft.com/en-us/download/details.aspx?id=29065). You can find more
information about this valuable tool in Use Upgrade Advisor to Prepare for Upgrades
(http://msdn.microsoft.com/en-us/library/ms144256(v=sql.110).aspx).
Best Practices Analyzer for SQL Server 2005, SQL Server 2008, and SQL Server
2008 R2
Before you install SQL Server 2012, you should also run the SQL Server Best Practices
Analyzer (BPA) against your current legacy instances of SQL Server. If bad or
questionable practices exist, you could address them before the upgrade, moving the
fixes through test and into production. Using best practices on the legacy SQL Server
systems first will help ensure a smoother upgrade, but that is not always possible. You
might have to change some practices during the upgrade process instead.
You can download the SQL Server 2005 version of BPA at the SQL Server 2005 Best
Practices Analyzer (August 2008) (http://www.microsoft.com/enus/download/details.aspx?displaylang=en&id=23864) download page.
You can download the SQL Server 2008 R2 BPA at the SQL Server 2008 R2 Best
Practices Analyzer (http://www.microsoft.com/en-us/download/details.aspx?id=15289)
download page. Use this for both SQL Server 2008 and SQL Server 2008 R2.
After you have upgraded, be sure to run the SQL Server 2012 Best Practices Analyzer
(http://www.microsoft.com/en-us/download/details.aspx?id=29302). See also "PostUpgrade Tasks" in this chapter.
SQL Server 2012 Setup: System Configuration Checker
An in-place upgrade uses SQL Server 2012 Setup to directly upgrade SQL Server
2005/2008/2008 R2. The SQL Server 2012 Setup program installs prerequisites such as
the .NET Framework and PowerShell 2.0. It also scans the destination computer for
minimum hardware and software requirements, in addition to a compatible SQL Server
SQL Server 2012 Upgrade Technical Guide
37
edition upgrade path for an in-place upgrade. To do this, the SQL Server 2012 Setup
program contains a utility named the System Configuration Checker (SCC) that
performs a scan of the computer in preparation for an installation. For more
information, see Check Parameters for the System Configuration Checker
(http://technet.microsoft.com/en-us/library/ms143753(SQL.110).aspx) in SQL Server
2012 Books Online.
The Setup SCC looks for conditions that will prevent a successful SQL Server installation
or upgrade. These checks occur before Setup starts the SQL Server 2012 Installation
Wizard and report any issues that would block an installation along with advice about
how to address the blocking issues. The Setup SCC uses rules from the following
categories; for more information about any of these categories, see the related link
from SQL Server 2012 Books Online:
Installation Rules
(http://technet.microsoft.com/en-us/library/cc646015(SQL.110).aspx)
Uninstallation Rules
(http://technet.microsoft.com/en-us/library/cc645979(SQL.110).aspx)
The common, relevant rulesacross all four categoriesfor an in-place upgrade and a
side-by-side upgrade, are as follows; failing any of these rules will result in a blocking
issue that could prevent an in-place upgrade:
The destination computer must be connected to the Internet while the .NET
Framework security check validates a certificate.
The CPU architecture of the installation program must match the CPU
architecture of features intended for upgrading.
38
SCC checks that neither SQL Server 7.0 nor SQL Server 7.0 OLAP Services is
installed on the server. SQL Server 2012 is not supported on the same server
with SQL Server 7.0.
Here are some additional checks that SCC performs to determine whether the SQL
Server editions in an in-place upgrade path are valid:
Checks the system databases for features that are not supported in the SQL
Server edition to which you are upgrading.
Checks all user databases for features that are not supported by the SQL Server
edition.
Checks whether the selected instance of SQL Server meets the upgrade matrix
requirements (see "Allowable Upgrade Paths" in this section).
Checks whether the edition of the selected instance of SQL Server is supported
in this scenario (see "Allowable Upgrade Paths" in this section as well as Chapter
4, "High Availability," later in this guide).
For more information about SQL Server 2012 Setup, see "SQL Server 2012 Setup" later
in this chapter.
Upgrade Assistant for SQL Server 2012 (UAFS)
The Upgrade Assistant for SQL Server 2012 (UAFS) is an external tool that lets you
determine in a test environment how an application currently running on SQL Server
2005, 2008, or 2008 R2 will run on SQL Server 2012. This tool uses the SQL Server 2012
Management Tools Distributed Replay (DReplay) utility, together with baseline and
trace replays in a test environment, to help identify compatibility issues.
The requirements for using the Upgrade Assistant are as follows:
39
Production Server: Contains the databases that will be migrated and the activity
that will be replayed.
Baseline Server: Has the same version of SQL Server as the Production Server
with the databases to be migrated on it. It is isolated in order to retrieve baseline
information without the effect of other applications or server activity. The
Upgrade Assistant for SQL Server 2012 will run its replay against this server,
resulting in the baseline trace file.
Test Server: This server has the new SQL Server 2012 instance.
If testing an in-place upgrade, this will be the baseline server after the SQL
Server 2012 upgrade has been applied.
Report Server: This server with SQL Server 2012 Distribute Replay is used to save
trace file comparison results.
The Upgrade Assistant for SQL Server 2012 contains step-by-step instructions on
how to configure the Distributed Replay utility.
Windows Server 2003 R2, Windows Vista, or Windows XP SP2 or later versions
SQL Server 2000 SP4 or later versions or SQL Server 2005 SP2 or later versions
Using the reports on the Report Server, compare the results of the baseline test
workload on SQL Server 2012 against the original baseline. If there are any material
differences between the two results, work to resolve them in advance of the production
upgrade.
For more information and download instructions, see Upgrade Assistant for SQL Server
2012 (UAFS) (http://www.scalabilityexperts.com/tools/downloads.html) on the
Scalability Experts Tools Downloads page.
SQL Server Profiler
SQL Server Profiler can record a running workload and then replay that same activity
from a given SQL Server instance, making it a valuable tool for preparing an upgrade.
Profiler is useful for simulating an upgrade to determine performance and correct
behavior. For example, you can use SQL Server 2012 Profiler to trace database activity
on a SQL Server 2005/2008/2008 R2 instance under load and save the trace. You can
then restore the legacy SQL Server database to two instances on equivalent hardware:
SQL Server 2012 Upgrade Technical Guide
40
an instance of the legacy SQL Server and an instance of SQL Server 2012. Run the
replay on each (but at different times if on the same server). While you are running the
replay, also run a Profiler trace on each run, capturing for errors and query durations.
By comparing the results, you can determine whether the upgrade behaves correctly
(without error) and performs well.
Note: When using Profiler make sure that the trace file contains a truly
representative load against the server, one that contains the full range of all queries
that the application will submit to the database. With a full range of queries and
sufficient load, testing can add confidence to the upgrade plan.
For more information about how to use Profiler for replay, see Replaying Traces
(http://technet.microsoft.com/en-us/library/ms190995(SQL.110).aspx) in SQL Server
2012 Books Online.
System MonitorSQL Server: Deprecated Features Object
You can use the SQL Server 2012 System Monitor (Perfmon) counter called
SQLServer:Deprecated Features to monitor whether your application is submitting
commands to the SQL Server 2012 Database Engine that are scheduled for removal
from SQL Server in future releases. You should remove such deprecated commands
from SQL Server 2012 applications after they are detected. You can use this counter to
help plan modifications to your application code so that when you upgrade to the next
version of SQL Server after SQL Server 2012, the upgrade process will go more
smoothly. Select which kind of feature to monitor by using the Instance selection box
for the counter. System Monitor records the total number of times the deprecated
feature was encountered since SQL Server 2012 was last started. For more information
about how to use this tool, see SQL Server, Deprecated Features Object
(http://msdn.microsoft.com/en-us/library/bb510662(v=sql.110).aspx) in SQL Server
2012 Books Online.
Analysis Services Migration Wizard
The Analysis Services Migration Wizard can help with a side-by-side upgrade of SSAS.
For information about this tool, see Chapter 16, "Analysis Services."
Notification Services
You cannot perform an in-place upgrade of SQL Server Notification Services because it
is not installed by SQL Server 2012. You must use the SQL Server 2008 R2 Notification
Services backward compatibility add-in; see Chapter 9 in SQL Server 2008 R2 Upgrade
SQL Server 2012 Upgrade Technical Guide
41
For an in-place upgrade, the target SQL Server 2012 server and the legacy instance of
SQL Server 2005/2008/2008 R2 must satisfy some additional requirements for SQL
Server 2008 R2:
Cross-version instances of SQL Server 2012 are not supported. Version numbers
of the Database Engine, Analysis Services, and Reporting Services components
must be the same throughout an instance of SQL Server 2012. Therefore, you
must upgrade all these components together during an in-place upgrade.
Make sure that sufficient disk space is available for SQL Server 2012 Setup. Disk
space requirements vary based on the components selected to upgrade. For disk
space amounts, see the "Hard Disk Space Requirements (32-Bit and 64-Bit)"
section in the Hardware and Software Requirements for Installing SQL Server
2012 topic (http://msdn.microsoft.com/en-us/library/ms143506(v=sql.110).aspx)
in SQL Server 2012 Books Online.
42
Before upgrading SQL Server, enable Windows Authentication for SQL Server
Agent and verify the default configuration (that the SQL Server Agent service
account is a member of the SQL Server sysadmin group).
Before upgrading from one edition of SQL Server 2012 to another, verify that the
functionality currently being used is supported in the edition to which you are
upgrading. For more information, see the section for specific components in
Planning a SQL Server Installation (http://msdn.microsoft.com/enus/library/bb500442(v=sql.110).aspx) in SQL Server 2012 Books Online.
Cross-platform in-place upgrades from 32-bit to 64-bit (x86 to x64) versions and
vice versa are not supported.
Make sure that you are running a supported version of the Windows operating
system.
For more information, see the "Unsupported Scenarios" section in the Supported
Version and Edition Upgrades topic (http://msdn.microsoft.com/enus/library/ms143393(v=sql.110).aspx) in SQL Server 2012 Books Online.
SQL Server Prerequisites Installed by Setup
The SQL Server 2012 Installation Wizard installs the following prerequisites (if they are
not already present on the computer):
43
To reduce the time that is required for the upgrade process, install the .NET Framework
3.5 SP1 components (you must have SP1 or a later version) and SQL Server 2012 Native
Client beforehand on the server that will be upgraded. Then, include the same
components on the baseline image of the test server. If the production system cannot
be disturbed in any way before the scheduled downtime for the upgrade process, the
SQL Server 2012 Setup program will automatically install the prerequisites as part of
the upgrade process. However, this increases the time that is required for the upgrade.
PowerShell 2.0 is required by SQL Server 2012. If the target SQL Server is running
Windows Server 2008 SP2, install and enable PowerShell 2.0. If it is running Windows
Server 2008 R2 SP1, enable PowerShell 2.0. SQL Server 2012 Setup also installs the SQL
Server PowerShell snap-ins.
Note: The sqlps.exe command prompt utility for running SQL Server 2008 R2
PowerShell snap-ins has been deprecated.
Instance ID and Paths
Whether you are performing an in-place upgrade or a side-by-side upgrade, SQL
Server Setup will ask for an Instance ID. The Instance ID is a unique identifier specified
during the upgrade (or install) to identify that specific SQL Server 2012 installation. The
Instance ID behaves similarly to an instance name, but it has some additional features.
Default instances of SQL Server always have a default value of MSSQLSERVER. In
addition, the Instance ID is recorded in SQL Server 2012 program files, which are
located by default at X:\Program Files\Microsoft SQL Server\MSSQL11.InstanceID,
where X is your system drive, such as drive C.
For a named instance, choose an Instance ID that makes sense; do not necessarily
accept default values. This is especially true for failover clustering implementations,
where instances are not "local" and will have a presence on each node. (For more
information about clustering, see Chapter 4, "High Availability.")
Minimum Hardware and Software Requirements for SQL Server 2012
In this section, we describe the minimum hardware and software requirements for
running SQL Server 2012. For detailed information about the minimum hardware and
software requirements for all editions of SQL Server 2012, see Hardware and Software
Requirements for Installing SQL Server 2012 (http://msdn.microsoft.com/enSQL Server 2012 Upgrade Technical Guide
44
SQL Server 2012 Setup will install .NET 4.0, the SQL Server Native Client, and the
required SQL Server 2012 Setup support files.
.NET requirements:
o If you are installing SQL Server 2012 on a Windows Vista SP2 or Windows
Server 2008 SP2 server, you must download and install .NET Framework
3.5.
o On Windows 7 and Windows Server 2008 R2 SP1, you must enable .NET
Framework 3.5.
o The .NET 4.0 is a requirement of SQL Server 2012, and SQL Server 2012
Setup will install it during the feature installation step.
o If you are installing SQL Server 2012 Express on Windows 2008 R1 SP1
Core, you must first install .NET 4.0.
Windows PowerShell 2.0 is not installed by SQL Server 2012 but it is required.
You can download and install Windows PowerShell 2.0 from the Windows
Management Framework site (http://support.microsoft.com/kb/968929).
45
SQL Server 2012 is supported on Windows Server 2008 R2 SP1 and later Server
Core installations.
The Setup SCC will block Setup if the requirements for processor type and
minimum operating system, in addition to other conditions, are not met. For
more information, see Check Parameters for the System Configuration Checker
(http://msdn.microsoft.com/en-us/library/ms143753(v=sql.110).aspx) in SQL
Server 2012 Books Online.
46
Windows Installer create temporary files on the system drive. Before you run Setup to
install or upgrade SQL Server, verify that you have at least 4 GB of available disk space
on the system drive for these files. (This requirement applies even if you install SQL
Server components to a non-system drive.) Table 4, from SQL Server 2012 Books
Online, shows the minimum disk space requirements for the major SQL Server 2012
components. For complete details, see Hard Disk Space Requirements (32-Bit and 64Bit) (http://msdn.microsoft.com/enus/library/ms143506(v=sql.110).aspx#harddiskspace).
Table 4: SQL Server 2012 Disk Space Minimum Requirements
Disk Space Minimum
Feature
Requirement
811 MB
345 MB
304 MB
Integration Services
591 MB
243 MB
Client Components
1823 MB
200 MB
47
SQL Server services cannot run under a local service account on a domain
controller.
After SQL Server 2012 is installed on a domain member server, the server's
network role cannot be changed from a domain member to a domain controller.
SQL Server must be uninstalled before the host computer is changed to a
domain controller.
SQL Server 2012 AlwaysOn failover cluster instances are not supported where
the cluster nodes are domain controllers.
SQL Server 2012 Setup cannot create security groups or provision services
accounts on a read-only domain controller; Setup will fail.
For more information, see the Installing SQL Server on a Domain Controller section in
Hardware and Software Requirements for Installing SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143506(v=sql.110).aspx).
Product Updates (Slipstreaming) in SQL Server 2012 Setup
SQL Server 2012 enhances the slipstreaming capability of SQL Server 2008 through a
new feature called Product Updates. Product Updates allows you to include the latest
product updates with the main product installation. For example, you can combine the
latest SQL Server 2012 Service Pack (SP) or Cumulative Update (CU) in the same file as
the RTM binaries. This can save you a lot of time and steps. Instead of having to install
(or upgrade) to SQL Server 2012 and install patches post-installation, these steps can
be combined into one. SQL Server does not ship slipstreamed, but you can create the
updated installation media on your own. For instructions on using Product Updates,
see Product Updates in SQL Server 2012 Installation (http://msdn.microsoft.com/enus/library/hh231670(v=SQL.110).aspx). For SQL Server 2012 restrictions on SQL Server
2008-style slipstreaming, see "Slipstream Functionality" in Deprecated SQL Server
Features in SQL Server 2012 (http://msdn.microsoft.com/enus/library/cc707789(v=sql.110).aspx).
48
If you have to upgrade earlier versions of SQL Server 2005/2008/2008 R2 and cannot
apply the necessary patches, use the side-by-side method.
Upgrading from SQL Server 7.0 to SQL Server 2012
SQL Server 2012 cannot directly upgrade a SQL Server 7.0 instance in-place. The
available options for upgrading from SQL Server 7.0 to SQL Server 2012 include the
following:
Upgrade the instance of SQL Server 7.0 in-place to SQL Server 2005 SP4, and
then upgrade the resulting instance in-place to SQL Server 2012. As you can see,
this in-place upgrade path requires two steps.
Upgrade the instance of SQL Server 7.0 to a new instance of SQL Server 2012 by
using a side-by-side upgrade method.
Whether you use a two-step in-place upgrade or a side-by-side upgrade, you should
use the SQL Server 2005 Upgrade Advisor to inspect the instance of SQL Server 7.0. If
any blocking issues (discontinued features or breaking changes) are found, you should
remove them. For more information, see the SQL Server 2005 Upgrade Technical
Reference Guide (http://www.microsoft.com/enus/download/details.aspx?DisplayLang=en&id=19471).
Upgrading SQL Server Components
SQL Server is a complex product, featuring many components that are fairly
independent. Table 5 shows the SQL Server 2005 components that you can upgrade
and what paths are available. Table 6 and Table 7 show the same information for SQL
Server 2008 and SQL Server 2008 R2, respectively.
SQL Server 2012 Upgrade Technical Guide
49
Table 5: Components and Upgrade Strategies: SQL Server 2005 SP4 to SQL Server 2012
SQL Server 2012
In-Place Upgrade
Side-by-Side Upgrade
Component
Database Engine
Wizard)
configurations)
Analysis Services
Integration
default configuration
Services
Reporting Services
only)
Notification
Not Available
Services
Guide (http://www.microsoft.com/enus/download/details.aspx?DisplayLang=en&id=19471)
Table 6: Components and Upgrade Strategies: SQL Server 2008 SP2 to SQL Server 2012
SQL Server 2012
In-Place Upgrade
Side-by-Side Upgrade
Component
Database Engine
Databases")
when possible)
SQL Server High
Availability Solutions
considerations
Integration Services
Reporting Services
50
Table 7: Components and Upgrade Strategies: SQL Server 2008 R2 SP1 to SQL Server
2012
SQL Server 2012
In-Place Upgrade
Side-by-Side Upgrade
Component
Database Engine
Databases")
when possible)
SQL Server High
Availability Solutions
considerations
Integration Services
Reporting Services
51
For a detailed view of what in-place upgrade paths are allowed, see Table 1 in
Appendix 1, "Version and Edition Upgrade Paths," in this guide and Supported Version
and Edition Upgrades (http://msdn.microsoft.com/enus/library/ms143393(v=sql.110).aspx) in SQL Server 2012 Books Online.
Upgrading Database Collation
As databases continue to expand and support a growing global market, users must be
able to work with character data in meaningful ways. Collations are a powerful way for
users to sort and compare strings according to their own cultural conventions.
Therefore, collations are an important factor when you create a database and operate
on the data. In addition, when you use the character data types such as char and
varchar, the collation dictates the code page and therefore determines which characters
can be represented for that data type.
SQL Server 2008 R2 introduced, and SQL Server 2012 continues with, collations that are
in full alignment with the collations provided by Windows Server 2008 R2. These new
collations are denoted by *_100 version and give users the most up-to-date and
linguistically accurate cultural sorting conventions.
The new collations include support for new East Asian government standards that are
linguistically correct for surrogates, support for Chinese minority scripts, the Unicode
5.0 case table, and weights to previously non-weighted characters that would have
compared equal.
Database collation upgrade considerations. Here are some considerations that might
affect an upgrade of a database collation:
Enables consistency across data types in SQL Server because nonUnicode data is converted to Unicode to perform comparison
operations.
SQL Server 2012 Upgrade Technical Guide
52
Changing the database collation does not alter the collations in pre-existing
tables. New tables that are created after you change to the new collation will use
the new collation.
53
For more information about how to change collations, you can download the following
white papers: The Impact of Changing Collations and of Changing Data Types from
Non-Unicode to Unicode (http://go.microsoft.com/fwlink/?LinkID=113891) and Best
Practices for Migrating Non-Unicode Data Types to Unicode.
(http://go.microsoft.com/fwlink/?LinkID=113890).
In-Place Upgrade and Localization
The English version of SQL Server is supported on all localized versions of supported
operating systems. In addition, localized versions of SQL Server are supported on
localized operating systems that are the same language as the localized SQL Server
version.
However, there are some important in-place upgrade restrictions when you change
from one language to another:
You cannot upgrade non-English localized versions of SQL Server to the Englishlanguage version of SQL Server 2012.
You cannot upgrade the English version of SQL Server to any non-Englishlanguage localized version of SQL Server 2012. Note: This is a change from SQL
Server 2005.
You cannot upgrade localized versions of legacy SQL Servers to a localized SQL
Server 2012 version if the upgrade is to a different localized language. The inplace upgrade must be to the same localized language.
If these operating system settings do not match the language of the localized SQL
SQL Server 2012 Upgrade Technical Guide
54
Server, set them correctly before you install SQL Server 2012. For more information, see
Local Language Versions in SQL Server (http://msdn.microsoft.com/enus/library/ee210665(v=sql.110).aspx) in SQL Server 2012 Books Online.
55
56
(http://msdn.microsoft.com/en-us/library/ms130892(v=sql.110).aspx)
For developer information about SQL Server 2012 data access, see the Microsoft Data
Developer Center (http://msdn.microsoft.com/en-us/data), which is the primary data
access site for Microsoft developer technologies.
Installing .NET Framework on Windows Server 2008 R2
Installing .NET Framework 3.51 on Windows Server 2008 R2 is different than any
previous version. If you try to use the standalone installation package that ships with
the DVD or that you can download, you will see an error message that you must use
the Role Management Tool to install or configure .NET Framework 3.5 SP1. The only
way to install .NET Framework 3.51 in Windows Server 2008 is using one of the
mechanisms provided by the operating system: the GUI-based Server Manager, a
command prompt, or via PowerShell. The good thing about this is that installing .NET
Framework 3.51 will not require a reboot, maximizing your uptime.
Installing .NET Using Server Manager
If you are not comfortable using a command prompt or PowerShell, you can use Server
Manager to configure .NET 3.51.
1. From the Start menu, select Administrative Tools and then Server Manager.
2. Select Features.
SQL Server 2012 Upgrade Technical Guide
57
Make a backup of the user databases and data after all users are out of the
system and before the upgrade process has begun. Do nothing until this is
completed. Back up all system databases at this point. These backups form the
databases of record, marking the final versions of your old environment. If you
can, copy these backups to a different server and make sure that they can be
easily accessed even in a complete server-down situation. Make sure that the
media is intact so that you can restore the backups if necessary.
After you make any changes to the SQL Server 2012 databases and
configuration, but before allowing acceptance testing on the new SQL Server
2012 instance, take full database backups again. If the testers consider the
upgrade a success, these backups will be the initial backups for your new
environment. If testing finds errors but they are not serious enough to cause a
rollback, you can restore from these initial backups to revert the database to its
original state, ready for a second round of acceptance testing. Then apply
required changes and repeat the backup process. When testing is complete, still
back up all databases before rolling out to production. These backups then
capture the final state of the database before they are put into production.
Important: Make sure that either the Windows Server installation media with
the appropriate keys or good backups of the Windows Server installation image
are available for a potential reinstall. You can rebuild SQL Server only if Windows
is stable and in a state to have applications installed on it.
It might seem that these backups are too many and will consume lots of disk space, but
you can delete most of them after the upgrade to SQL Server 2012 is completed. It is a
good practice to perform all of them, just in case an unexpected issue requires a
restore at any point in time.
SQL Server 2012 Upgrade Technical Guide
58
If you are upgrading to Windows Server 2008 R2 SP1 and the server is currently
running SQL Server 2005, make sure that you apply SQL Server 2005 SP4 or later
SQL Server 2012 Upgrade Technical Guide
59
versions before the Windows operating system upgrade; otherwise, you might
encounter problems.
If you will reuse the existing server and upgrade Windows Server, depending on
which version of Windows that you start with and which is the final destination,
you could perform an in-place upgrade. This approach might also require
installing a fresh version of Windows Server. If you perform a fresh install of
Windows Server, make sure that all SQL Server databases are backed up, that all
settings are known, and that all users are scripted out.
Windows Server 2008 and 2008 R2 both have an installation option called Core.
Core is basically a locked-down, minimal version of Windows Server that does
not have an interface other than a command line. SQL Server 2012 supports only
Windows Server 2008 R2 Core.
60
40fa-a026-5bfcf076d9b9/SQL2008inHyperV2008.docx) and
Planning, Implementing, and Supporting SQL Server Virtualization
with Windows Server 2008 R2 Hyper-V and Live Migration
(http://download.microsoft.com/download/4/4/D/44DB08F7-144B4DF6-860F06D30C6CE6E4/SQL%20Server%202008%20R2%20Virtualization%
20Whitepaper.docx)
You cannot use an old Windows NT-style domain for a Windows Server 2008 or
later server. You must be using Active Directory. If your organization is using
older-style domains, you cannot deploy Windows Server 2008/2008 R2 until
your Active Directory infrastructure is upgraded.
By default, Windows Server 2008 and 2008 R2 are more secure than Windows
Server 2000 and Windows Server 2003. Many of its features are not configured,
so there will be additional work involved in the upgrade.
Windows Server 2008 and 2008 R2 support only SAS, fiber channel, and iSCSI. If
you are using older parallel SCSI, you have to upgrade your disk solutions to
support Windows Server 2008.
For more Windows-specific information about how to deploy and upgrade to Windows
Server 2008 and 2008 R2, see Upgrading to Windows Server 2008
(http://technet.microsoft.com/en-us/library/cc754728(WS.10).aspx) and Windows
Server 2008 R2 Upgrade Paths (http://technet.microsoft.com/enus/library/dd979563(WS.10).aspx). For information about how to upgrade to Windows
Server 2008 or 2008 R2 failover clustering with SQL Server 2008 R2, see the "Upgrading
Failover Clusters" section in Chapter 4, "High Availability."
61
62
application is offline waiting for the upgrade to be complete. For high availability
applications, you might have to take additional measures to absolutely minimize the
downtime. For high availability and VLDB upgrades, see the detailed information in
Chapter 4, "High Availability," which goes beyond the basic information in this section.
The following steps can help minimize the downtime involved in an in-place upgrade
or side-by-side upgrade:
Check the legacy SQL Server versions. Make sure that the legacy instances of
SQL Server 2005/2008/2008 R2 are at the correct service-pack level for an inplace upgrade. If they are not at the correct level, plan to update them before an
in-place upgrade (see "Setup Requirements for an In-Place Upgrade" earlier in
this chapter).
Make sure that installation requirements are met. SQL Server 2012 Setup
also has Windows and other component requirements (see "Setup Requirements
for an In-Place Upgrade" earlier in this chapter).
Preinstall .NET and Windows components. If you can, install .NET Framework
3.5 SP1 or a later version and Windows Installer (MSI) 4.5 beforehand on the
target server. Both require a restart. For an in-place upgrade, if a restart in
production cannot be enabled except for the upgrade, install them during the
upgrade and not earlier. For a side-by-side upgrade to a separate server,
installing these components before the upgrade will help reduce downtime.
When you run the SQL Server 2012 Upgrade Advisor on a legacy server, a restart
will be required if MSI 4.5 must be installed.
Preinstall Visual Studio 2008 SP1 or a later version. If Visual Studio 2008 is
installed on the server, make sure that it is at the SP1 level (see "SQL Server
Prerequisites Installed by Setup" earlier in this chapter).
Preinstall SQL Server 2012 common components. Install the SQL Server 2012
common components (such as the SQL Server 2012 SQL Native Client) before
the upgrade. Also consider pre-installing the Management Tools if SQL Server
2012 Management Studio (SSMS) is not required to manage SQL Server 2000
instances. (For more information, see Chapter 2, "Management and
Development Tools.")
63
Use new service accounts. Create and use new service accounts and groups, if
it is necessary, with your SQL Server 2012 implementations. This guarantees
account separation from the legacy instances of SQL Server 2005/2008/2008 R2.
An in-place upgrade will not automatically change the legacy instances service
accounts. Create new domain-based service accounts that have the correct user
rights on each server, and after the upgrade, use SQL Server Configuration
Manager to update the SQL Server 2012 services to use these new accounts.
Check data consistency. When you upgrade relational databases, run a Full
DBCC CHECKDB on databases before upgrading while the database is online so
that you do not affect downtime. (See Chapter 3, "Relational Databases," for
more information.)
Back up data before and after the upgrade. Check that your backup media
has no errors and is available for restores if necessary (see "Plan for Backups"
earlier in this chapter).
Schedule a longer maintenance downtime window than you think you must
have. If everything finishes without issue, you will be able to bring users back
online faster than they expected. But if unexpected issues arise, you will have
more time to deal with them without inconveniencing users.
Do a complete backup of all the files and installed software on the server in case
you have to restore the server to its previous state. Confirm that your backup
media is complete and available.
SQL Server 2012 Upgrade Technical Guide
64
Do a complete backup of all the user databases on the server in case you have
to selectively restore user databases. Confirm that your backup media is
complete and available.
After the upgrade, check before you leave to make sure that everything looks to be
working. Make sure that applications return to running correctly and that transaction
workloads are processed correctly.
It is best not to treat an upgrade informally, as a one-off procedure. Instead, treat it as
a major database upgrade. This approach implies the following steps:
Scripting and automating the deployment process and tests as much as you can
The actual steps that you use should comply with the rules and procedures already
existing in your organization, but most likely, they will include all the above. The
important point is that an upgrade to SQL Server 2012 is not a minor change to your
production database system; instead, it should fit into existing procedures for major
database changes.
Updating Skills
Before you try to upgrade to SQL Server 2012, make sure that those administering or
deploying SQL Server 2012 are ready. Just as you would with any other application,
never assume that your staff can deploy and then manage the upgraded system
without being correctly prepared.
Before deployment, set up a SQL Server 2012 environment so that everyone who has to
update his or her skill set can become familiar with the new version. If the DBAs are
comfortable with SQL Server 2012 by the time of production deployment, the transition
from SQL Server 2005/2008/2008 R2 will go much more smoothly.
There are many resources that are available to update skills. To start, see the SQL Server
2012 Learning Center (http://msdn.microsoft.com/en-us/sqlserver/ff898410). Also you
can get initial experience with SQL Server 2012 using the training material on the SQL
SQL Server 2012 Upgrade Technical Guide
65
66
Design final acceptance criteria. The upgrade might succeed at the instance of
SQL Server 2012 level, but some other unaccounted-for variable in the server
infrastructure might still prevent applications from running correctly. Whatever
the case, determine how the organization will accept the upgrade and how it will
make the "go/no-go" decision. This goes beyond validating the upgrade result:
It focuses on whether the applications that use the targeted database servers
run as expected and required. It might be appropriate to enlist the support of
the QA team to develop appropriate acceptance tests.
67
Change of version. First, you must deal with the consequences of changing SQL
Server versions. Upgrade Advisor details these issues and is the best source for
this kind of information. These changes cannot be avoided. For more
information, see the previous coverage of Upgrade Advisor and backwardcompatibility issues.
Change of edition. You have to consider the effects of upgrading and at the
same time changing the SQL Server edition you are running. This combination of
changes can have significant consequences. If you are using an in-place
upgrade, the result will be at the same edition level or higher. Even this might
present issues. For example, if you are upgrading from SQL Server 2000 MSDE to
SQL Server 2012 Express, you can no longer rely on SQL Server Agent jobs. In
this case, you might be better served by upgrading to SQL Server Standard
instead of SQL Server Express. If you choose a side-by-side upgrade, you can
change edition level in any direction. Generally, reduce the number of changes
to the system by staying at the same edition level unless your organization
needs a different editions features.
68
In a complex upgrade scenario, you can reduce the risk of problems by keeping all
server-level configurations the same between instances and avoiding new introductions
to the system until after the upgrade is considered successful.
At the database level, possible changes during a direct in-place upgrade or side-byside upgrade include the following:
Change of database compatibility level. Keep the new databases at the same
compatibility level, and move them to the new compatibility level after you have
validated the upgrades success.
If you decide to make these kinds of changes at the database level, we recommend
that you design and execute a test of the upgrade and database changes in a test or
SQL Server 2012 Upgrade Technical Guide
69
staging environment before you try it in production. When you introduce other
variables into the upgrade process, it might be difficult to separate the success of the
upgrade from any problems associated with the other changes.
You might also be tempted to change the database server infrastructure while you are
upgrading. These changes might include the following:
Change of physical server. For an in-place upgrade, you must use the same
server. However, in a side-by-side upgrade, you can put the new instance on the
same server or a different server. If on a different server, such a change implies a
change of IP address and server name in the network, unless you perform a
rename and readdress of the servers in some manner. Users and applications
must now adapt to the new server name and IP address, which might be a
complexity that you cannot avoid.
Swapping servers. For a side-by-side upgrade, you might decide to keep the
same server and instance name by pulling the legacy server out of the domain,
adding in the new server, giving it the same IP address as the legacy server, and
renaming the new server to the legacy server name. However, with an in-place
upgrade, in which the new instance of SQL Server 2012 becomes a named
instance, be aware that you cannot rename an instance name or change a
named instance to a default instance.
Change of CPU type: 32-bit to 64-bit. You might also view a side-by-side
upgrade as an opportunity to put the new instance on a 64-bit server instead of
your current 32-bit server. In this case, be prepared to install the correct editions
and be aware of any restrictions, as described earlier in this chapter.
70
Just remember that the fewer changes introduced to the infrastructure during the
upgrade process, the less complex an upgrade will be. The more changes that you
introduce concurrently, the more testing you will want to do in your test or staging
environment. If you absolutely must combine multiple changes within the upgrade
process, plan for additional testing in your test or staging environment to reduce the
risk of encountering unexpected issues during the production upgrade.
Classify instances of SQL Server into classes, based on how important the data is.
Consider a possible scenario in which a given SQL Server instance could be
classified into one of three levels. Perhaps only the top-level systems use high
availability technologies, the mid-level systems might use log shipping for
creating warm standby servers, and the lowest-level databases might require
only nightly backups. In this scenario, the checklist for upgrading the top-level
instances of SQL Server would be much more extensive and require full testing
and a complex rollback plan. In contrast, the checklist for upgrading the lowestlevel instances of SQL Server would be much simpler.
71
checklist for removing the legacy instance SQL Server as a subscriber, putting
the new instance in its place, and testing the result to ensure that replication is
still running.
The other chapters in this guide and SQL Server 2012 Books Online contain many
topics that contain valuable information that can help in developing upgrade checklists:
Database Engine: See Upgrade Database Engine (http://msdn.microsoft.com/enus/library/bb933942(v=sql.110).aspx) and Chapter 3, "Relational Databases."
Replication: See Upgrade Replicated Databases (http://msdn.microsoft.com/enus/library/ms143699(v=sql.110).aspx) and the section on replication in Chapter
4, "High Availability."
Analysis Services: See Upgrade Analysis Services (http://msdn.microsoft.com/enus/library/ms143686(v=sql.110).aspx) and Chapter 16, "Analysis Services."
Integration Services and DTS: See Chapter 17, "Integration Services." For
instructions on upgrading DTS to SQL Server 2008 Integration Services, see
Considerations for Upgrading Data Transformation Services
(http://msdn.microsoft.com/en-us/library/ms143716.aspx).
72
frequently already have acceptance criteria, smoke tests, and so on that they apply
during application upgrades. Check with the QA team for help and support for a SQL
Server upgrade also.
Here are some general considerations for testing either an in-place upgrade or side-byside upgrade:
Begin by building a test or staging environment. Consider putting the test server
or servers in a test environment that has its own domain so that you can use the
same server and SQL Server instance names. Make sure that the test servers
match production in disk volume assignments and free disk space. This is
especially important in an in-place upgrade or a side-by-side upgrade on the
same server. In a side-by-side upgrade to a different server, you might use the
additional server for testing as well.
Test the upgrade multiple times. To make repeated testing easier, you could
reset the test environment back to its original state quickly. Make a disk image
of the database server, in addition to copies of all data files. Then, restore the
ghost image and data file copies to the original servers. Or, you could use a
Virtual PC (VPC) image or images to build the test environment if the VPC image
really can support all the components and behavior of the production server.
Reverting the VPC image to its original state when closing it down makes a
second test run much easier.
Install the .NET Framework 3.5 SP1 and SQL Server 2012 drivers on the
production server by using SQL Server 2012 Setup before the upgrade process,
if that is possible and matches the upgrade plan for production. This saves time
during the actual upgrade.
Execute Upgrade Advisor remotely against the test server that runs the legacy
instance of SQL Server 2005/2008/2008 R2 and validate that its output matches
what is received when it is executed against the production system. Then, apply
scripts to fix blocking issues that Upgrade Advisor reveals. In some cases, fixing
blocking issues might break the legacy application. If that is the case, apply
additional scripts or code as workarounds to update the database code or the
application so that it continues to operate. Again, it is important to verify that
the application operates correctly. For more information, see "SQL Server 2012
Upgrade Advisor" earlier in this chapter.
When the upgrade is complete, apply any later scripts that might be required to
resolve post-upgrade issues uncovered by Upgrade Advisor.
SQL Server 2012 Upgrade Technical Guide
73
As soon as the test server reaches its final state of the upgrade process, test all
relevant applications that are running against the upgraded instance of SQL
Server 2012.
Test the process of rolling back the in-place upgrade to the original SQL Server
version so that you are confident of the rollback process in case you have to
revert the upgrade during the maintenance window.
To test an in-place upgrade, put a copy of the production instance of SQL Server
2005/2008/2008 R2 on a test server so that your test includes "real" data and
objects. To the best of your ability, make the initial state of the test server
duplicate all necessary components of the production server.
After the test environment is built, verify that it behaves correctly with the same,
or copies of, application components that connect to the production system.
To repeat the side-by-side upgrade tests, you might not have to restore the test
server from a ghost image. You could uninstall SQL Server 2012 and remove the
data files to set the server back to its original state and repeat the upgrade tests.
Make sure that you test uninstalling SQL Server 2012 and verify that the legacy
version of SQL Server 2005/2008/2008 R2 is working correctly.
SQL Server 2012 Upgrade Technical Guide
74
In a side-by-side upgrade, the rollback will most likely be to the original instance
of SQL Server 2005/2008/2008 R2. Make sure that you test the rollback scenario.
You could run the legacy SQL Server instance in parallel with the new instance of
SQL Server 2012. If that is part of the upgrade plan, make sure in the test
environment that running in parallel will not require too much of the server's
resources.
When the cutover to the new instance of SQL Server 2012 occurs and the
instance is verified as ready for production, stop the legacy instance of SQL
Server, leaving it dormant for a while as a potential rollback instance.
After the upgrade has passed acceptance tests, uninstall the legacy instance
without disturbing the new production instance.
Decide whether the production system will be online during the installation of
SQL Server 2012. If this is the case, test the effect that SQL Server 2012 R2 Setup
has on application performance.
If the upgrade plan includes removing the old server from the domain and
renaming the new server with the legacy name and legacy IP address, test this
step as well.
Now, perform final tests on the new SQL Server 2012 server. To rerun the tests and gain
confidence in the plan and deployment, repeat the process by restoring the baseline
target server.
Back up production data. In the upgrade checklist, include steps for backing up
all the databases and other data that would be required to rebuild the system.
75
involve a team of people, including the testers who determine whether the
application operates as expected.
Have a rollback plan in place. Specify in sufficient detail how to restore the
system if it is necessary. The more detailed the plan, the better, because
rollbacks usually occur in high-stress situations. Clearly defined steps are easier
to follow in those contexts.
Test the rollback. Test the rollback plan to make sure that it will actually work.
The degree of testing might be a function of how important the data is and how
time-critical a rollback would be. There can be no confidence in an untested
rollback plan.
Post-Upgrade Tasks
As soon as you have completed the upgrade tasks, two more steps are required:
Integrate the new SQL Server instance into the application and database server
environment.
These two steps are not necessarily sequential. For example, you might apply some
acceptance criteria immediately to obtain a go/no-go decision. This could then be
followed by integrating the new instance and applying the remaining set of acceptance
tests.
Linked servers. The current system might depend on linked server relationships
and definitions that must be applied for an upgrade. Failures in the application
might result if those linked servers are not defined and tested correctly.
Imports and exports. The legacy database system might receive data imports
and be the source of data exports. These imports and exports might use DTS, be
SQL Server 2012 Upgrade Technical Guide
76
converted to SSIS, or use other tools. You have to isolate these requirements
and make sure of the resulting upgraded instances correct participation.
Patches, hotfixes, and cumulative updates. After you upgrade to SQL Server
2012 from another edition of SQL Server, you must reapply any hotfix or service
pack updates to the upgraded SQL Server instance.
Troubleshooting an Upgrade
The best time to discover problems with an upgrade is when validating the upgrade
plan in a test environment. Most upgrade issues related to the static code and objects
in the instance, as well as the techniques recommended to resolve them, are fully
documented in Upgrade Advisor. Dynamic code requires a workload to verify and
troubleshoot.
General troubleshooting techniques include the following:
SQL Server 2012 Upgrade Technical Guide
77
Detailed log files are located in the Files folder under the path just mentioned,
providing one file for each component and for many subcomponents. For
information about interpreting the log files, see How to: Read a SQL Server
Setup Log File (http://msdn.microsoft.com/en-us/library/ms144287.aspx).
You use the same log files for troubleshooting a side-by-side upgrade as an inplace upgrade, except that the actual data transfer will not be logged because it
is a manual process that is not under the control of SQL Server 2012 Setup.
The steps for troubleshooting a side-by-side upgrade are basically based on the
technique that you use for transferring data. If you use the backup/restore or
detach/attach side-by-side upgrade method, capturing the output of those
processes to text files is possible as long as you use the SQLCMD command-line
tool and redirect the output to a file. If you use the Copy Database Wizard to
transfer data, the process is interactive, and you have to watch it live for
potential errors.
78
When uninstalling a legacy SQL Server instance, be very careful to select the correct
components. Upgrading to a separate server is generally the better option, because it is
easier to decommission a whole server than it is to uninstall on an actively used one.
Do you have a clear sense of what criteria would qualify the upgrade as
successful?
Do you have a tester or team of testers who can verify that the applications that
depend on SQL Server work correctly after the upgrade?
Can you test the upgrade in a test environment first so that you can be
confident that the upgrade will succeed?
Above all, have you run Upgrade Advisor and detected and resolved any
blocking issues it found?
If you are confident that your organization can back up and restore data, successfully
test the results, and rebuild the SQL Server database if it is necessary, next consider
what upgrade strategy would best meet your needs.
By far the easiest upgrade strategy without a DBA available is the in-place upgrade, in
which the new instance of SQL Server 2012 replaces your legacy SQL Server instance.
With this strategy, SQL Server automatically transfers your data from the old to the new
instance. In most cases, upgrading an instance without a DBA is best performed by
using in-place upgrade. However, you will want to consider all the relevant factors
before you make a final decision.
SQL Server 2012 Upgrade Technical Guide
79
The flowchart in Figure 4 describes the different stages in upgrading your instance of
SQL Server 2005/2008/2008 R2 to SQL Server 2012. The chart also describes basic tools
available to help you upgrade to SQL Server 2012.
80
Conclusion
The key steps in planning for a successful SQL Server 2012 upgrade are as follows:
As with any significant database application upgrade, an upgrade to SQL Server 2012
will benefit from limiting the number of variables during the upgrade process and
applying standard IT production release procedures to the upgrade process.
Additional References
For an up-to-date collection of additional SQL Server 2012 upgrade planning and
deployment references, see the following links:
For more information about how to upgrade each SQL Server component (e.g., Analysis
Services and Integration Servicessee the remaining chapters in this document.
SQL Server 2012 Upgrade Technical Guide
81
When upgrading from SQL Server 2005/2008/2008 R2 to SQL Server 2012, the impact
of the upgrade on these management and development tools will be minimal. Note
that there are many other tools in SQL Server 2012, but describing them here in detail
is beyond the scope of this chapter:
For information about changes in the business intelligence tools, see Chapter 15,
Business Intelligence Tools, in this Guide.
For information about the changes in the Reporting Services tools, see Chapter
18, Reporting Services, in this guide and Upgrade and Migrate Reporting
Services (http://msdn.microsoft.com/en-us/library/ms143747(v=sql.110).aspx) in
SQL Server 2012 Books Online.
Changes in SSMS
SSMS is an integrated environment for managing all SQL Server components, including
the SQL Server Database Engine, SQL Server Analysis Services, SQL Server Integration
Services, SQL Server Reporting Services, as well as Transact-SQL (T-SQL) database
queries and components. SSMS uses the Visual Studio IDE to give administrators a
single, easy-to-use graphical tool for managing the most sophisticated systems and to
SQL Server 2012 Upgrade Technical Guide
82
give developers a consistent experience for database and application development. The
Visual Studio 2010 Shell is being used for SSMS within SQL Server 2012.
Object Explorer
There are no changes in SSMSs Object Explorer if you are upgrading from SQL Server
2008/2008 R2. If you are upgrading from SQL Server 2005, you will find the following
enhancements in Object Explorer:
Customizable columns. In the browser, you can display the information that is
relevant to your needs rather than having to accept what is provided by default.
Object sorting. By simply clicking an object column heading, you can sort
objects into the desired order based on the context of the click.
For more information about Object Explorer enhancements if you are upgrading from
SQL Server 2005, see Manageability Enhancements (Database Engine)
(http://msdn.microsoft.com/en-us/library/cc645579(v=sql.100).aspx) in SQL Server 2008
Books Online.
Query Editor
In the Query Editor, you will find the following enhancements:
Breakpoint validation. Validation ensures the user does not set a breakpoint in
an invalid location.
SQL Server 2012 Upgrade Technical Guide
83
T-SQL code snippets. The snippets are templates that can be used as starting
points when writing T-SQL statements in the Query Editor.
Page Restore dialog box. This dialog box allows the user to check database
pages for corruption and restore one or more damaged pages from a database
backup and subsequent log backups without restoring the whole database.
For details about these Query Editor enhancements, see Manageability Enhancements
(Database Engine) (http://msdn.microsoft.com/en-us/library/cc645579(v=sql.110).aspx)
in SQL Server 2012 Books Online.
Keyboard Shortcuts
DBAs managing SQL Server environments often use keyboard shortcuts to increase
their productivity. The default scheme is the SQL Server 2012 scheme, with keyboard
shortcuts based on Visual Studio 2010.
To change the keyboard scheme in SSMS, follow these steps:
1. From the Tools menu in SSMS, click Options.
2. Expand the Environment node, and highlight the Keyboard page.
3. Change the keyboard scheme by using the Keyboard Scheme drop-down box.
If you change the keyboard scheme in SSMS, the Log Viewer keyboard shortcuts in SQL
Server 2008 R2 are not available in SQL Server 2012. The following Help and SQL Server
Books Online keyboard shortcuts are also not available:
For a list of keyboard shortcut changes, see SQL Server Management Studio Keyboard
Shortcuts (http://msdn.microsoft.com/en-us/library/ms174205(v=sql.110).aspx) in SQL
Server 2012 Books Online.
SQL Server 2012 Upgrade Technical Guide
84
Customer-Requested Enhancements
The following enhancements were made in SSMS 2012 as a result of customer requests:
For the latest information about SSMS features that you will find after an upgrade, see
Manageability Enhancements (Database Engine) (http://msdn.microsoft.com/enus/library/cc645579(v=sql.110).aspx) in SQL Server 2012 Books Online.
85
For information about the enhancements in Profiler, see SQL Server Profiler
(http://msdn.microsoft.com/en-us/library/ms181091(v=SQL.110).aspx) in SQL Server
2012 Books Online. For information about the depreciated features in SQL Profiler, see
the "Depreciated Features" section later in this chapter.
Preparing to Upgrade
To make sure your upgrade process goes smoothly, consider the following changes in
the way certain management tools work in SQL Server 2012 so that you can make
appropriate modifications after your upgrade and maintain effective administration of
your SQL Server environment.
Deprecated Features
Some management tools features and some SQL Server features are deprecated in
SQL Server 2012, which means that they are supported for backward compatibility only
and will be removed from a future release of SQL Server.
Trace Capture and Trace Replay
The Trace Capture and Trace Replay features for Database Engine workloads are being
depreciated in SQL Server 2012. The Extended Events graphical user interface in SSMS
is recommended as a replacement for Trace Capture. Distributed Replay is the
recommended replacement for Trace Replay. These features are not being depreciated
for Analysis Services workloads.
For a complete discussion of deprecated features, see the following topics in SQL
Server 2012 Books Online:
Discontinued Functionality
Some management tools features have been discontinued in SQL Server 2012. The
following highlights some of the discontinued features. For a complete list, see
Discontinued Management Tools Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/cc879339(v=sql.110).aspx) in SQL Server 2012
Books Online.
SQL Server 2012 Upgrade Technical Guide
86
Breaking Changes
Breaking changes are those that might block an upgrade. The SQL Server 2012
Upgrade Advisor, which will be discussed in the Upgrade Tools section, helps detect
major breaking changes by looking through the environment to be upgraded and
checking to make sure that the relevant elements are present. For information about
these types of changes, see Breaking Changes to SQL Server Features in SQL Server
2012 (http://msdn.microsoft.com/en-us/library/cc707784(v=sql.110).aspx) in SQL Server
2012 Books Online.
Behavior Changes
Behavior changes are non-breaking changes that might not cause your upgrade to fail
but might affect your applications after the upgrade. Two behavior changes have been
found for SQL Server 2012:
1. The failure detection process in SQL Server failover clusters no longer uses the
"SELECT @@SERVERNAME" query. The failure detection process does, however,
improve logging, monitor major SQL Server components, and provide
capabilities to set conditions for SQL Server failover or restart.
87
2. Upgrading from SQL Server Developer Edition or SQL Server Evaluation Edition
to SQL Server Standard Edition is not supported for multi-subnet failover cluster
installations. For more information, see SQL Server Multi-Subnet Clustering
(http://msdn.microsoft.com/en-us/library/ff878716(v=sql.110).aspx) in SQL
Server 2012 Books Online.
For full details regarding upgrading SQL Server 2005/2008/2008 R2 clustered instances
to SQL Server 2012, see Chapter 4, "High Availability," in this guide. For more
information about behavior changes, see Behavior Changes to SQL Server Features in
SQL Server 2012 (http://msdn.microsoft.com/en-us/library/cc707785(v=sql.110).aspx) in
SQL Server 2012 Books Online.
Upgrade Tools
Microsoft has released a Feature Pack for SQL Server 2012 that includes, among other
useful extras, SQL Server 2012 Upgrade Advisor. You can either download the Microsoft
SQL Server 2012 Feature Pack
(http://www.microsoft.com/download/en/details.aspx?id=29065) or install it from the
SQL Server 2012 installation DVD.
Upgrade Advisor checks more than 100 rules for possible upgrade issues, separated
into the following categories:
SQL Server
Analysis Services
Reporting Services
Integration Services
After the checks are completed, a reporting interface lists the issues found and advises
you on how to resolve them. For more information about Upgrade Advisor, see Chapter
1, "Upgrade Planning and Deployment," in this guide and Use Upgrade Advisor to
Prepare for Upgrades (http://msdn.microsoft.com/enus/library/ms144256(v=sql.110).aspx) in SQL Server 2012 Books Online.
64-Bit Considerations
The client tools are developed for the 32-bit machine environment. When running on a
64-bit machine, the software functions within Windows On Windows 64 (WOW64), an
emulation environment that hosts 32-bit software within the 64-bit machine. Therefore,
there should be no tool issues regarding upgrading to the 64-bit environment. For
SQL Server 2012 Upgrade Technical Guide
88
more information, see Hardware and Software Requirements for Installing SQL Server
2012 (http://technet.microsoft.com/en-us/library/ms143506(v=sql.110).aspx) in SQL
Server 2012 Books Online.
89
USE msdb
GO
EXEC dbo.sp_grant_proxy_to_subsystem
@proxy_name = 'UpgradedProxyAccount',
@subsystem_name = N'SSIS'
GO
For more information about the SQL Server Agent proxy account, see How to: Create a
Proxy (SQL Server Management Studio) (http://msdn.microsoft.com/enus/library/ms190698(v=sql.105).aspx)
Upgrading Target Servers
DBAs upgrading multi-server environments need to upgrade all target servers (TSX)
before upgrading master servers (MSX). You can use SSMS to re-enlist target servers by
following these steps:
1. In Object Explorer, connect to an instance of the Database Engine and expand
that instance.
2. Right-click SQL Server Agent, point to Multi Server Administration, and then click
Make this a Target. The Target Server Wizard guides you through the process of
making a target server.
Keep in mind that two features introduced in SQL Server 2008 R2 make working in a
distributed environment more cost-effective than using master and target servers.
Those features are:
For information about these features, see the following SQL Server 2012 Books Online
topics:
90
whether you choose an in-place upgrade or a side-by-side upgrade of the SQL Server
database engine. SQL Server Configuration Manager and SQL Server Profiler will be
replaced when you use an in-place upgrade.
The SQL Server 2005 tools on the upgraded instance must be removed
separately by using Add/Remove Programs. This applies whether there are one
or many instances of SQL Server 2005 on the server.
SQL Server 2012 Setup will detect the registered servers and other settings of
the SQL Server 2005 tools and attempt to preserve them when upgrading to
SQL Server 2012.
Exporting and importing SSMS registered servers between SQL Server 2005 and
SQL Server 2012 is not supported because the underlying .regsrvr files do not
have the same structure.
Tools Connectivity
SQL Server 2005 tools cannot be used to manage SQL Server 2012 instances. After an
in-place upgrade, you can use only SQL Server 2012 tools and utilities to manage SQL
Server 2012 instances. However, the SQL Server 2012 tools can manage SQL Server
2005 instances. To manage SQL Server remotely, install the SQL Server 2012 tools on a
workstation to ensure that you can manage SQL Server 2012 after it is installed.
SQL Server 2005 Profiler allows you to run a trace on the SQL Server 2012 instance.
However, when running a new trace, there is no template so you have to manually
select your events before running the trace. SQL Server 2012 Profiler can also be used
to open SQL Server 2005 trace files.
91
The SQL Server 2008/2008 R2 tools on the upgraded instance must be removed
separately by using Add/Remove Programs. This applies whether there are one
or many instances of SQL Server 2008/2008 R2 on the server.
SQL Server 2012 Setup will detect the registered servers and other settings of
the SQL Server 2008/2008 R2 tools and attempt to preserve them when
upgrading to SQL Server 2012.
Tools Connectivity
After an in-place upgrade, you can use SQL Server 2008/2008 R2 SSMS to connect and
manage SQL Server 2012 instances. However, you cannot use SQL Server 2008/2008 R2
Configuration Manager to manage any of the SQL Server 2012 services.
SQL Server 2008/2008 R2 Profiler allows you to run a trace on the SQL Server 2012
instance. However, when running a new trace, there is no template so you have to
manually select your events before running the trace. SQL Server 2012 Profiler can also
be used to open SQL Server 2008/2008 R2 trace files.
Project Files
SSMS 2012 can open and work with project files created in previous versions of SSMS
When the project is opened with SSMS 2012, it must be upgraded with a Visual Studio
conversion process. This upgrade process is a function of the Visual Studio Shell upon
which the SSMS 2012 is built. After the project is upgraded, it cannot be opened by any
of the previous versions of SSMS. For more information, see Projects (SQL Server
Management Studio) (http://msdn.microsoft.com/enus/library/hh231442(v=sql.110).aspx) in SQL Server 2012 Books Online.
Post-Upgrade Tasks
After the upgrade, you might need to perform some tasks to have your new
management tools behave the same as before the upgrade.
SQL Server 2012 Upgrade Technical Guide
92
Database Diagrams
During an in-place upgrade to SQL Server 2012, database diagrams created in earlier
releases of SQL Server will automatically be upgraded. The following steps describe
how to set up database diagramming on SQL Server 2012 to complete the upgrade.
DBAs wanting to set up database diagramming on a SQL Server 2012 database must be
a member of the sysadmin fixed server role or the db_owner role for each database
they want to configure:
1. From Object Explorer in SSMS, expand the database you want to configure.
2. Expand the Database Diagram node under the database connection.
3. Select Yes when prompted to create the support objects.
4. When you open the database diagrams, SQL Server 2012 automatically
upgrades them.
For details about upgrading database diagrams, see Upgrade Database Diagrams from
Previous Editions (Visual Database Tools) (http://msdn.microsoft.com/enus/library/ms190628(v=sql.110).aspx) in SQL Server 2012 Books Online.
After an in-place upgrade, SQL Server 2012 will preserve your settings in SSMS.
However, in a side-by-side upgrade, you will need to customize the tools to have the
same functionality as before. This includes:
93
Enabling or disabling services and features. For safety, only selected services and
features are enabled by default after an upgrade.
Conclusion
SQL Server 2012 provides many valuable new features and enhanced functionality in
the management tools area. You can minimize the risks involved with an upgrade to
SQL Server 2012 and gain confidence by following these practices, understanding the
changes made to the management tools, and preparing for an effective upgrade.
Additional References
For an up-to-date collection of additional references for upgrading SQL Server 2012s
management tools, see the following links:
94
95
For full-text upgrade information from SQL Server 2008/2008 R2, see Chapter 6,
"Full-Text Search." For information about upgrading from SQL Server 2005, see
Upgrade Full-Text Search from SQL Server 2005 (http://msdn.microsoft.com/enus/library/ms142490(v=sql.110).aspx) in SQL Server 2012 Books Online.
For SQL Server Express upgrades, see Chapter 8, "SQL Server Express."
Upgrade Considerations
Before upgrading from SQL Server 2005/2008/2008 R2 to SQL Server 2012, you need to
address the following considerations.
Make sure that you have a valid backup of all the databases participating in the
upgrade process. For backup details, see Chapter 1, "Upgrade Planning and
Deployment."
Only instances of SQL Server 2005 Service Pack 4 (SP4) or later versions,
instances of SQL Server 2008 SP2, and SQL Server 2008 R2 SP1 can be upgraded
to SQL Server 2012. For comprehensive information about which versions and
editions can be upgraded, see Supported Version and Edition Upgrades
(http://msdn.microsoft.com/en-us/library/ms143393(v=sql.110).aspx).
On a server that contains multiple legacy instances of the SQL Server Database
Engine, you must upgrade each instance individually. Upgrading one instance
has no effect on other instances on the same server. From the SQL Server 2012
SQL Server 2012 Upgrade Technical Guide
96
point of view, you can upgrade multiple instances in any order and at any time.
You cannot perform a direct, in-place upgrade from a 32-bit edition of SQL
Server 2005/2008/2008 R2 to any 64-bit edition of SQL Server 2012. However,
databases from a legacy 32-bit edition can be restored on or attached to a 64bit edition of SQL Server 2012, and they will be automatically upgraded. For
more information about this process, see Chapter 1, "Upgrade Planning and
Deployment."
Note: Be aware of significant tool upgrade issues in upgrading to SQL Server 2012.
For comprehensive information about how to upgrade SQL Server tools, see
Chapter 2, "Management and Development Tools."
SQL Server 2012 has multiple hardware and software requirements that you must
consider when you perform an in-place upgrade because you might have to update
your operating system service pack or install or upgrade other operating system
components. For a complete list of requirements, see Hardware and Software
Requirements for Installing SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms143506(v=sql.110).aspx).
Full-Text Search
SQL Server 2008 added numerous improvements to full-text search, including the
following:
Stop lists
Thesaurus improvements
For Information on how to upgrade full-text search to SQL Server 2012, see Chapter 6,
"Full-Text Search."
97
You can also upgrade SQL Server 2012 RC0 to SQL Server 2012. For more information
about versions that you can upgrade, see the "Upgrade Considerations" section later in
this chapter.
Components
You can upgrade the Database Engine component, including SQL Server Agent, to SQL
Server 2012. You can also upgrade the management tools, full-text search, Analysis
Services, and Reporting Services components. For more information about each of
these topics, see the following chapters in this guide:
Editions
There are multiple in-place upgrade paths available to you, depending on the edition
of SQL Server that you are upgrading from. Generally, you can upgrade to an edition
equal to or later than your current edition. For example, you can upgrade from SQL
Server 2005 Standard to SQL Server 2012 Standard, Enterprise, or Business Intelligence
Edition.
When you upgrade editions in-place, you must maintain the same processor
architecture type. There is no support for upgrading from a 32-bit edition to a 64-bit
edition or from X64 to IA-64 or vice versa. If you have to upgrade to a different
processor architecture, you must perform a side-by-side upgrade. For a complete
SQL Server 2012 Upgrade Technical Guide
98
For more information about cross-language support, see Supported Version and
Edition Upgrades (http://msdn.microsoft.com/en-us/library/ms143393(v=sql.110).aspx).
99
Components
Some components have either been deprecated or removed in SQL Server 2012. For
example, Notification Services was removed from SQL Server 2008 R2 and therefore is
not available in SQL Server 2012. In addition, Data Transformation Services (DTS) was
replaced by SQL Server Integration Services (SSIS). For more information about DTS
and SSIS, see Chapter 17, "Integration Services."
Evaluation Editions
Although Microsoft has made a great effort to support as many in-place upgrade paths
as possible, you cannot upgrade SQL Server 2005/2008/2008 R2 Evaluation Editions to
SQL Server 2012. For more information, see Supported Version and Edition Upgrades
(http://msdn.microsoft.com/en-us/library/ms143393(v=sql.110).aspx).
Platforms
When you perform an in-place upgrade, you must upgrade to the same processor
architecture. For example, you cannot upgrade from a 32-bit edition of SQL Server
2005 to a 64-bit edition by using the in-place upgrade method. However, you can
upgrade to a different processor architecture by using the side-by-side upgrade
method.
Cross-Language Support
Upgrading across localized versions of SQL Server is not supported. For more
information, see Supported Version and Edition Upgrades in SQL Server 2012 Books
Online (http://msdn.microsoft.com/en-us/library/ms143393(v=sql.110).aspx).
Additional Limitations on Upgrades
Be aware that when you perform an in-place upgrade, you cannot add features or
make configuration changes. If you need to do either, you must do so after the
upgrade. In addition, when you perform an in-place upgrade, you must upgrade the
whole instance. You cannot upgrade one database in an instance and leave the rest of
the instance at the previous level. To upgrade a single database, for example, you
would have to perform a side-by-side upgrade. This would let you copy or restore a
database from your old instance to your new instance while leaving the old instance in
place.
100
In-Place Upgrade
An in-place upgrade is the fastest and easiest upgrade method because it upgrades all
system and user databases and settings for you. In addition, you do not have to update
client applications to connect them to a new instance of the relational Database Engine.
However, an in-place upgrade is an all-or-nothing approach. In the unlikely event that
an in-place upgrade of the relational Database Engine fails, you cannot quickly roll back
to SQL Server 2005/2008/2008 R2.
If the upgrade fails, you have to take the following steps:
1. From the installation media, run the repair option in an attempt to fix the
instance. If this does not work, go to Step 2.
2. Uninstall the corrupted SQL Server 2012 instance that was created during the
failed upgrade attempt.
3. Restart the server.
4. Reinstall the earlier version of SQL Server (SQL Server 2005/2008/2008 R2).
5. Reinstall any required SQL Server service packs to your legacy SQL Server
instance.
6. Restore the system and user databases from database backups.
7. Review issues that prevented a successful upgrade in the previous attempt,
resolve them, and restart the upgrade process.
Be aware that downtime will be required if you must roll back an in-place upgrade.
Side-by-Side Upgrade
With a side-by-side upgrade, the SQL Server 2012 relational Database Engine is
installed as a second instance and the original SQL Server 2005/2008/2008 R2 relational
Database Engine remains in place. Then you move or copy one or more legacy user
databases to the SQL Server 2012 instance (each moved database is automatically
upgraded).
SQL Server 2012 Upgrade Technical Guide
101
During the side-by-side upgrade process, users can continue to access the legacy SQL
Server relational Database Engine and its databases (which are unaffected by the
upgrade process) while the new SQL Server 2012 instance is being built. When you are
ready to switch to the new instance, users must stop activity on the older instance while
you transfer databases to the new SQL Server 2012 instance, or you may lose data.
After the side-by-side upgrade is complete, the SQL Server 2012 relational Database
Engine and the legacy SQL Server relational Database Engine co-exist. After you verify
the SQL Server 2012 relational Database Engine, you can let applications access the
new server. After the SQL Server 2012 relational Database Engine is in production, you
can uninstall SQL Server 2005/2008/2008 R2 from the old server, or else just
decommission the server (e.g., take it off the network and rebuild the operating
system).
A side-by-side upgrade can require much more effort than an in-place upgrade. In an
in-place upgrade, SQL Server 2012 Setup makes sure that the new SQL Server 2012
instance has the same name as the old instance and automatically preserves server
configuration and server objects, such as logins, SQL Server Agent jobs, and so on. In a
side-by-side upgrade, you must perform all those tasks yourself, either manually or
through scripting techniques.
With a side-by-side upgrade, you either install the SQL Server 2012 relational Database
Engine as a new named instance on the same server or on a new server as either the
default instance or a named instance.
Warning: A relational database that was upgraded to SQL Server 2012 cannot be
restored or attached to an earlier version of SQL Server. You could extract the data
out of the SQL Server 2012 instance and import it to the legacy instance. Whatever
the case, if an in-place upgrade fails (perhaps because of a persistent issue such as
disk corruption), you must have a verified backup of your original databases to
retrieve data from.
A side-by-side upgrade lets you continue to use the existing relational database
environment until you are ready to switch to the new one. This approach can help
maximize your ability to quickly roll back to the prior instance should any difficulties
arise. A side-by-side upgrade might also result in simpler testing scenarios because
both versions are available at the same time.
However, a side-by-side upgrade is not as fast or simple as an in-place upgrade
because of the additional effort required to transfer all server objects and redirect
clients to the new instance. The side-by-side upgrade method does not upgrade any
SQL Server 2012 Upgrade Technical Guide
102
system databases. Although you can use the Copy Database Wizard to help move some
system objects, most database objects in the system databasessuch as server logins,
jobs, alerts, maintenance plans, user-defined error messages, and DTS packagesmust
generally be moved separately or recreated manually. For further information, see Use
the Copy Database Wizard (http://msdn.microsoft.com/enus/library/ms188664(v=sql.110).aspx).
Important: If you update any data in the legacy instance of SQL Server
2005/2008/2008 R2 while you are testing an upgraded database in an instance of
SQL Server 2012, the databases will not remain synchronized. Data changes that are
made to the existing database will not be made to the upgraded database. To bring
the instance of SQL Server 2012 forward in time, you must bring the new data from
the legacy SQL Server instance forward by using some kind of data transfer, such as
data file detach and attach, transaction log backup and restore, or transactional
replication. Some of these topics are covered later in this chapter.
Note: When you install a new instance of the SQL Server 2012 relational Database
Engine and then move one or more user databases to this instance, be aware that
the following SQL Server 2005/2008/2008 R2 relational database features are
disabled by default in new installations:
SQL Mail
Named pipes
xp_cmdshell
To enable some or all of these features, configure the server properties in SQL Server
Management Studio (SSMS) or use the sp_configure stored procedure.
Important: After upgrading to SQL Server 2012, always run sp_updatestats in the
upgraded databases, to ensure optimal use of improved statistics features in SQL
Server 2012.
103
If you opt to use the side-by-side method of upgrading to the SQL Server 2012
relational Database Engine, you have several methods to choose from, including the
following:
Backup/restore
Detach/attach
Log shipping
104
To minimize downtime, you might consider putting the database into Full recovery
mode before you make the second backup and restore. You can then restore the
database on your SQL Server 2012 instance, specifying the NORECOVERY option.
Because you are in the Full recovery mode, users can continue to change the original
database while all the backing up and restoring is occurring. When you are ready for
the final cutover, stop all activity on the legacy databases, back up the transaction logs
on the legacy SQL Server 2005/2008/2008 R2 instance, and restore the transaction logs
on the SQL Server 2012 instance with RECOVERY. After testing and acceptance, you can
allow updating to the new instance.
Detach/Attach
You can upgrade a SQL Server 2005/2008/2008 R2 database by detaching the database
from its current instance, moving or copying the underlying data and log files, and then
reattaching those data and log files to a SQL Server 2012 relational database instance.
The database will automatically be upgraded as it is attached. If you copy the data and
log files, you can reattach the original data and log files to the existing instance of SQL
Server with only minimal disruption to the availability of the databases to be moved.
The detach/attach upgrade method has the safety advantage in that the current
databases remain available until you are ready to switch over after you perform postupgrade compatibility and functionality testing and any necessary application
modifications (e.g., connection string changes, modifications required by the Database
Engine upgrade, T-SQL changes).
Note: In many SQL Server databases, a significant amount of unused space may be
reserved in the data and transaction log files. This is by design to minimize how
often a data file must expand as data is added. However, if you plan to detach a
SQL Server database of any version and copy or move it to another location to be
reattached, you will be moving this empty space together with your data. This
increases the time that is required to complete the upgrade process.
Important: During a side-by-side upgrade, if you allow data updates to the SQL
Server 2005/2008/2008 R2 instance while you are testing an upgraded database in a
SQL Server 2012 instance, the databases will not remain synchronized. Data changes
that you make to the existing database will not be made to the upgraded database.
(This is true not only for the detach/attach method but also any of the other
methods discussed in the Side by Side Upgrade section.) You must perform
another detach/attach upgrade of the database when you are ready to switch to
SQL Server 2012. As with all upgrade methods, make sure that you have reliable
SQL Server 2012 Upgrade Technical Guide
105
backup copies of the databases that you are upgrading. In the unlikely event that
the data files become corrupted during this process, you will be able to restore
them from these backups.
When you move a very large database (VLDB) from one instance to another on the
same server, the detach/attach method can have the advantage of requiring less disk
space than some other upgrade methods if you reuse underlying data and log files
instead of copying them. On systems that use a SAN disk configuration, you can detach
the SAN volume from the older instance of SQL Server and then present it to the
instance of SQL Server 2012. These options will save disk space and might save
database administrators (DBAs) from having to move the database files over the
network. But they will also eliminate the ability to roll back if the relational database
upgrade should fail for any reason.
With a SAN disk configuration, you can also clone the disk volume while the original
SQL Server relational database is online and then recreate that clone on another disk
array, which you can then attach to the SQL Server 2012 relational database instance
for upgrade. DBAs with a SAN disk configuration should meet with their disk engineers
to discuss possible methods for moving the database files without having to perform a
copy over the network and without attaching the original files if possible.
Caution: For rollback purposes, you should create a copy of the relational database
file (or perform a backup) before attaching it to a new relational database instance.
After you have attached a relational database file to SQL Server 2012, you cannot
reattach it to an earlier version of the SQL Server relational Database Engine.
Manual Schema Rebuild and Data Export/Import
Another way you can perform a side-by-side upgrade of a SQL Server 2005/2008/2008
R2 database is by using SSMS to generate a database creation script for the database
and executing the script in the desired SQL Server 2012 instance. You can then
manually copy the data from the original relational database to the new relational
database by using T-SQL scripts, DTS packages, SSIS packages, BCP commands, or any
number of other methods that are available to SQL Server DBAs for copying data from
one database to another.
Most DBAs do not choose this method for upgrading their relational databases
because it is primarily a manual process and provides few advantages over the side-byside upgrade methods previously discussed. However, it does leave the current
relational database online and lets you schedule the upgrade at a convenient time,
SQL Server 2012 Upgrade Technical Guide
106
such as overnight or over a weekend. This upgrade method also enables you to modify
database schema, clean up database data, or filter data being moved to the upgraded
databases during the upgrade process.
Log Shipping
You can use log shipping to make a side-by-side relational database upgrade easier
with minimal downtime. You can log ship from a legacy database on one instance to a
target database on SQL Server 2012 and then fail over the log shipping as the final
upgrade step. For more information about this alternative, see the "Methods for New
Hardware and Side-by-Side Upgrades" section in Chapter 4, "High Availability."
Copy Database Wizard
You can upgrade a SQL Server 2005/2008/2008 R2 database by using the Copy
Database Wizard. This wizard supports two upgrade approaches: detach/attach and
SQL Server Management Objects (SMO).
SMO. This approach is similar in concept to the manual schema rebuild and data
export/import upgrade method we looked at earlier. It uses SMO to read the
definition of each database object in the relational database being upgraded,
without taking it offline, and then recreates each object in the destination
database. It then creates and executes an SSIS package to transfer the data from
the source table to the newly created destination table, recreating indexes and
metadata.
Each approach within the Copy Database Wizard method lets you automate and
schedule the upgrade process at a convenient time. Each approach also lets you select
one or more of the following additional object types to upgrade:
Logins
107
With the Copy Database Wizard method, you cannot copy extended stored procedures,
alerts, DTS packages, or linked server configurations. You must move these manually.
Deprecated Features
There are some features in SQL Server 2012 that are marked for removal in the next
version of SQL Server. After you upgrade, you should remove the usage of these
features from existing applications and avoid them in new development work. For a
complete discussion of deprecated features in the SQL Server 2012 relational engine,
see Deprecated SQL Server Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/cc707789(v=sql.110).aspx).
Discontinued Functionality
Several features from earlier versions of the SQL Server Database Engine are not
supported in SQL Server 2012, so you must use replacement features for these. The
following link lists the discontinued features that you will most likely encounter as well
SQL Server 2012 Upgrade Technical Guide
108
Breaking Changes
Some settings will prevent the SQL Server 2012 Setup program from starting the
upgrade process for the Database Engine. If one of these issues is encountered, the
upgrade process will stop, and the legacy system will remain in place. Upgrade Advisor
will discover each issue that Table 1 lists.
Table 1: Issues That Will Prevent an Upgrade
Issue
Username of sys in a database. SQL Server 2012
Corrective Action
Create a new user who has a different name,
authentication.
Login names matching fixed server role names.
If you are performing a side-by-side upgrade, you must correct only the "username
sys" and the "duplicate index names" issues on the legacy system. SQL Server 2012 will
prevent you from applying any of the other settings, such as using a database ID of
SQL Server 2012 Upgrade Technical Guide
109
32767, having duplicate login SIDs, and having login names that match fixed server role
names.
Some additional issues will prevent you from upgrading a SQL Server 2005/2008/2008
R2 database to SQL Server 2012. You must resolve these issues before you start an
upgrade, or the upgrade will fail. Table 2 lists the most likely issues of this kind
together with the recommended corrective action.
Table 2: Issues to Resolve Before You Start the Upgrade Process
Issue
Corrective Action
compressed drives.
READ_WRITE.
upgraded.
Disk space. Additional space is required for data
name.
For a complete list of breaking changes in SQL Server 2005/2008/2008 R2, see the
following:
110
Behavior Changes
SQL Server 2012 has some behavior changes that might require you to take corrective
action after the upgrade is complete. For more information, see Behavior Changes to
Database Engine Features in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms143359(v=sql.110).aspx).
Important: Backward compatibility with earlier versions was a high priority in SQL
Server 2012, so in most cases, applications will behave as they did before the
upgrade.
For a complete list of behavior changes in SQL Server 2005/2008/2008 R2, please
review the following topics:
111
112
b. Next, select the instance name to analyze. In this example, the instance name
is MSSQLSERVER, as Figure 2 shows. In this step, you also specify your
authentication type and credentials for running the analysis.
113
114
115
files of user databases. You can turn off autogrow after the upgrade is complete
if it is required by your application or database maintenance plan.
8. Set the AUTO_UPDATE_STATISTICS option to ON for each database before
upgrading to SQL Server 2012 (or run UPDATE STATISTICS after the upgrade is
complete rather than wait until the first query hits old statistics). By setting the
AUTO_UPDATE_STATISTICS option to ON, all statistics are updated when they
are first referenced.
9. Disable all startup procedures because they might block the upgrade process.
You can re-enable the disabled startup procedures after the upgrade is
complete.
10. Disable all trace flags before upgrading to SQL Server 2012. Some SQL Server
2005/2008/2008 R2 trace flags may not exist in SQL Server 2012, and some trace
flags may have different functionality in SQL Server 2012. If you use trace flags,
you should verify each one after the upgrade to make sure there have been no
changes before you enable any previously used trace flags.
11. If your systems are using SQL Server replication, stop replication and make sure
that the replication log is empty.
12. Prune backup history tables in the msdb database to save time during the
upgrade. (Very large backup history tables can slow down the upgrade process.)
13. Exit all applications, including all services that have SQL Server dependencies.
Upgrades might fail if local applications are connected to the instance being
upgraded.
116
3. Make sure that the user databases to be upgraded are set to autogrow and that
the PRIMARY filegroup of each user database has sufficient disk space.
Additional disk space is required to allow for the additional space that is
required for the PRIMARY filegroup when you install SQL Server 2012. You can
turn off this option after the upgrade is complete.
4. Make sure that the log file for each user database is set to autogrow and has
sufficient additional disk space. Additional space is required by transaction log
files of user databases. You can turn off this option after the upgrade is
complete if it is required by your application or database maintenance plan.
5. Set the AUTO_UPDATE_STATISTICS option to ON before upgrading to SQL
Server 2012. Statistics are not upgraded as part of the upgrade process, and
relying on statistics from previous SQL Server releases might result in suboptimal
query plans. By setting the AUTO_UPDATE_STATISTICS option to ON, all
statistics are updated when they are first referenced.
6. Make sure that you have current backups of the databases that you are
upgrading by using the BACKUP DATABASE command, and verify their validity
by using RESTORE VERIFY ONLY before you start the upgrade process. If you use
the detach/attach method, you should make sure that you copy instead of move
the data files so that in the unlikely event something should go wrong, you can
quickly and easily reattach your data files on the original SQL Server
2005/2008/2008 R2 instance.
Performing an Upgrade
After thoroughly preparing to move your SQL Server 2005/2008/2008 R2 relational
Database Engine to SQL Server 2012, you are ready to perform the upgrade. Here are
the steps for performing an in-place upgrade and a side-by-side upgrade.
117
118
Important: You must manually move or transfer the master and msdb database
objects (e.g., logins, jobs, alerts) to the SQL Server 2012 instance from the legacy
server.
Detach/Attach Upgrade Method
Take the following steps to upgrade a user database by using the detach/attach
upgrade method:
1. Detach the database to be moved from the SQL Server 2005/2008/2008 R2
instance by using SQL Server Enterprise Manager (SSMS) or the sp_detach_db
stored procedure.
2. Copy the detached data file(s) and log file(s) to the new server.
3. Attach the copied data and log files to the SQL Server 2012 instance by using
SSMS or the CREATE DATABASE T-SQL statement with the FOR ATTACH or FOR
ATTACH_REBUILD option.
4. Optionally, if you copied the original data and log files, reattach the original data
and log files to the previous instance of SQL Server 2005/2008/2008 R2.
Important: You must manually move or transfer the master and msdb database
objects (e.g., logins, jobs, alerts) to the SQL Server 2012 instance from the legacy
server.
Copy Database Wizard Upgrade Method
Take the following steps to upgrade a user database by using the Copy Database
Wizard upgrade method:
1. Make sure that you have the required permissions on the appropriate servers.
a. For the detach/attach approach, you must be a member of the sysadmin
fixed server role on both the source and destination servers.
b. For the SMO approach, you must be a database owner for the source
database and must either have been granted the CREATE DATABASE
permission or be a member of the dbcreator fixed server role on the
destination server.
2. Specify the source and destination servers.
3. Specify the databases to be moved or copied.
119
a. For the detach/attach approach, active sessions must not exist when the copy
or move operation is tried, or the Copy Database Wizard will not execute the
move or copy operation.
b. For the SMO approach, active connections are allowed because the database
is never taken offline.
4. Specify the name of the target database if different from the source database.
5. Specify other objects to be moved, such as logins, shared objects from the
master database, jobs, maintenance plans, and user-defined error messages.
6. Specify a schedule for the copy or move operation if you want it scheduled for a
later time.
7. If you are not a member of the sysadmin fixed server role, you must specify a
SQL Server Agent Proxy account that has access to the SSIS package execution
subsystem. For information about how to create a proxy account, see How to:
Create a Proxy (SQL Server Management Studio) (http://msdn.microsoft.com/enus/library/ms190698(v=sql.105).aspx).
Important: You must manually move or transfer the master and msdb database
objects (e.g., logins, jobs, alerts) to the SQL Server 2012 instance from the legacy
server.
Post-Upgrade Tasks
You should take the following actions after you upgrade a relational database to SQL
Server 2012 to make sure that the upgrade ran successfully and to configure the
relational Database Engine in addition to the upgraded relational database.
In-Place Upgrade
For in-place upgrades, execute the following steps:
1. Apply available service packs or updates to the upgraded SQL Server 2012
instance.
2. Reregister your servers. For information about registering servers, see Create a
New Registered Server (SQL Server Management Studio)
(http://msdn.microsoft.com/en-us/library/ms188231(v=sql.110).aspx).
3. Configure the SQL Server installation. To reduce the attackable surface area of a
system, SQL Server selectively installs and enables key services and features.
Therefore, you must configure the new instance to meet your specific needs.
SQL Server 2012 Upgrade Technical Guide
120
Side-by-Side Upgrade
For side-by-side upgrades, execute the following post-upgrade steps:
1. Configure or update server logins on the new instance and database users in the
upgraded database.
2. Configure jobs and database maintenance plans on the new instance.
3. Configure alerts on the new instance.
4. Configure DTS and SSIS packages on the new instance.
5. Update connection strings at clients so that they can connect to the new
instance, unless you are replacing the old server with a new server that has the
same identity.
121
122
An invalid plan will not cause the query to fail when the USE PLAN hint is specified in a
plan guide. Instead, the query is compiled without using the USE PLAN hint. For more
information about query processing on partitioned objects, see Query Processing
Enhancements on Partitioned Tables and Indexes (http://msdn.microsoft.com/enus/library/ms345599.aspx).
Finding and Tuning Similar Queries by Using Query and Query Plan Hashes
(http://msdn.microsoft.com/en-us/library/cc645887.aspx)
SQL Server 2012 also includes many improvements to query plans on partitioned tables
and indexes. They include an improved algorithm for identifying the best parallel
execution strategy, an improved seek mechanism for partitioned tables, and additional
information displayed in the query execution plans for queries that include partitioned
tables. For complete information about these improvements, see Query Processing
Enhancements on Partitioned Tables and Indexes (http://msdn.microsoft.com/enus/library/ms345599.aspx). Also see Behavior Changes to Database Engine Features in
SQL Server 2012 (http://technet.microsoft.com/enus/library/ms143359(v=sql.110).aspx) for the latest information about plans over
partitioned tables.
123
SQL-DMO-based
WMI providers
DB-Library
Network
communication
Description
The only supported network protocols are now TCP/IP Sockets, named pipes, VIA,
and shared memory. If your application is using network protocols that are not in
this list, it will not work.
If your application uses DMO-based management APIs, you must upgrade to either
the SMO-based management APIs or the WMI for Configuration management
APIs. SMO is written by using the managed code APIs. WMI for Configuration is
written by using unmanaged code APIs.
Before SQL Server 7.0, the primary mechanism for client/server communication
between SQL Server and client applications was DB-Library. Although DB-Library
was still included with SQL Server 2000, Microsoft announced that it was being
deprecated. With the release of SQL Server 2005, DB-Library support is limited to
SQL Server 7.0 features.
By default network communication might be disabled in new SQL Server 2012
installations and must be enabled through the Server Network Communication
tool.
Conclusion
The SQL Server 2012 relational Database Engine offers many improvements over SQL
Server 2005, 2008, and 2008 R2, as well as significant new features. The first step in
taking advantage of these improvements is upgrading your existing databases to SQL
Server 2012. As this chapter explains, you have two main choices for upgrading legacy
SQL Server 2005/2008/2008 R2 databases to SQL Server 2012: in-place or side-by-side.
If you select the side-by-side method, you have additional choices to make, including
whether to use the backup/restore, detach/attach, or Copy Database Wizard method
or another alternative. Each of these options has its pros and cons, so you need to
make sure that you understand your organizations current configuration and needs.
Then you have to prepare thoroughly and test extensively to make sure that an
upgrade is successful and ready for production.
Additional References
For an up-to-date collection of additional references for upgrading SQL Server 2012,
see the following links:
124
125
Preparing to Upgrade
Before looking at how to have highly available upgrades to SQL Server 2012, this
section details the types of upgrades possible and how each should be thought about
from the perspective of availability. The three main upgrade options are an in-place
upgrade, a side-by-side upgrade, and going to a separate server or new cluster. For a
detailed discussion of upgrade types and their advantages and disadvantages for
different scenarios, see Chapter 1, "Upgrade Planning and Deployment."
During an upgrade, the original instance of SQL Server and its databases remain
available until the Database Engine upgrade process begins. This means that during the
checks and file copy operations, you can use the instance and allow connections.
However, the upgrade process does not let you know when it starts processing the
database or that other objects might be in use. It is therefore always best to ensure that
all connections are terminated and transactions are complete before the setup or
upgrade process has started. You do not want to run the risk of someone issuing a
query after a final backup has already been performed, thus invalidating it.
In-Place Upgrade
An in-place upgrade uses SQL Server 2012 Setup to directly upgrade an instance of
SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, or pre-release SQL Server 2012
to SQL Server 2012 RTM on the same server or Windows Server Failover Clustering
(WSFC) cluster if you have already deployed the supported version of SQL Server for
upgrading on a supported operating system version (Windows Server 2008 Service
Pack 2 (SP2) or later or Windows Server 2008 R2 SP1 or later). The "Upgrade Strategies"
section in Chapter 1 describes the in-place upgrade process in detail.
SQL Server 2012 Upgrade Technical Guide
126
An in-place upgrade has the highest risk of extended downtime compared with the
other upgrade methods because the upgrade occurs where the source instance is
configured. There is no way to isolate or minimize downtime; the instance and user
databases will be unavailable during the entire time of the upgrade. For some
organizations, the downtime and the ability to reuse hardware may offset the cost and
resources necessary to use another upgrade method.
The more important consideration with an in-place upgrade is that the installation of
SQL Server may not be usable should the process fail for whatever reason. This worstcase scenario would need to be remedied by a full reinstall of Windows and SQL Server
because the file versions might be in a mixed state. After the reinstallation, you would
have to restore the databases and objects from backups and scripts. Any fallback plan
must include steps to potentially rebuild the server from scratch to the way it was
before the upgrade process started. Backup and restore is the only fallback plan, so if
pursuing an in-place upgrade, make sure that you have good backups and tested plans
for bare metal recovery.
127
Note: There are resource DLLs for both SQL Server and SQL Server Agent that are
shared by all versions of clustered instances of SQL Server on the same WSFC
cluster. This is expected and fully supported.
Problems with a side-by-side upgrade on the same server or WSFC cluster include the
following:
You may still encounter downtime because some SQL Server 2012 components
could require a reboot to install (for example, the resource DLL for a clustered
configuration).
SQL Server 2012 is still bound by the same rules as SQL Server 2005, SQL Server
2008, and SQL Server 2008 R2 when it comes to the individual instance names.
On a single server or WSFC, there can be only one default instance. Everything
else can be a named instance. If one of the existing instances (2005, 2008, or
2008 R2) is already using the default instance, the SQL Server 2012 installation
must be a named instance. Ensure that this will not pose a problem to the
application after the upgrade is complete, otherwise the application may not be
able to connect to the new instance.
It will be very hard to go back to the previous configuration that existed preupgrade. There are two main aspects to this:
o
128
restore system backups or reconfigure the hardware from scratch. That will most
likely not be the issue; the issue would most likely occur if an applications
database that now exists in SQL Server 2012 starts to exhibit some sort of issue
that would require it to be moved back to the previous version of SQL Server.
Because you cannot take a backup of a SQL Server 2012 database and restore it
to an earlier version of SQL Server, you will need to devise some other way to
extract the data, such as using BCP or SQL Server Integration Services (SSIS). Data
movement is the more trivial aspect of porting the database back. The difficult
aspect is trying to figure out what data changed. That would be a manual
process.
129
a clustered instance that exists in Active Directory. So a named instance cannot be fully
renamed because the part after the slash cannot be renamed. For example, assume you
have a named instance of MYINS\INSNAME. MYINS can be renamed but INSNAME
cannot.
The reason this all matters is that some applications may be inflexible and require a
specific name to connect to. This is more glaring if the application is installed on many
desktops. The amount of work required to touch every desktop may be impossible, so
if the same name must be used but the old server cannot be decommissioned or the
same name cannot be used, other methods such as using aliases in DNS must be
considered. That type of requirement puts a burden on network administrators and is
only a patch that obscures the underlying issue.
130
Use backup compression (either third party or what is built into SQL Server 2008
or later) to generate backups. This shrinks the backup size (which means a
quicker copy time) and usually speeds up the backup and restore process.
Use hardware-based (i.e., SAN-based) backups to make the backup, and then
attach the backup (and restore it) using lower-level technologies that are
transparent to the hardware. This strategy assumes that the source and
destination servers are on the same storage unit. Hardware-based backups are
not an option if this configuration is not already set up. For more information,
see the "Hardware-Assisted Database Moves" section later in this chapter.
131
and-copy process because once the database is detached, it is no longer part of the
source instance until it is reattached. This method might not be an optimal solution for
minimizing downtime and could pose a risk. In addition, if the database is large, this
approach is impractical for the reasons stated previously.
Log Shipping
Log shipping is traditionally used only as a high-availability or disaster recovery
solution, but it is also a useful upgrade option. The log shipping method is based on
backup and restore and requires that the source database be configured to be able to
make transaction log backups (so the Simple recovery mode would not work). It offers
a way to minimize downtime because the only necessary outage occurs during the
switch from Server A to Server B. Most of the workincluding getting a new server up
and running and performing the initial backup, copy, and restore operationcan be
done well in advance of the actual cutover.
The problem is that while SQL Server 2012 can restore backups from older versions of
SQL Server going back to SQL Server 2005, the log shipping features of those earlier
versions of SQL Server cannot be used to configure log shipping to SQL Server 2012.
Custom log shipping scripts (such as the scripts listed in "Additional References"
section at the end of the chapter) would need to be used.
Hardware-Assisted Database Moves
Besides the traditional options for moving databases, another approach has become
increasingly cheaper over the years: hardware-based moves via shared storage, such as
a SAN. Many companies deploy a large portion of their servers on one or more storage
units. Failover clustering requires shared storage. Assuming that the source and target
servers are on the same storage unit and that the appropriate options are configured
on the hardware, this option opens up many possibilities for minimizing downtime.
A hardware-assisted backup is generally known by most storage vendors as a
"snapshot," "clone," or something similar. What happens is that a backup is initiated
outside of SQL Server, and the disks being used by SQL Server are essentially cloned
and snapped off. The clone can then be attached to another server on the same
storage unit. This process is nearly instantaneous, and you can use the snapshot or
clone for a restore (traditional or hardware-based). Within SQL Server, I/O is "frozen"
briefly and then "thawed" to ensure consistency behind the scenes. (This can be seen in
the SQL Server log.) Although this process takes a few seconds, it should be completely
transparent.
SQL Server 2012 Upgrade Technical Guide
132
133
134
get the proper pricing and license for the SQL Server 2012 deployment. For more
information, see SQL Server 2012 Licensing Page at
http://www.microsoft.com/sqlserver/en/us/get-sql-server/licensing.aspx
Disk Space
Disk space, or lack thereof, is one of the major causes of downtime. During the
installation of SQL Server 2012, SQL Server will tell you how much disk space is needed.
For more information, see the "Hard Disk Space Requirements (32-Bit and 64-Bit)"
section in Chapter 1. Hardware and Software Requirements for Installing SQL Server
2012 (http://msdn.microsoft.com/en-us/library/ms143506(v=sql.110).aspx) also lists
how much disk space the program files consume.
Besides accounting for the program files and system databases, follow the
recommended guidelines to account for the disk space needed during the upgrade.
The downtime spent recovering and then attempting to continue upgrading a VLDB
that failed due to lack of disk space can easily be avoided through proper planning.
You also need to size all databases and their files appropriately after the upgrade,
especially tempdb.
In addition, one of the biggest consumers of disk space will be the backups used to
initialize the upgrade in a side-by-side scenario as well as the backups made prior to
the upgrade or decommissioning. Make sure you account for this space as noted in
"Perform Database Backups" section later in this chapter and in the "Plan for Backups"
section in Chapter 1.
135
136
Time management is crucial when coming up with your plans. As part of the fallback
plan, you need to set "go" and "no-go" points. For example, if you need to be up and
running for Monday's business but your upgrade looks like it will exceed the window
you planned for, put your contingency plan into place. Know how long the contingency
plan will take to execute. If you know that it takes five hours to execute and the
business needs to be up by 7 A.M. on Monday, your no-go point would be around 2
A.M. on Monday. Make sure the "go" points are listed steps or items that when
checked, verify that the upgrade can happen. Missing one of the steps could cause
problems down the road.
137
138
139
Never decommission an instance or database until a final full backup is made. During
the upgrade process, it is also recommended that you perform backups at certain
points so that in case something goes wrong, the upgrade process will not have to start
from the beginning. For example, suppose application changes occur before the
upgraded database goes live in production and something goes wrong. If a database
backup was made before those changes occurred, you will experience some downtime
but not nearly as much as if you had go back 18 hours to the initial backup, copy, and
restore operation. In any catastrophic failure, the only way to recover is with good,
proper backups. Not making them will most certainly increase, not decrease, downtime.
The worst thing about backups is that they consume disk space, but you can delete
them some time in the future when you no longer need them.
Script or Export All Objects
No SQL Server high-availability method except failover clustering, which provides
instance-level protection, accounts for objects that reside outside the database.
Chapter 2, "Management Tools," and Chapter 17, "Integration Services," discuss how to
use scripting or tools such as SSIS to move objects from one database or instance to
another. These objects include instance-level logins, linked servers, SQL Server Agent
jobs, and user-created stored procedures.
To minimize downtime, prepare any scripts or SSIS packages before the upgrade. In
cases where sensitive information may be stored (such as passwords), secure them
properly. Upgrades can fail when an application no longer functions properly because
an object such as a linked server is not configured.
Even if you do not use any of the high-availability technologies discussed in this
chapter, using scripts or SSIS packages for objects involved in the upgrade provides an
insurance policy in case a complete failure occurs. Having these objects scripted or
exported out of the original system could mean the difference between some
downtime and trying to track down the consultant who implemented the system years
ago to see if he or she remembers those key elements.
Upgrade Common Components
Another way to minimize downtime is to upgrade the common components to the
versions required by SQL Server 2012 ahead of the actual SQL Server 2012 upgrade. Do
not install any upgrades without performing due diligence and having reasonable
confidence that the new elements will not destabilize the current production
environment and cause downtime.
SQL Server 2012 Upgrade Technical Guide
140
Full-Text Search
Chapter 6, "Full-Text Search," covers the strategies for upgrading full-text search, which
has been integrated into the Database Engine since SQL Server 2012. If upgrading from
a clustered SQL Server 2005 instance, there will no longer be a dedicated cluster
resource for full-text in the resource group with SQL Server. This is expected behavior.
For all deployments both clustered and not clustered, if you use full-text indexes, you
will have more to upgrade. Plan accordingly for the additional downtime required.
Replication
If you are upgrading from a clustered SQL Server 2005 instance, you may not have
configured replication. SQL Server 2012 automatically will install replication as a feature
even if you are not using it. For details about upgrading replicated databases, see the
"Upgrading Replicated Databases" section later in this chapter.
Service Accounts
During an in-place upgrade, Setup will not prompt you to change the existing
instance's service accounts. This means that any existing service accounts will also be
used for SQL Server 2012. Anyone who has access to those accounts and knows the
passwords will have full access to the new SQL Server 2012 instance. We do not
recommend using the existing accounts for the upgraded instances of SQL Server 2012
if that is a concern. To remedy this situation, create new domain-based service
accounts with the correct privileges on each server. After the upgrade, use SQL Server
Configuration Manager (covered in Chapter 5, "Database Security") to update the newly
upgraded services to use these new accounts.
Management Tools and Utilities
After the upgrade, only SQL Server 2012 tools and utilities should be used to manage
SQL Server 2012 instances. This will require that the appropriate version for SQL Server
2012 is installed somewhere in your ecosystem. You may still need to manage older
versions of SQL Server, so you may need to have multiple versions of SQL Server
Management Studio (SSMS) to have the most optimal experience for a particular
version of SQL Server.
Note: When you upgrade in-place to SQL Server 2012, the SQL Server 2012 install
process might not remove the existing management tools for the legacy version of
SQL Server. After the upgrade, check to see if the old tools versions still exist and, if
necessary, uninstall them.
SQL Server 2012 Upgrade Technical Guide
141
One Instance
2
3
4
Two Instances
4
6
8
Three Instances
6
9
12
Four Instances
8
12
16
These numbers might be surprising to some, but the installation change was
implemented with these important goals in mind: increased stability, improved
reliability, and more granular control. In terms of an in-place upgrade, the ability to
upgrade instances in a rolling fashion, one node at a time, increases application and
database availability and minimizes downtime during an upgrade. Other nodes and
their individual components as they relate to an instance can be upgraded
independently.
SQL Server 2012 Upgrade Technical Guide
142
Another major feature change is that if you are implementing a new failover clustering
instance under Windows Server 2008 or Windows Server 2008 R2, SQL Server 2012
does not require the domain groups that were introduced with SQL Server 2005. SQL
Server 2012 uses a Service SID in addition to the service accounts. For information
about Service SIDs, see Cyril Voisin's Per-service SID security blog entry
(http://blogs.technet.com/b/voy/archive/2007/03/22/per-service-sid.aspx).
143
Note: While WSFC has the Migrate a Cluster Wizard, it cannot be used for SQL
Server. Make sure you make proper backups of everything prior to unconfiguring
the old cluster.
SQL Server 2012 is the first version of SQL Server to support Windows Server Core if
you are using Windows Server 2008 R2 SP1 or later. Windows Server Core is a stripped
down version of Windows that has no user interface, relies on the command line, and
restricts what can be run on it. It can potentially be more secure and offer other
benefits, such as reducing the amount of patches that need to be applied. It is not
possible to convert existing installations to Windows Server Core during an upgrade
unless you use completely new hardware.
Notable Changes to Both Windows and SQL Server 2012 Failover Clustering
If you are only used to clustering using Windows Server 2003, Windows Server 2008
(and later) has quite a few new features that you should become familiar with. SQL
Server 2012 also introduces a few improvements that you should be aware of.
The Windows Server 2008 (and later) failover clustering features include the following:
Starting with Windows Server 2008, a WSFC is no longer bound by the old
Windows Server Catalog and the cluster solutions defined in them. Windows
Server 2008 has a built-in process called Cluster Validation. The concept is
simple: If the hardware passes the tests, a cluster can be configured and is
considered supported as long as the hardware itself is logoed for the version of
the operating system you plan on deploying. If the validation fails, the cluster is
not considered a supported or valid cluster. It is possible to deceive Cluster
Validation because some tests can be disabled; do not do this.
Do not use this capability to cobble two or more odd pieces of hardware
together as a valid cluster. The recommendation is still to configure nodes that
are similar (i.e., same brand and type of server). The biggest change to
implementers is that they will have to rely on the other hardware vendors to
provide correct information about which drivers are certified for clusters using
Windows Server 2008.
The support policy for Windows Server 2008 and Windows Server 2008 R2 WSFC
clusters is clearly outlined in the Knowledge Base article The Microsoft Support
Policy for Windows Server 2008 or Windows Server 2008 R2 Failover Clusters
(http://support.microsoft.com/kb/943984). Similarly, you should also be familiar
with the SQL Server support policy for clusters as outlined in the Knowledge
SQL Server 2012 Upgrade Technical Guide
144
Base article The Microsoft SQL Server support policy for Microsoft Clustering
(http://support.microsoft.com/kb/327518).
Important: It is crucial to ensure that the underlying WSFC has no errors
during cluster validation. SQL Server 2012s Setup relies on the validation
results. If an error is found, Setup will not proceed.
Windows Server 2008 and Windows Server 2008 R2 failover clustering supports
multiple subnets for cluster nodes natively.
Quorum introduces the concept of a witness. There are four quorum models (up
from two in Windows Server 2003). They are:
o No Majority. This is the same as the old disk-based quorum, where the
witness disk is a single point of failure.
o Node Majority. This is the same as the old Majority Node Set quorum,
where one less than half the number of nodes rounded up can be
tolerated as a failure. So for example, two nodes have no failure tolerance,
three and four nodes can tolerate one node failure, and five nodes can
tolerate two nodes failing. Node majority is best for an odd number of
nodes.
o Node and Disk Majority. This is a combination of both the witness disk
and a majority of nodes, giving you more protection. It can tolerate the
failure of half the nodes rounded down if the witness disk is available, and
it can tolerate the failure of one less than half the nodes rounded up if
the witness is unavailable. So for example, two nodes have one-node
failure tolerance if the witness is available, but no failure tolerance if the
witness is unavailable.
o Node and File Share Majority. Similar to the Node and Disk Majority, this
uses a file share instead of a witness disk. This is a good choice for a
geographically dispersed cluster.
145
All cluster nodes must be in the same domain to implement SQL Server 2012
with Windows Server 2008 and Windows Server 2008 R2.
All disks must still be Basic disks (not Dynamic). However, GUID partition table
(GPT) disks are supported for sizes over 2 TB.
You can configure tempdb to be on the local node (for example, C:\tempdb).
The paths must be the same on all nodes. This cannot be configured during an
upgrade.
SQL Server 2012 introduces a new health check model. Instead of using SELECT
@@SERVERNAME for the heavyweight cluster-specific check as part of the
resource DLL, it now uses sp_server_diagnostics. You can now configure what is
being called a flexible failover policy that is based on the state of what is going
on within your instance. It may or may not trigger a failover. For more on this,
see the SQL Server 2012 Books Online topic Failover Policy for Failover Cluster
Instances (http://technet.microsoft.com/enus/library/ff878664%28SQL.110%29.aspx).
SQL Server 2012 introduces server message block (SMB) share support for FCIs.
This will allow you to use a SMB share to place your databases. This is not
something you will be able to configure during an in-place upgrade.
146
Faster failover is possible using indirect checkpoints. Indirect checkpoints are not
enabled by default and require a good disk subsystem to ensure even I/O
throughput. For more information, see the topic Database Checkpoints (SQL
Server) (http://msdn.microsoft.com/enus/library/ms189573%28v=SQL.110%29.aspx) in SQL Server 2012 Books Online.
147
As with SQL Server 2008 and SQL Server 2008 R2, SQL Server 2012 does not support
installing a 32-bit failover clustering instance under the Windows On Windows 64
(WOW64) feature of 64-bit Windows. SQL Server 2005 technically allowed it (but it was
not recommended). If your deployment is set up that way, an in-place upgrade of a
WOW64-based SQL Server 2005 failover cluster to SQL Server 2012 is not supported.
To upgrade to SQL Server 2012 if a WOW64-based SQL Server 2005 failover cluster is
deployed, you must use a side-by-side approach if you want to do it on the same
WSFC cluster.
Another thing to note is that as of SQL Server 2008, full-text has been integrated into
the Database Engine. With SQL Server 2005, full-text got its own resource in the cluster,
as seen in Figure 2. After the upgrade, there will no longer be a full-text resource as
shown in Figure 3.
148
Figure 3: Upgraded SQL Server 2012 FCIs resource group from SQL Server 2005
149
same hardware or install a new SQL Server 2012 instance on a brand new WSFC cluster
to use that Instance ID. An example of an amended Instance ID is shown in Figure 4.
150
instance, but if you have multiple nodes and instances, you may want to control how
and when instances move from one node to another.
Like installing a new clustered instance, upgrading is an instance-by-instance, node-bynode affair. That means a single upgrade will only affect a specific instance on one
node. The only exception is when you have multiple instances, in which any shared
componentsincluding the resource DLLwill be upgraded. The binaries specific to
the instance(s) not being upgraded will not be touched. However, because the resource
DLL will be updated, this will either force you to move that instance to another node or
take it offline once the resource DLL is replaced. Since you want to minimize the impact
to end users, you should coordinate an outage with the application owner as well as
the business. The good news is that once the resource DLL is replaced, no matter how
many instances you have that could potentially run on that node, you will most likely
not need another reboot unless you have some other files locked.
If you are upgrading an instance of SQL Server and have another FCI already running
on that node, once the resource DLL replacement happens, you could cause the other
instance to go offline as shown in Figure 5. This is why you want to control failovers. In
this example, the instance SQL2K12RC0 was upgraded on a node where there was a
running SQL Server 2005 instance (UPGINS1\SQL2K5). This is also detected by one of
the upgrade rules as shown in Figure 6.
Figure 5: Upgrade causing an outage for another instance due to the resource DLL
SQL Server 2012 Upgrade Technical Guide
151
Figure 7: Error message noting you cannot move the FCIs resources to another node
152
Possible owners can be found on the Advanced Policies tab of the network name
resource. In Figure 8, all nodes in this WSFC cluster can potentially own SQL Server.
153
154
If you want to perform the same task in a scripted fashion, you can do it using
cluster.exe or PowerShell. Note that cluster.exe is deprecated as of Windows Server
2008 R2, so you should use PowerShell where possible. The first thing you would need
to do is figure out the name of the network name resource for that instance of SQL
Server and ultimately what resource group it is in to be able to do a failover. Figure 11
shows an example using cluster.exe and Figure 12 shows an example using PowerShell.
155
Figure 13: Examples of altering possible owners and failing a resource group using
cluster.exe
To modify the possible owners for a resource using PowerShell, you can pipe the
resource through the Get-ClusterOwnerNode cmdlet to see the possible owners. To
change the possible owners, use the Set-ClusterOwnerNode cmdlet with the -Owners
parameter and list the nodes separated by commas. Unlike the cluster.exe
implementation, the list you provide will be absoluteits not a simple matter of
adding and removing. To control failover for a resource group, you would use the
Move-ClusterGroup cmdlet with the Node parameter, specifying the node to which
you want to move the group. Examples of these cmdlets are shown in Figure 14.
156
Figure 14: Examples of altering possible owners and failing a resource group using
PowerShell
Considerations for Upgrading Multiple Instance Failover Clustering Deployments
As noted in the previous section, upgrading a cluster that has multiple instances is
more challenging because you are potentially affecting more than just the instance you
are looking to upgrade. This will require careful planning and coordination. Each
instance will be affected by an outage at some point, even if the instance in question is
not the one that is being upgraded (yet) to SQL Server 2012. This section walks you
through an example of a cluster with two instances of SQL Server on two nodes. One
instance is SQL Server 2005 SP4, and the other is SQL Server 2008 SP3. For this
example, assume that an instance is running on each node, as shown in Figure 15.
157
In this example, we will start with Instance 2 (SQL Server 2005), so that it will be failed
over to the other node. Once the failover occurs, upgrade the SQL Server 2005
instance. This will also upgrade any shared components at the same time, which would
affect the SQL Server 2008 instance. Figure 16 shows what the cluster will look like.
Figure 17: SQL Server 2008 upgraded on one node (one node completed)
Since once node is completely upgraded to SQL Server 2012, two things must happen:
1. The instances in the midst of the upgrade process must be failed over to a node
that has been upgraded in order to upgrade the internal components.
2. The binaries on the node not upgraded must be upgraded.
As noted earlier, you can control this process yourself or have Setup take care of it. If
you have reached the tipping point where enough of the other nodes have been
SQL Server 2012 Upgrade Technical Guide
158
upgraded, Setup will fail the instance over to a valid node on its own but it may not be
hosted where you prefer. In this example, there are only two nodes so that is not a big
decision point, since there is only one place for the instances to go.
For this example, SQL Server 2005 will be upgraded first. However, as noted above,
since the resource DLL must be replaced, the 2008 instance will be affected so it is
recommended that you fail over both instances to the other node, which will upgrade
both of them. The cluster will look like the one in Figure 18, and the first node is ready
to be upgraded.
Figure 18: Manual failover of both instances to complete the internal upgrade
At this point, you have two working SQL Server 2012 instances that you can now test to
ensure that the applications work correctly before opening them up for production use.
This can be done while upgrading the instances on the node not owning the FCIs.
Technically, you may even claim that you are done if the applications are verified, but it
is always best to finish the upgrade on all nodes and test failover to ensure that
nothing has changed post-upgrade. You do not want to get into a situation where you
assumed that failover could happen, but found out weeks later that there was a
problem in the failover process.
Although this example was relatively simple, it involved possible multiple outages. If
the instances were to be upgraded at different times, one would still affect the other.
The more complex your WSFC and FCI configuration, the more challenging the
upgrade. Account for this in your planning.
Before Upgrading (Setup or Command Line)
Here are the tasks that you should perform before upgrading a clustered instance to
SQL Server 2012:
159
160
If you attempt to upgrade the node that currently owns the instance, you will
see the message shown in Figure 19 when you reach the Cluster Upgrade Report
dialog box. If you are trying to maximize your uptime, this warning is a clear
message that you will incur downtime that you may not have accounted for.
Figure 19: Message if you are attempting to upgrade the owner of the instance
2. During the upgrade process, you will first have to select which instance you are
upgrading on that node. If there is only one instance installed, you will see a
dialog box similar to the one in Figure 20. If there are multiple instances, they
will be displayed in the Installed instances table as shown in Figure 21. You can
select the instance to upgrade in the drop-down list. If there is only one instance
that is eligible for upgrade, you will not be able to select anything else in the
drop-down list.
161
Figure 22: Initial Cluster Upgrade Report showing that nothing is upgraded
162
After the upgrade of a node is complete, the Cluster Upgrade Report will be
displayed again with an updated status, as shown in Figure 23. Note that
UPGNODE2 now reflects the RTM version number of SQL Server 2012.
163
7. Follow the instructions in Upgrade a SQL Server Failover Cluster Instance (Setup)
(http://msdn.microsoft.com/en-us/library/ms191295(v=sql.110).aspx) to upgrade
the failover clustering instance. Use the same instance ID that was used for
upgrading the other node(s). During the upgrade, the instance will be failed over
to one of the already upgraded nodes (unless you have done that manually), as
the notification in Figure 24 shows. Figure 25 shows the failover during the
upgrade. Figure 26 shows the instance brought online on another node. Note
that the full-text search resource has already been removed from the resource
group since this example shows a SQL Server 2005 upgrade.
SQL Server will be unavailable during the failover process and while the
databases are being upgraded. Sometimes there is no need to stop the traffic.
Setup will automatically handle the failover to the upgraded node. On average
this takes about 2 minutes, depending on the hardware and other
configurations.
Figure 24: Cluster Upgrade Report when the instance itself is upgraded
164
165
Figure 27: Instance is in the process of being upgraded internally and not
available for use
8. When the upgrade is complete, Setup will show a final Cluster Upgrade Report,
similar to the one in Figure 28.
Check for pending reboots and any errors in the logs to see if a reboot is
necessary on the node. Reboot as needed.
SQL Server 2012 Upgrade Technical Guide
166
2. Manually test failover of the resource group containing the SQL Server resource
between all nodes of the cluster.
3. Ping the network name of the clustered SQL Server instance from all nodes
inside the cluster as well as outside the cluster.
4. Ping the IP address of the clustered SQL Server instance from all nodes inside
the cluster as well as outside the cluster.
5. Make sure that the compatibility level of the databases is set to 110 (if
necessary).
6. We recommend that you run all the necessary health checks including DBCC
CHECKDB to ensure the well-being of the newly upgraded databases.
7. Even if you do not plan on using availability groups immediately, enable the
feature so that they can be used later. Availability groups are enabled at the
service level and require a restart of SQL Server, which is why this is an
opportune time to perform this task. For more information, see the SQL Server
2012 Books Online topic Enable and Disable AlwaysOn Availability Groups (SQL
Server) (http://technet.microsoft.com/en-us/library/ff878259(v=sql.110).aspx).
Once all of these tasks are complete, verify that the upgrade is successful. Open the
instance for testing the applications; when those are certified, allow production use.
Side-by-Side Upgrade in the Same Cluster or to a New Cluster
Performing a side-by-side upgradewhether on the same cluster where the current
instance lives or using a newly deployed Windows clusterbasically follows the same
steps as an in-place upgrade. Use one of the methods listed in the "Methods for Sideby-Side Upgrades to a Separate Server or Cluster" section to move and upgrade the
databases in conjunction with installing a fresh instance of SQL Server 2012. Remember
that with failover clustering, the new clustered instance name must be completely
unique in the domain. This means that after the upgrade, all users and applications will
need to be redirected to the new instance.
Using the Command Prompt to Perform an In-Place Upgrade for a Failover
Clustering Installation
This section provides sample syntax for upgrading an instance via the command line.
There are two options for using the command line: either enter all the commands
directly on the same line as setup.exe, or use a configuration file. This section covers
SQL Server 2012 Upgrade Technical Guide
167
using setup.exe only. For more information on all of the parameters available during an
upgrade, see Install SQL Server 2012 from the Command Prompt
(http://msdn.microsoft.com/en-us/library/ms144259(v=sql.110).aspx#Upgrade) in SQL
Server 2012 Books Online.
There is one optional, but very specific parameter, that applies to failover clustering
instance upgrades: FAILOVERCLUSTERROLLOWNERSHIP. Setting a value for this
parameter controls the behavior of failover (as described above in the "Instance
Failover Behavior During the Upgrade Process" section). The three possible values for
FAILOVERCLUSTERROLLOWNERSHIP are:
0 = Will not allow failover to one of the already upgraded nodes to upgrade the
instance itself, nor will it add the node to the list of possible owners when the
upgrade is completed. You will have to do failover and modification of the
possible owners on your own.
1 = Will allow failover to one of the already upgraded nodes to upgrade the
instance itself, and will it add the node to the list of possible owners when
upgrade is completed.
168
Here is the sample syntax for upgrading a named instance using a command file:
D:\>setup.exe /CONFIGURATIONFILE="c:\UpgradeSQL.ini"
During the upgrade, you will see what is going on with the upgrade if the QUIET (or /Q)
and INDICATEPROGRESS actions are used (such as in the examples above). A sample is
shown in Figure 30.
Figure 30: Sample output during the upgrade with a command-line process
A successful end result would look something like Figure 31. A Setup result of 0
generally means that no reboot is required. Any other status often means either an
error (which would be clearly indicated as such) or a possible reboot.
169
Figure 31: Example of a successful command prompt upgrade not needing a reboot
Figure 32 shows a status other than 0. A 3010 means a reboot is required.
170
171
Because database mirroring will not be removed as a feature immediately, you can still
continue to use it for now. Over time, you should look at migrating any database using
database mirroring to a feature that will be supported. Your two choices will be log
shipping and the new AlwaysOn availability groups feature. Depending on what edition
of SQL Server 2012 (or later) you deploy will determine what you will be able to use.
Tip: When planning a migration strategy, an excellent resource is Migration Guide:
Migrating to SQL Server 2012 Failover Clustering and Availability Groups from Prior
Clustering and Mirroring Deployments
(http://sqlcat.com/sqlcat/b/whitepapers/archive/2012/04/04/migration-guidemigrating-to-sql-server-2012-failover-clustering-and-availability-groups-fromprior-clustering-and-mirroring-deployments.aspx).
In-Place Upgrade
There are two main configurations for database mirroring: high-performance
(asynchronous) and high-safety (synchronous). High-safety can also be configured with
an optional witness to allow automatic failover. The steps for both are similar and will
be combined in this section. Any differences will be explicitly pointed out.
1. If database mirroring is configured in high-performance mode, it must be
changed to high-safety without a witness. The main reason for this is that it will
ensure all transactions are committed so there will be no data loss. If you require
high-performance mode, you can reconfigure it after the upgrade. To change
the mode from high-performance to high-safety in SSMS, right-click the
database in Object Explorer, select Tasks, and then select Mirror. In the Mirroring
page of the Database Properties dialog box, choose the mode. Alternatively, you
can use the T-SQL command:
ALTER DATABASE database SET PARTNER SAFETY FULL
172
Figure 34: Synchronized mirroring session displayed in SSMS and the Database
Mirroring Monitor
4. At this point, you can technically upgrade the principal but first ensure all traffic
is stopped to the database so nothing will connect to it.
5. Use SSMS or T-SQL to manually fail over the mirroring session to the instance
that was upgraded. To do this in SSMS, click the Failover button in the Mirroring
page of the Database Properties dialog box for the database mentioned earlier.
To do this in T-SQL, use the following command:
ALTER DATABASE database SET PARTNER FAILOVER
At this point, the mirroring session will be suspended as shown in Figure 35.
Synchronizing logins and ensuring that all jobs and objects residing
outside the database are restored via scripts to make the mirror usable
173
Running health checks (e.g., DBCC CHECKDB) to ensure the health of the
newly upgraded database
Optionally, you could wait until the old primary is upgraded and then fail back.
That may be advantageous since you will be able to test the failover to ensure
things are working post-upgrade, but you may not be able to tolerate the longer
outage.
Assuming the newly upgraded database will be the new principal, ensure that
the application testing is complete and then redirect all users and applications to
the upgraded instance containing the new principal (the old mirror). This will
minimize an outage because the old principal (the new mirror) will not be
available during its upgrade.
7. Upgrade the instance containing the old principal to SQL Server 2012.
8. While mirroring should automatically start in most cases, you may have to
manually re-establish the suspended mirroring session. To do this, click the
Resume button in the Mirroring page of the Database Properties dialog box, as
shown in Figure 36.
174
The databases will now start synchronizing the unsent log. Once synchronized,
you will see a display similar to the one shown in Figure 37.
Figure 37: Upgrade with role reversal complete for a database mirroring
configuration
9. If you have not started to use the old mirror (now principal) as the primary, test
failover by failing back to the now upgraded original primary. If you want that to
be the primary again, unless you have made changes, you hopefully will not
have to do anything detailed in Step 6.
10. If necessary, change the mode from high-safety back to high-performance using
SSMS or T-SQL. The T-SQL command to use is:
ALTER DATABASE <database> SET PARTNER SAFETY OFF
11. If necessary, add the witness back to the high-safety configuration. Follow the
instructions in the SQL Server 2012 Books Online topic Add or Replace a
Database Mirroring Witness (SQL Server Management Studio)
(http://msdn.microsoft.com/en-us/library/ms365603.aspx).
175
Synchronizing logins and ensuring that all jobs and objects residing
outside the database are restored via scripts to make the mirror usable
Running health checks (e.g., DBCC CHECKDB) to ensure the health of the
newly upgraded database
8. Configure database mirroring from the principal to the mirror. See the SQL
Server 2012 Books Online topic Setting Up Database Mirroring (SQL Server)
(http://msdn.microsoft.com/en-us/library/ms190941.aspx).
9. Test the failover from the principal to the mirror and from the mirror back to the
principal.
10. Redirect all users and applications to the new SQL Server 2012 instance
containing the principal.
176
177
One thing that may tip the balance toward a role change is that even though there will
be a clear cutover point, leaving the original primary at the older version gives you a
fallback plan in the event something goes wrong. The data will remain at the point of
the switch. Should you need to go back to the previous version of SQL Server, you
would need to devise a way to get any changes made to the data in the SQL Server
2012 database.
If you do not perform a role change, the secondary (or secondaries) will remain in a
loading state. A database upgrade is a logged operation, so once the primary database
is upgraded and the transaction logs are being copied and restored, the secondary will
be upgraded as well. Upgrading without a role change allows you to maximize your
uptime on the primary, but you will have downtime since the primary will be
completely unavailable during its upgrade to SQL Server 2012. Having said that, a
benefit of not having a role change is that the log shipping configuration will remain
intact after the upgrade.
178
Manually copy over and restore all transaction log backups generated.
Use the WITH NORECOVERY option.
Re-enable the copy and restore jobs and monitor their progress until
things are caught up. Enabling the jobs is demonstrated in Figure 39. An
example of the copies and restores resuming successfully is shown in
Figure 40. This is the only scenario where a mixed version log shipping
configuration is supported.
179
180
12. Verify that the database compatibility level of the upgraded databases is 110.
13. Direct all users and applications to the original primary database.
Manually copy over and restore all transaction log backups generated
during the secondary upgrade. Use the WITH NORECOVERY option.
Re-enable the copy and restore jobs and monitor their progress until
things are caught up, as shown earlier in Figures 39 and 40. You can also
manually start them.
7. On the current primary database, manually make a final transaction log backup
(also known as the tail of the log) using the WITH NORECOVERY option. This will
put the database in the RESTORING state. If this instance will not be the primary
again, do not use the WITH NORECOVERY clause of the BACKUP LOG command;
leave the database online. However, by using WITH NORECOVERY, this instance
SQL Server 2012 Upgrade Technical Guide
181
Figure 41: Backing up the tail of the log and putting the original primary in a
loading state
8. Copy and restore the tail of the log using WITH RECOVERY. As part of the
restore, it will be upgraded to SQL Server 2012, as shown in Figure 42.
Figure 42: Upgraded secondary that is no longer in a loading state and now
usable
11. You must get the new production server fully ready for use. That entails tasks
such as:
Synchronizing logins and ensuring that all jobs and objects residing
outside the database are restored via scripts to make the mirror usable
SQL Server 2012 Upgrade Technical Guide
182
Running health checks (e.g., DBCC CHECKDB) to ensure the health of the
newly upgraded database
12. Delete the old copy and restore jobs on the former secondary database as
shown in Figure 43.
183
Synchronizing logins and ensuring that all jobs and objects residing
outside the database are restored via scripts to make the mirror usable
Running health checks (e.g., DBCC CHECKDB) to ensure the health of the
newly upgraded database
184
9. Configure log shipping between the SQL Server 2012 instances using the
instructions found in the SQL Server 2012 Books Online topic Configure Log
Shipping (SQL Server) (http://msdn.microsoft.com/en-us/library/ms190640.aspx).
10. Redirect all users and applications to the new SQL Server 2012 instance
containing the new log shipping primary.
New Hardware for the Primary Only
This option assumes that only the instance for the primary will be brand new and the
secondary will be reused and upgraded to SQL Server 2012.
1. Install the new SQL Server 2012 instance that will be used for the primary.
2. Take a full backup of the original primary database and restore it to the new SQL
Server 2012 instance using the WITH NORECOVERY option.
3. When you are ready for the upgrade, stop all traffic and kill all connections to
the instance containing the primary. This will ensure that the data cannot be
updated during the upgrade.
4. If transaction logs were made after the full backup was taken, copy and restore
them WITH NORECOVERY on the SQL Server 2012 instance. Use the WITH
NORECOVERY option. Also ensure that the secondary is caught up with its
transaction log restores.
5. Back up the tail of the log on the primary.
6. Copy the tail log backup to the new primary and restore using the WITH
RECOVERY option.
7. You must get the new production server fully ready for use. That entails tasks
such as:
Synchronizing logins and ensuring that all jobs and objects residing
outside the database are restored via scripts to make the mirror usable
Running health checks (e.g., DBCC CHECKDB) to ensure the health of the
newly upgraded database
185
10. Configure log shipping between the SQL Server 2012 instances using the
instructions found in the SQL Server 2012 Books Online topic Configure Log
Shipping (SQL Server) (http://msdn.microsoft.com/en-us/library/ms190640.aspx).
11. Redirect all users and applications to the new SQL Server 2012 instance
containing the principal.
186
When you are mixing versions of SQL Server and SQL Server 2012 is part of the
replication topology, you must follow these rules:
The Distributor must be running the same version as the Publisher or a later
version.
The Publisher must be running the same version as the Distributor or an earlier
version.
These rules influence the order in which the instances can be upgraded and where you
will incur any potential outages. The key is the Distributor. With a single Distributor,
there will be the least downtime. If there are multiple Distributors, you will need to
coordinate to have the least impact on end users and applications.
The Distributor is the key to how much downtime will be encountered during the
upgrade. If there are multiple Distributors in the topology, there will be multiple
outages. Where possible (assuming the hardware is not out of date), performing an inplace upgrade is recommended over installing a new instance of SQL Server and
reconfiguring the Distributor. When upgrading in an environment that has multiple
Distributors, upgrade them in order of magnitude. Do not upgrade the biggest and
most important Distributor first. Schedule the upgrades to have the least impact on the
end users and applications.
Tip: Always upgrade the Distributors first because they can push changes from a
Publisher to a Subscriber, provided that two conditions are met:
The Publisher and Subscriber are down level from the SQL Server 2012
Distributor.
187
In-Place Upgrade
Performing an in-place upgrade to any instance that may be participating in replication
may make sense if your hardware and underlying operating system will continue to be
supported for a SQL Server 2012 deployment. This section will cover how to perform
such an upgrade of a replication topology pointing out specific things for different
replication types where applicable.
A nice feature of any replication upgrade is that you do not need to upgrade every
component at once. As long as you stick to the rules of replication and upgrade the
components in the right order, you can upgrade over time.
1. As components are being upgraded, verify that you will have a valid topology. If
not, you may need to adjust the plans. For example, if you upgrade the
Distributor but you have SQL Server 2000 Subscribers, you may need to wait to
upgrade or get them to SQL Server 2005 so that they are at the minimum
supported level for replication. (For information about the minimum supported
levels, see the Planning an Upgrade with Replication section earlier in this
chapter.)
SQL Server 2012 Upgrade Technical Guide
188
2. Generate scripts for the entire existing replication topology and store them in a
safe place. For documentation on how to do this, see the SQL Server 2012 Books
Online topic Generate SQL Script (Replication Objects)
(http://msdn.microsoft.com/en-us/library/ms188503.aspx). In a worst case
scenario, these scripts will enable you to reconfigure replication in the exact
configuration it is now.
3. Stop all application and data traffic to the Publisher that will be affected during
the upgrade.
4. Ensure that all existing transactions marked for publication have been moved to
the Subscribers. If using transactional replication, run sp_repltrans on the
Publisher to get the outstanding transactions marked for publication. If there are
transactions still pending, it will look like Figure 44. Once the result set is empty,
the upgrade can begin. Check over the span of a few minutes just to be safe.
There are other places you can look to see the status of replication, such as in
Replication Monitor. Figure 45 shows that nothing is available for replicating in
Replication Monitor, whereas Figure 46 shows that there has been some recent
replication activity. Each form of replication at the Publisher can show you
whether things are moving or not. In SSMS, expand Replication then Local
Publications. For each publication, right-click and then select one of the status
options. A sample is shown in Figure 47 and its output is shown in Figure 48.
189
Figure 46: Replication Monitor showing that recent replication activity has
occurred, so transactions may still be in the pipeline
190
5. Before any major components are upgraded (the first of which will be the
instance containing the Distributor), disable any SQL Server Agent jobs related
to replication, including any push subscriptions at the various Publishers using
the Distributor that will be upgraded and pull subscriptions at the Subscriber.
This will ensure that no data propagation will occur during the upgrade process.
6. Upgrade the instance containing the Distributor to SQL Server 2012.
7. At this point, assuming the Publisher and Subscribers are valid for a SQL Server
2012-based topology and you do not want to upgrade those yet, you can stop
for now. If this is the case:
a. Ensure that SQL Server Agent is started on the Distributor.
b. Enable all of the replication jobs.
c. Verify that replication is now working again.
8. When you are ready to start upgrading again, the next component to upgrade
would be the Publisher (assuming each Subscriber's version of SQL Server is
compatible with SQL Server 2012 replication). To upgrade the Publisher:
a. If not done already, stop all traffic and end any connections to the
Publisher.
b. Following the instructions in Step 4, verify that all transactions have been
replicated.
c. If necessary, disable all replication SQL Server Agent jobs if this is being
done at a later time than the Distributor upgrade.
d. Upgrade the Publisher to SQL Server 2012.
e. Ensure that SQL Server Agent is started.
f. It is recommended that you run all the necessary health checks, including
DBCC CHECKDB, at this point to ensure the well-being of the newly
upgraded databases.
g. Set the database compatibility level of the upgraded databases to 110.
h. If the Subscriber will not be upgraded at this time, enable all the SQL
Server Agent jobs related to the Publisher and Distributor.
9. Upgrade the Subscriber(s). If there are multiple Subscribers, consider doing a
phased upgrade (i.e., upgrade selected subscribers in different outages) to
minimize the impact to end users. To upgrade a Subscriber, follow these steps:
SQL Server 2012 Upgrade Technical Guide
191
a. If not done already, disable any push or pull job associated with the
Subscribers subscriptions. You do not need to stop all traffic or kill the
connections to the Publisher during an upgrade of the Subscriber. This
will ensure that the Subscriber cannot be updated during the upgrade
process. However, be aware that the Publisher will not be able to flush
transactions until the Subscriber is back online. It may also affect the
Publisher's ability to back up the transaction log.
b. Upgrade the instance containing the Subscriber to SQL Server 2012.
c. Run DBCC CHECKDB against all upgraded databases.
d. Set the database compatibility level of the upgraded databases to 110.
e. Ensure that SQL Server Agent is started.
f. After the Subscriber is upgraded, enable all the SQL Server Agent jobs for
the subscription and enable all SQL Server Agent jobs on the Distributor
(if they were somehow disabled).
g. Verify that the replication is working properly and now sending what it
needs to (e.g., a transaction in transactional replication). The easiest way
to do this is to manually kick off the SQL Server Agent jobs involved in
snapshot replication and view the status using some of the methods
shown earlier in Step 4. They should reflect a successful execution.
10. Generate new scripts for the upgraded replication architecture.
192
2. Generate scripts for the entire existing replication topology and store them in a
safe place. For documentation on how to do this, see the SQL Server 2012 Books
Online topic Generate SQL Script (Replication Objects)
(http://msdn.microsoft.com/en-us/library/ms188503.aspx). In a worst case
scenario, these scripts will enable you to reconfigure replication in the exact
configuration it is now.
3. Install and configure the hardware and SQL Server 2012 instance(s) that will
participate in the replication topology.
4. Update the scripts generated in Step 2 to SQL Server 2012 and make sure that
the instance names and databases are updated to reflect their new locations.
Before updating the scripts, make copies of the originals so that the old
environment can be restored if necessary.
5. At the minimum, ensure that the existing Publisher is at a version that can
participate in the replication topology when SQL Server 2012 is added since the
Distributor must be running SQL Server 2012.
6. Stop all application and data traffic to the Publisher that will be affected during
the upgrade to ensure that the data will not be updated during the cutover.
7. Run the appropriate upgraded replication script on the new Distributor to create
the publication and distribution with your settings. At this point, the old
replication topology is still being used and you have not incurred any downtime.
8. If the Distributor is the only component being upgraded, to do the cutover, stop
all traffic and kill any connections to the Publisher to ensure that no one tries to
access it during the switch.
9. To point existing Publishers and Subscribers to the new Distributor, you must
drop the publications and subscriptions, and then recreate them pointing to the
new Distributor. If this completes successfully, replication works, and you will not
be upgrading any other components, your upgrade is complete.
10. If you are also moving the Publisher to a new SQL Server 2012 instance:
a. Drop the existing publication(s) and subscription(s).
b. Re-create the publication on the new Publisher and point it to the SQL
Server 2012 Distributor.
c. Recreate the subscription pointing to the new publication.
d. Verify that replication is working.
SQL Server 2012 Upgrade Technical Guide
193
11. If you are also moving the Subscriber(s) to a new SQL Server 2012 instance:
a. To point at the new Distributor, you should have already dropped the
subscription. If not, do so now.
b. Re-create the subscription on the new Subscriber.
c. Re-create the subscription pointing to the new publication.
d. Verify that replication is working.
12. Configure administration such as backup jobs for the databases.
13. Generate new scripts for the upgraded replication architecture.
14. To ensure that no one will connect to the old environment, it is recommended
that you stop the services if possible on the original topology after it has been
migrated to the new instance.
Conclusion
While it is not possible to completely avoid downtime during certain points of an
upgrade to SQL Server 2012, minimizing downtime is achievable by following the
advice presented in this chapter. Preparation and testing are the ultimate defense
against failures and extended outages. Each high availability feature currently
configured on your existing instance will have different considerations and steps that
you will need to account for in your overall upgrade plan.
194
Additional References
For an up-to-date collection of additional SQL Server 2012 high-availability references,
see Upgrade to SQL Server 2012 (http://technet.microsoft.com/enus/library/bb677622.aspx).
Also see the following links:
195
Affects the
Security Features
Benefit
When Available
Upgrade Process
BUILTIN\administrators and
Immediately after
No for in-place
time
upgrade
upgrade;
AUTHORITY\SYSTEM) not
automatically provisioned
upgrade
196
Affects the
Security Features
Benefit
When Available
Upgrade Process
Immediately after
No
in-depth defense on
upgrade
Easier long-term
Immediately after
management of service
upgrade
installed on Windows 7 or
and SPNs
No
Easier permission
Immediately after
management
upgrade
Consistency between
Immediately after
upgrade
Minimal work to
enhancements
other enhancements
leverage
Minimal work to
leverage
Access to databases
Design and
permitted through
architect
No
No
No
No
No
As you can see from this table, the new security features that might affect your upgrade
are very limited. All the other features are enhancements that you can take advantage
of after your upgrade, but they will not block or impede the upgrade process.
197
You use the new Policy-Based Management capability in SQL Server 2012 to help set
Database Engine, Analysis Services, and Reporting Services configurations. You can
import the best practice policies that SQL Server 2012 provides to evaluate the
configurations for your instances, instance objects, databases, and database objects.
Note: You can also use sp_configure to set Database Engine features.
198
Manager is not supported. For more information, see SQL Server Configuration
Manager (http://msdn.microsoft.com/en-us/library/ms174212(v=SQL.110).aspx) in SQL
Server 2012 Books Online.
Some of these services might be optional for your instance. You can enable and disable
these services, depending on the functionality your SQL Server instance requires, by
using SQL Server Configuration Manager. You should review these new service
accounts and their security requirements before attempting an upgrade to SQL Server
2012. Use the principle that if a service is not needed, it should be disabled. You can
also enable and disable remote connections for many of the services.
For details about service accounts and services, see Configure Windows Service
Accounts and Permissions (http://msdn.microsoft.com/enus/library/ms143504(v=sql.110).aspx) in SQL Server 2012 Books Online.
199
In case of an upgrade from SQL Server 2005, SQL Server Setup will change the
permissions to use per-service SIDs for the database engine and its file folders and
registry keys. The local Windows groups are preserved but renamed.
In both cases, all permissions are preserved and no special actions are needed for a
successful upgrade.
As a best practice, use Managed Service Accounts or Virtual Accounts if possible and
grant as few additional privileges as possible. In cases where it is not possible to use a
Managed Service Account or Virtual Account, use a separate low-privilege user account
or domain account for each service and dont give additional privileges directly to it.
Instead apply privileges on security groups or per-service SIDs accordingly. For more
information, see Configure Windows Service Accounts and Permissions
(http://msdn.microsoft.com/en-us/library/ms143504(v=SQL.110).aspx) in SQL Server
2012 Books Online.
Configuring Features
Through the new Policy-Based Management capability introduced in SQL Server 2008,
you can enable or disable many Database Engine features as well as options for the
Analysis Services and Reporting Services components. You can also set options for the
Database Engine by using the sp_configure stored procedure.
All these options are off by default with a new installation, although the Windows Data
Access Components (DAC) on clusters will have remote use enabled by default. The
purpose of having these options off by default is to reduce the potential attack surface
of a new installation. You can selectively enable these options as required for your SQL
Server 2012 instance.
With an in-place upgrade, all feature configurations stay in their pre-upgrade state. But
you can use Policy-Based Management to disable features that you are not using
anymore and reduce the attack surface of the upgraded instance.
Here are the Database Engine configuration features that you can set through the
Surface Area Configuration facet of Policy-Based Management:
Database Mail
SQL Server 2012 Upgrade Technical Guide
200
OLE automation
Service Broker
xp_cmdshell
You can find out-of-the-box security best practices policies, including Surface Area
Configuration, in the SQL Server 2012 installation path in the
\110\Tools\Policies\DatabaseEngine\1033 folder. For more information about PolicyBased Management, see Administer Servers by Using Policy-Based Management
(http://msdn.microsoft.com/en-us/library/bb510667(v=SQL.110).aspx).
A new option to fail an operation that would otherwise generate an audit event
to be written to a failed audit target
SQL Server 2012 Upgrade Technical Guide
201
A new option to cap the number of audit files without rolling over
The ability to filter audit events before they are written to the audit log
Preparing to Upgrade
After you become familiar with the new features you need to prepare for in your
upgrade plan and process, you need to understand which features have been
deprecated or discontinued in SQL Server 2012 and review the changes that could
block your upgrade or change the behavior of your applications after the upgrade.
Deprecated Features
Some security-related features are deprecated in SQL Server 2012. Although they will
continue to operate in SQL Server 2012, they will be removed in a future version of SQL
Server. These deprecated features have no immediate effect on your upgrade to SQL
Server 2012, but they will affect your upgrade to a later version. For comprehensive
information about these features, see Deprecated Database Engine Features in SQL
Server 2012 (http://msdn.microsoft.com/en-us/library/ms143729(v=SQL.110).aspx) in
SQL Server 2012 Books Online.
The deprecated security features consist primarily of system stored procedures that
have been replaced by Transact-SQL (T-SQL) commands. For example, sp_adduser and
sp_dropuser are replaced by CREATE USER and DROP USER, respectively, and SETUSER
is replaced by EXECUTE AS. These procedures are deprecated because they do not
work with user/schema separation. As soon as you take advantage of new security
commands such as CREATE USER and CREATE SCHEMA, you should also switch from
using compatibility views such as sysobjects to catalog views such as sys.objects.
Table 2 lists the deprecated security features in SQL Server 2012 and their
replacements.
Table 2: Deprecated Security Features
Deprecated Feature
Replacement
sp_addapprole
sp_dropapprole
202
Deprecated Feature
Replacement
sp_addlogin
CREATE LOGIN
sp_droplogin
DROP LOGIN
sp_adduser
CREATE USER
sp_dropuser
DROP USER
sp_addrolemember
ALTER ROLE
sp_droprolemember
sp_addsrvrolemember
sp_dropsrvrolemember
sp_grantdbaccess
CREATE USER
sp_revokedbaccess
DROP USER
sp_addrole
CREATE ROLE
sp_droprole
DROP ROLE
sp_approlepassword
sp_password
ALTER LOGIN
sp_changeobjectowner
ALTER SCHEMA
ALTER AUTHORIZATION
sp_defaultdb
ALTER LOGIN
sp_defaultlanguage
sp_denylogin
sp_grantlogin
CREATE LOGIN
sp_revokelogin
DROP LOGIN
USER_ID
DATABASE_PRINCIPAL_ID
xp_grantlogin
CREATE LOGIN
xp_revokelogin
DROP LOGIN
xp_loginConfig
SERVERPROPERTY('IsIntegratedSecurityOnly')
sp_change_users_login
ALTER USER
sp_srvrolepermission
sp_dbfixedrolepermission
sp_addremotelogin
sp_addserver
sp_dropremotelogin
sp_helpremotelogin
sp_remoteoption
@@remserver
is deprecated
DESX encryption algorithms
GRANT ALL
DENY ALL
REVOKE ALL
PERMISSIONS intrinsic function
sys.fn_my_permissions
SETUSER
EXECUTE AS
203
Deprecated Feature
Replacement
CREDENTIAL
c2 audit option and default trace
Use SQL Audit for auditing and Extended Event for other
purposes.
To fully understand these security upgrade issues, make sure you review SQL Server
Database Engine Backward Compatibility (http://msdn.microsoft.com/enus/library/ms143532(v=SQL.110).aspx) in SQL Server 2012 Books Online.
Discontinued Features
A number of security features are discontinued in SQL Server 2012, and you need to
adjust your applications accordingly or they will not work properly. You can address
many of these issues before the upgrade process, but they will not block an upgrade.
Table 3 lists the security-related features that are discontinued in SQL Server 2012.
Table 3: Discontinued Security-Related Features
Discontinued Feature
Explanation/Replacement
Remote server
sp_dropalias
None
204
Breaking Changes
Table 4 lists the security-related breaking changes in the database engine. As you can
see the list is quite small, but you should check if they apply to the system that you are
about to upgrade and fix them in advance.
Table 4: Security-Related Breaking Changes
Blocking Issue
Solution
sp_setapprole,
sp_unsetapprole, and
EXECUTE AS
sys.fn_get_audit_file
Behavior Changes
There are no security-related behavior changes in SQL Server 2012. For comprehensive
information about other changes, see Behavior Changes to Database Engine Features
in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms143359(v=SQL.110).aspx) in SQL Server 2012 Books Online.
Note: If you are upgrading from SQL Server 2005, there might be behavior changes
in SQL Server 2008 and SQL Server 2008 R2 that could affect your upgrade process.
SQL Server 2012 Upgrade Technical Guide
205
For a full list, see Behavior Changes to Database Engine Features in SQL Server 2008
R2 (http://msdn.microsoft.com/en-us/library/ms143179(v=SQL.105).aspx) in SQL
Server 2008 R2 Books Online.
Use of xp_cmdshell
Required auditing
Since SQL Server 2008, SQL Server has enhanced SQL Server login passwords.
DBAs creating and maintaining SQL Server logins now have the ability to apply
the local Windows password policy to their SQL Server logins. If possible, you
should plan to incorporate stronger passwords and Windows-level password
policies in your SQL Server logins.
In addition, you should review applications and scripts that create new SQL
Server logins to determine whether the logic of those applications and scripts
needs to be modified to account for the new password security enhancements.
2. Back up databases. No matter what upgrade method you use, you must make
an initial backup of your databases from the server you plan to upgrade. You
should also verify the backup file or tape. Like you do for other backups, apply
the same security considerations to the backup you take before upgrading:
Apply a password to the backup, and store the backup media securely. If you
need to transport the media to a secure location, ensure that your method of
transfer is also secure and trusted.
SQL Server 2012 Upgrade Technical Guide
206
3. Review and resolve issues identified by SQL Server 2012 Upgrade Advisor. Be
sure to run Upgrade Advisor, address all blocking issues, and find solutions for
all other issues. Many of the issues might be security-related. You can find some
of these security-related issues listed in "Other Database Engine Upgrade Issues"
in the Upgrade Advisor Help topic. Chapter 1, "Upgrade Planning and
Deployment," covers using Upgrade Advisor as well as the Best Practices
Analyzer for SQL Server.
4. Choose an authentication mode. Whenever possible, use Windows
Authentication for user and application connections to SQL Server. This might
not be possible for third-party applications, but for users and middle-tier
servers, it just makes sense. Why not let Windows manage the passwords and
password aging rather than SQL Server?
5. Determine service account security. Determine the service accounts used for
your SQL Server 2012 installation. As mentioned earlier in the "Service Account
Security" section, you do not need to grant local administrator rights to SQL
Server 2012 service accounts. Before you upgrade, you need to determine the
rights those accounts will have or let SQL Server Setup do that for you.
6. Choose an upgrade method. Make sure that the upgrade method you choose
will not compromise your security. For example, you might determine that some
data is so sensitive that you do not want it to leave the server, but you also do
not want to perform an in-place upgrade. If you have enough resources on the
server, you could perform a side-by-side upgrade on the same server. For other
security considerations for an in-place or side-by-side upgrade, see the "In-Place
Upgrade" and "Side-by-Side Upgrade" sections later in this chapter.
7. Create, document, and test the upgrade plan. Good planning is the best method
for preventing errors. Not only should you document your upgrade plan, you
should also test the upgrade steps in a test environment. If you must use
production data, ensure that the test environment is at least as secure as the
production environment. For details about planning for an upgrade, see Chapter
1, "Upgrade Planning and Deployment."
In-Place Upgrade
In SQL Server 2012, services and configuration settings are off by default unless
SQL Server 2012 Upgrade Technical Guide
207
required. During an in-place upgrade, the SQL Server 2012 Setup program will maintain
the SQL Server 2012 services until the upgrade is finished. Therefore, you are assured
that the upgrade process will not fail for those reasons.
Because an in-place upgrade occurs on the same database server, replacing the legacy
SQL Server instances with the new instances, your data remains as secure as the server.
There might be a brief time when the legacy SQL Server service has stopped before the
SQL Server 2012 Setup program can start the new SQL Server 2012 instance, and for
that duration, your data files are not being exclusively used by a SQL Server service.
Ensure that your database server's files are secured from outside users attempting to
access those files during the upgrade process.
Side-by-Side Upgrade
During a side-by-side upgrade, you install a new instance of SQL Server 2012 on a new
server or alongside the legacy instance on your current server. In this case, you should
ensure that services and configuration options are set in such a way as to guarantee
your successful upgrade. For example, the following features are off by default in a new
SQL Server 2012 installation to help reduce the attack surface of your new installation:
ad hoc distributed queries, OLE automation, and xp_cmdshell. If your new installation
requires any of these, you need to enable them by using Policy-Based Management
features or sp_configure.
When you move your data from the old instance to the new one, you must choose a
transfer method such as backup/restore, detach/attach, BCP, Data Transformation
Services (DTS), or Copy Database Wizard. In the case of the first two methods, you will
be copying files over some distance, so you must ensure the security of the copy
process and the media used in the copy.
If you use the Copy Database Wizard, be aware that your SQL Server logins must be a
member of the sysadmin fixed server role on both the source legacy SQL Server
instance and on the SQL Server 2012 destination instance. For more information about
using this wizard, see Use the Copy Database Wizard (http://msdn.microsoft.com/enus/library/ms188664(v=SQL.110).aspx) in SQL Server 2012 Books Online.
Note: If you are using a side-by-side upgrade method, you need to configure the
SQL Server 2012 services to match the needs of your SQL Server installation. In an
in-place upgrade, SQL Server 2012 Setup will preserve the services settings of the
SQL Server instance you are upgrading, except for the new service for full-text
search if you are upgrading from SQL Server 2005. Even for an in-place upgrade, the
SQL Server 2012 Upgrade Technical Guide
208
service setting for SQL Server 2005 full-text will not be preserved.
209
run your standard utilities for assessing SQL Server security, such as the
Microsoft Baseline Security Analyzer (http://technet.microsoft.com/enus/security/cc184924.aspx).
You might find that a combination of manual and automated testing will give you
the most confidence in the security level of your upgraded SQL Server 2012 system.
Conclusion
SQL Server 2012 delivers stronger security and new tools for easier security
management. With attention to the new, changed, and discontinued security features
we looked at in this chapter, you will be on your way to a smooth transition from SQL
Server 2005, SQL Server 2008, or SQL Server 2008 R2 to SQL Server 2012 Just be sure to
plan well for the upgrade, make sure you have a secure backup strategy, and test
extensively before and after the upgrade to make sure your system is protected and
able to take full advantage of the new security capabilities.
Additional References
For an up-to-date collection of additional references for upgrading database security,
see the following links:
210
Preparing to Upgrade
You can upgrade a relational database that is enabled for full-text search by
performing either an in-place upgrade of the Database Engine and all its databases or
by performing a side-by-side database upgrade. With a side-by-side upgrade, you use
either the backup/restore method or the detach/attach method, which we cover later in
this chapter. For information about choosing between an in-place relational database
upgrade and one of the side-by-side relational database upgrade methods, see
Chapter 1, "Upgrade Planning and Deployment."
Regardless of whether you choose an in-place upgrade or a side-by-side upgrade of a
full-text-enabled relational database, there are a range of potential issues that you
might face. Here are the most important full-text search upgrade issues as you move
from SQL Server 2008 or SQL Server 2008 R2 to SQL Server 2012.
For a complete list of deprecated features, discontinued functionality, breaking
changes, and behavior changes to full-text search in SQL Server 2012, see Full-Text
SQL Server 2012 Upgrade Technical Guide
211
Deprecated Features
Although there are no full-text search features that will be discontinued in the next
release of SQL Server, there are some features that will be removed in a later version.
Remember that you can use traces or the new System Monitor object
SQLServer:Deprecated Features to check which deprecated features you are using in
your applications. For more information, see SQL Server, Deprecated Features Object
(http://msdn.microsoft.com/en-us/library/bb510662(v=sql.110).aspx) in SQL Server
2012 Books Online.
The most relevant deprecated features are as follows:
For a completed list of deprecated full-text search features, see Deprecated Full-Text
Search Features in SQL Server 2012 (http://msdn.microsoft.com/enus/library/cc646010(v=sql.110).aspx) in SQL Server 2012 Books Online.
Breaking Changes
There is a change in the language of the name column in the catalog view
sys.fulltext_languages. It will now have the collation of the SQL Server instance. With
this change, it will be possible to join the sys.syslanguages view with the
sys.fulltext_languages view. For more information about breaking changes, see
Breaking Changes to Full-Text Search (http://msdn.microsoft.com/enus/library/ms143709(v=sql.110).aspx) in SQL Server 2012 Books Online.
Behavior Changes
There are several behavior changes that might require corrective action after the
upgrade is completed. Table 1 lists the most important of these changes.
212
Description
some languages.
For more information about the behavior changes to full-text search, see Behavior
Changes to Full-Text Search (http://msdn.microsoft.com/enus/library/ms143272(v=sql.110).aspx) in SQL Server 2012 Books Online.
213
If a failed in-place upgrade occurs, frequently the easiest resolution is to reinstall SQL
Server 2008/2008 R2 and restore the installation to its state before the upgrade process
began. To make sure that all the data and configuration files needed to restore the
existing installation are available, complete the steps outlined in Chapter 3, "Relational
Databases," in addition to the following steps before the upgrade process starts:
Use System Configuration Checker (SCC) to scan the server for any conditions
that might prevent a successful installation of SQL Server 2012. For more
information, see Check Parameters for the System Configuration Checker
(http://msdn.microsoft.com/en-us/library/ms143753(v=sql.110).aspx) in SQL
Server 2012 Books Online.
Review security best practices and guidance for SQL Server. For more
information, see Security Considerations for a SQL Server Installation
(http://msdn.microsoft.com/en-us/library/ms144228(v=sql.110).aspx) in SQL
Server 2012 Books Online.
Run Upgrade Advisor on the server to determine any issues that might prevent
you from successfully upgrading. For more information, see Use Upgrade
Advisor to Prepare for Upgrades (http://msdn.microsoft.com/enus/library/ms144256(v=sql.110).aspx) in SQL Server 2012 Books Online.
Make sure that the filegroup associated with the base table of a full-text index
has sufficient space to accommodate the additional space that is required by
SQL Server 2012 full-text indexes.
In-Place Upgrade
For an in-place upgrade, an instance of SQL Server 2012 is set up side-by-side with the
old version of SQL Server 2008/2008 R2, and data is moved to the new version. If the
old version of SQL Server had full-text search installed, a new version of full-text search
is automatically installed.
SQL Server 2012 Upgrade Technical Guide
214
Side-by-side install means that the following components exist at the instance-level of
SQL Server:
Word breakers, stemmers, and filters. Each instance now uses its own set of
word breakers, stemmers, and filters instead of relying on the operating system
version of these components. These components are also easier to register and
configure at a per-instance level. For more information, see Configure and
Manage Word Breakers and Stemmers for Search
(http://msdn.microsoft.com/en-us/library/ms142509(v=sql.110).aspx) and
Configure and Manage Filters for Search (http://msdn.microsoft.com/enus/library/ms142499(v=sql.110).aspx) in SQL Server 2012 Books Online.
Filter daemon host. The full-text filter daemon hosts are processes that safely
load and drive third-party extensible components used for indexing and
queryingsuch as word breakers, stemmers, and filterswithout compromising
the integrity of the Full-Text Engine. A server instance uses a multithreaded
process for all multithreaded filters and a single-threaded process for all singlethreaded filters.
Note: SQL Server 2008 introduced a service account for the FDHOST Launcher
service (MSSQLFDLauncher). This service propagates the service account
information to the filter daemon host processes of a specific instance of SQL Server.
For information about how to set the service account, see Set the Service Account
for the Full-text Filter Daemon Launcher (http://msdn.microsoft.com/enus/library/ms345189(v=sql.110).aspx) in SQL Server 2012 Books Online.
In SQL Server 2005 and earlier versions, each full-text index is located in a full-text
catalog that belongs to a filegroup, has a physical path, and is treated as a database
file. In SQL Server 2012, a full-text catalog is a logical concepta virtual objectthat
refers to a group of full-text indexes. Therefore, a new full-text catalog is not treated as
a database file that has a physical path. However, during an upgrade of any full-text
catalog that contains data files, a new filegroup is created on the same disk. This
maintains the old disk I/O behavior after upgrade. Any full-text index from that catalog
is put in the new filegroup if the root path exists. If the old full-text catalog path is
invalid, the upgrade keeps the full-text index in the same filegroup as the base table or,
for a partitioned table, in the primary filegroup.
In-Place Upgrade of Full-Text Search Databases with Third-Party Filters
By default, the full-text engine will not load components that are not signed by
Microsoft. To perform an in-place upgrade of full-text search databases with thirdSQL Server 2012 Upgrade Technical Guide
215
Side-by-Side Upgrade
For a side-by-side upgrade, an instance of SQL Server 2012 is set up side-by-side with
the old version of SQL Server on the same server or another server, and you move data
to the new version.
Full-Text Upgrade Option
SQL Server 2012 provides an instance option, Full-Text Upgrade, which lets you control
how SQL Server manages full-text indexes in side-by-side upgrade scenarios. This fulltext upgrade option has three possible values:
Import. This is the default option after the setup of a SQL Server 2012 instance
and works only for SQL Server 2005 databases. If this option is enabled, SQL
Server 2012 tries to import the data in the full-text indexes without resetting or
rebuilding them and only copies the data from the old index structures to the
new one. Import is the fastest option for an upgrade. But for a set of specific
new word breakers, Microsoft cannot guarantee that your queries will return the
same results as the SQL Server 2005 version (see the "Semantic Consistency"
section later in this topic). At import time, this option does not use SQL Server
2012s new and improved word breakers and stemmers.
Rebuild. With this option, SQL Server 2012 will rebuild all full-text indexes,
triggering a full population and using the new and improved word breakers. This
option can take significant time and could be very CPU- and memory-intensive,
depending on the number and size of your full-text indexes. This option
guarantees semantic consistency and, in some cases, specific internal
optimizations that can improve overall performance later.
Reset. The Reset option gives you more control over the overall total upgrade
time because no full-text population or rebuilding will occur. When this option is
enabled, SQL Server 2012 deletes the existing full-text catalogs. In addition, fulltext indexes are disabled for change tracking and crawls are not started
automatically. You can change this option by using the sp_fulltext_service stored
SQL Server 2012 Upgrade Technical Guide
216
procedure, as follows:
EXEC master.dbo.sp_fulltext_service @action=N'upgrade_option', @value=1
You can also change this option from SQL Server Management Studio (SSMS)
through the instance properties on the Advanced tab.
Semantic Consistency
When you import your existing full-text indexes into SQL Server 2012, the data in these
indexes is obtained by using the old word breakers and stemmers. But when you query
the new SQL Server 2012 full-text index, the full-text engine will use the new word
breakers so the results of the queries might change. This behavior is known as semantic
consistency.
SQL Server 2012 does not improve all word breakers. The following word breakers have
not changed from the earlier version so semantic inconsistency does not apply to them:
Chinese (Singapore)
Korean
Simplified Chinese
Thai
Traditional Chinese
For more information about semantic consistency, review the "Ensuring Consistent
Query Results after Importing a SQL Server 2005 Full-Text Index" section in Upgrade
Full-Text Search from SQL Server 2005 (http://msdn.microsoft.com/enus/library/ms142490(v=sql.110).aspx) in SQL Server 2012 Books Online.
Considerations for Choosing a Full-Text Upgrade Option
When choosing the appropriate strategy for an upgrade of full-text search, consider
the following questions:
How do you use word breakers? The SQL Server 2012 full-text search service
includes new word breakers and stemmers. These might change the results of
full-text queries from previous releases for a specific text pattern or scenario.
Therefore, how you use word breakers is important when you choose a suitable
upgrade option:
SQL Server 2012 Upgrade Technical Guide
217
o If the word breakers of the full-text language that you use did not change
in SQL Server 2012 or if recall accuracy is not important to you, using the
Import option is suitable. Later, if you experience any recall issues, you
can upgrade to the new word breakers by rebuilding your full-text
catalogs.
o If you care about recall accuracy and you use one of the word breakers
that were improved in SQL Server 2008, the Rebuild option is suitable.
What is the priority for bringing the server instance online? Importing or
rebuilding during upgrade takes a lot of CPU resources, which delays getting the
rest of the server instance upgraded and online. If bringing the server instance
online as soon as possible is important and if you are willing to run a manual
population after the upgrade, the Reset option is suitable.
Backup/Restore Method
The first option for doing a side-by-side upgrade is to perform a restore of a SQL
Server 2005/2008/2008 R2 full-text-enabled database in a SQL Server 2012 instance.
When you restore the database on SQL Server 2012, a new database file will be created
for the full-text catalog. The default name of this file is ftrow_catalog-name.ndf. For
example, if your catalog name is cat1, the default name of the SQL Server 2012
database file would be ftrow_cat1.ndf. If the default name is already being used in the
target directory, the new database file would be named ftrow_catalog-name{GUID}.ndf,
where GUID is the globally unique identifier of the new file.
After the catalogs are imported, sys.database_files and sys.master_files are updated to
remove the catalog entries, and the path column in sys.fulltext_catalogs is set to NULL.
Detach/Attach Method
When you attach a full-text-enabled database to SQL Server 2012, catalog files are
attached from their previous locations together with the other database files. If SQL
SQL Server 2012 Upgrade Technical Guide
218
Server 2012 cannot find a full-text catalog file or if the full-text file was moved during
the attach operation without someone specifying a new location, the behavior depends
on the selected full-text upgrade option. If the full-text upgrade option is Import or
Rebuild, the attached full-text catalog is rebuilt. If the full-text upgrade option is Reset,
the attached full-text catalog is reset.
The state of each attached full-text catalog on SQL Server 2012 is the same as when the
database was detached from SQL Server 2005. If any full-text index population was
suspended by the detach operation, the population is resumed on SQL Server 2012
even if the full-text upgrade option is configured as Import.
Side-by-Side Upgrade with Third-Party Filters
By default, the full-text engine will not load components that are not signed by
Microsoft. If you are performing a side-by-side upgrade of a full-text enabled database
that has third-party filters, perform the following additional steps:
1. Install the third-party filter on the SQL Server 2012 server.
2. Use the sp_fulltext_service stored procedure to set the service property,
load_os_resources, for the third-party filter.
3. Turn off the Verify_signature option.
4. Start the upgrade by using the selected side-by-side upgrade method.
Post-Upgrade Tasks
It is a good practice to check the crawl log right after you upgrade to make sure that
the crawl is running without a problem and that the full-text population is complete.
Here are some post-upgrade tasks related to custom noise words that you might have
to perform.
219
If you never added, modified, or deleted any noise-word files in your installation
of SQL Server 2005, the system stoplist should meet your needs.
If you modified your noise-word files in the previous SQL Server version, those
modifications are lost during upgrade. To re-create those updates, you must
manually re-create those modifications in the corresponding SQL Server 2012
stoplist.
If you do not want to apply any stopwords to your full-text indexes (for example,
if you deleted or erased your noise-word files in the earlier version installation),
you must turn off the stoplist for each upgraded full-text index.
Be aware that SQL Server 2012 does not create stoplists to implement noise-word files
in any upgrade scenario, so you have to create them manually. For more information,
see Configure and Manage Stopwords and Stoplists for Full-Text Search
(http://msdn.microsoft.com/en-us/library/ms142551(v=sql.110).aspx) in SQL Server
2012 Books Online.
Conclusion
Full-text search is now fully integrated in the SQL Server 2012 Database Engine, and
you upgrade full-text indexes by using the same process as for the base database. SQL
Server 2012 also provides a new Full-Text Upgrade option that lets you control how the
full-text engine should work with the indexes. By using this option, you can choose the
best approach for each scenario, maximizing the performance of the upgrade process
in addition to uptime.
Additional References
For an up-to-date collection of additional references for upgrading Full-Text to SQL
Server 2012, see the following links:
220
Feature Changes
The major features for Service Broker in SQL Server 2012 (which were actually
introduced in SQL Server 2008) are as follows:
A diagnostic tool
221
This guide is focused on upgrade. Therefore, exploring these new features is not
discussed here. In the "Post-Upgrade Tasks" section later in this chapter, we discuss
some conversation priority changes you might want to make after your upgrade.
For information about architecting effective SQL Server 2012 Service Broker solutions,
see Planning and Architecture (Service Broker) (http://msdn.microsoft.com/enus/library/bb522900(v=sql.105).aspx) in SQL Server 2008 R2 Books Online. (This
documentation is not reproduced in SQL Server 2012 Books Online due to the small
number of changes in Service Broker in SQL Server 2012.)
Preparing to Upgrade
Because Service Broker is part of the SQL Server Database Engine component, you have
the same upgrade options available: in-place or side-by-side. For more information
about these options, see Chapter 1, "Upgrade Planning and Deployment". We look at
each of these upgrade methods as they relate to Service Broker later in this chapter,
but if you decide to perform an in-place upgrade, consider preparing for the move by
processing all the data in existing queues before the upgrade. You do not have to
process the data in existing queues, but doing so might reduce the resource
requirements during the upgrade.
222
Upgrade Tools
You can use several tools to help you prepare for a successful upgrade. SQL Server
2012 Upgrade Advisor helps you find and fix issues that could prevent an upgrade and
identifies items to modify after your move to SQL Server 2012. And SQL Server Best
Practices Analyzer (BPA) helps ensure that you are using best practices on your current
system so that you have fewer changes to make when you upgrade to SQL Server 2012.
Running Upgrade Advisor
SQL Server 2012 Upgrade Advisor helps you prepare for upgrades to SQL Server 2012.
Upgrade Advisor analyzes installed components from earlier versions of SQL Server,
and then generates a report that identifies issues to fix either before or after you
upgrade. For more information, see Chapter 1, "Upgrade Planning and Deployment".
From the Upgrade Advisor Home screen, you can run the following tools:
The first time you use Upgrade Advisor, run the Upgrade Advisor Analysis Wizard to
analyze SQL Server components. When the wizard finishes its analysis, view the
resulting reports in the Upgrade Advisor Report Viewer. Each report provides links to
information in Upgrade Advisor Help that will help you fix or reduce the effect of the
known issues.
Upgrade Advisor analyzes the following SQL Server components:
Database Engine
Analysis Services
Reporting Services
Integration Services
You can download Upgrade Advisor at Microsoft SQL Server 2012 Feature Pack
(http://www.microsoft.com/download/en/details.aspx?id=29065).
Running Best Practices Analyzer
Before upgrading your system, we recommend that you use best practices for your
existing system by running SQL Server Best Practices Analyzer (BPA). BPA is available
SQL Server 2012 Upgrade Technical Guide
223
for all previous versions of SQL Server. SQL Server 2008 R2 BPA gathers data from
Windows and SQL Server configuration settings, using a predefined list of SQL Server
2008 R2 recommendations and best practices to determine if there are potential issues
in the database environment. Running BPA before upgrading gives you the opportunity
to fix any problems and helps ensure that you are using best practices before you go to
the new system. You can download the SQL Server 2008 R2 BPA
(http://www.microsoft.com/en-us/download/details.aspx?id=15289) from the Microsoft
Download Center.
Once you have upgraded to SQL Server 2012, you can use the SQL Server 2012 Best
Practices Analyzer to further refine your systems. You can download the SQL Server
2012 BPA (http://www.microsoft.com/en-us/download/details.aspx?id=29302) from the
Microsoft Download Center.
64-bit Considerations
Table 1 shows the supported architectures for SQL Server 2012 Service Broker. Please
note that SQL Server 2012 no longer supports the Itanium-based architecture.
Table 1: Architectures Supported in SQL Server 2012 Service Broker
Architecture
Supported
Yes
X64
Yes
IA64
No
In-Place Upgrade
Service Broker operations do not change when a database or an instance of the
Database Engine is upgraded from previous versions of SQL Server to SQL Server 2012.
The Service Broker features available in SQL Server 2005/2008/2008 R2 have the same
behavior in SQL Server 2012.
SQL Server 2005/2008/2008 R2 databases are upgraded to SQL Server 2012 when the
following are true:
They are attached to an instance of the SQL Server 2012 Database Engine after
SQL Server 2012 Upgrade Technical Guide
224
The instance of the Database Engine they are in is upgraded from SQL Server
2005/2008/2008 R2 to SQL Server 2012.
You do not have to process existing data/messages in the queues before the upgrade.
However, doing so might reduce the disk space required for the upgrade, as noted in
the earlier "Preparing to Upgrade" section. You can upgrade servers in any order.
Side-by-Side Upgrade
Routing
Although there are typically no special requirements related to Service Broker in
addition to those required for SQL Server itself, if you are performing a side-by-side
upgrade and have server instance name changes or service name changes, you must
plan to resolve any service routing issues as part of the upgrade. If name changes will
relate to messages or conversations already in progress, you must consider how and
when those messages will be processed. For more information, see Service Broker
Routing and Networking (http://msdn.microsoft.com/enus/library/ms166056(v=sql.105).aspx) in SQL Server 2008 R2 Books Online. (This
documentation is not reproduced in SQL Server 2012 Books Online due to the small
number of changes in Service Broker in SQL Server 2012.)
Object Names and Collation
Service Broker is designed to let services and applications in instances with different
collation configurations communicate easily and efficiently. The database that hosts a
service sending a message might not use the same collation as the database that hosts
the service receiving the message. Therefore, Service Broker uses a consistent collation
for names, regardless of the collation of the database that hosts the service. To remove
collation information from the communication process, Service Broker uses a byte-bybyte comparison to match service names, contract names, and message type names. By
matching names as sequences of bytes, Service Broker makes it simple for services to
exchange messages correctly without the extra overhead of exchanging collation
information.
Therefore, it is important that when you perform an upgrade of Service Broker that
requires objects to be recreated via scripts, you should maintain the exact same object
225
is_broker_enabled
is_honor_broker_priority_on
is_trustworthy_on
You can see these settings for all databases by running the following query:
SELECT * FROM sys.databases
Post-Upgrade Tasks
After the upgrade to SQL Server 2012, consider performing the following Service
Broker-related tasks.
Restoring Settings
You will have to restore the following settings after the upgrade:
is_broker_enabled
is_honor_broker_priority_on
is_trustworthy_on
You can restore the settings by using the ALTER DATABASE command.
Routing Changes
If name changes are part of the upgrade process, you will probably have to change
Service Broker routing configurations after the upgrade.
226
The upgrade process builds the new system objects that are required to support
conversation priorities. It adds conversation priority columns to existing system
tables, views, trace events, and performance counters.
All existing messages in service queues have their priority level set to 10. This
means they will be the first messages retrieved by RECEIVE statements.
You can start to use conversation priorities in an upgraded database by doing the
following:
1. Use the ALTER DATABASE statement to set the HONOR_BROKER_PRIORITY
database option to ON.
2. Use the CREATE BROKER PRIORITY statement to define a set of conversation
priorities in the database.
For more information, see Conversation Priorities (http://msdn.microsoft.com/enus/library/bb934439(v=sql.105).aspx) in SQL Server 2008 R2 Books Online. (This
documentation is not reproduced in SQL Server 2012 Books Online due to the small
number of changes in Service Broker in SQL Server 2012.)
Conclusion
Upgrading SQL Server 2005/2008/2008 R2 Service Broker to SQL Server 2012 Service
Broker can be a straightforward process. But first, you must ensure that sufficient disk
space is available and consider the routing of existing messages or conversations. You
can implement conversation priorities after the upgrade is complete.
SQL Server 2012 Upgrade Technical Guide
227
Additional References
For an up-to-date collection of additional references for upgrading Service Broker to
SQL Server 2012, see the following links:
228
Express with Tools contains both the traditional SQL Server Express package and
the new LocalDB package install bits. Users can choose which one to install,
depending on their needs.
Express with Advanced Services contains the database engine, Express Tools,
Reporting Services, and full-text search.
SQL Server 2012 Express is the ideal upgrade from the SQL Server 2005/2008/2008 R2
Express Editions. It includes many features that make it a compelling upgrade
proposition from any of these previous versions.
A direct upgrade path from Microsoft Data Engine (MSDE) to SQL Server 2012 Express is
not supported. To upgrade an existing MSDE instance, you must first upgrade to a SQL
Server 2005/2008/2008 R2 Express instance and then upgrade to SQL Server 2012
Express.
LocalDB
LocalDB is a new version of SQL Server Express created specifically for developers. It is
very easy to install and requires no management, yet it offers the same Transact-SQL
SQL Server 2012 Upgrade Technical Guide
229
(T-SQL) language, programming surface, and client-side providers as the regular SQL
Server Express. Developers who target SQL Server no longer have to install and manage
a full instance of SQL Server Express on their laptops and other development machines.
Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target
application environment, developers can continue using it in production, as LocalDB
makes a pretty good embedded database, too.
You can download SQL Server 2012 LocalDB as separated package from the SQL Server
Express Edition web site
(http://www.microsoft.com/sqlserver/en/us/editions/express.aspx).
Feature Changes
SQL Server 2012 Express supports all the core database functionality that SQL Server
2005/2008/2008 R2 Express provides. This lets almost all existing database applications
work without modifications. This functionality includes support for most of the SQL
Server 2005 and SQL Server 2008 R2 features, including Common Language Runtime
(CLR) support, XQuery, dynamic management views, and user-schema separation.
In addition, SQL Server Express can rely on a set of management tools. SQL Server
Express users can use SQL Server Computer Manager to start and stop database
services. You can use SQL Server Configuration Manager to limit potential security risks
by controlling network connections and shutting down unused services. You can also
manage SQL Server Express by using SSMS Basic, which is included in SQL Server 2012
Express with Tools and SQL Server 2012 Express with Advanced Services. You can use
SSMS Basic to manage all editions of SQL Server starting with SQL Server 2000 to SQL
Server 2012.
Note: SSMS Express and SSMS Basic are different subsets of SQL Server
Management Studio. You can access a good explanation of the differences between
them in a blog post from the Customer Service and Support (CSS) SQL Support
Team (http://blogs.msdn.com/b/psssql/archive/2008/09/02/sql-server-2008management-tools-basic-vs-complete-explained.aspx). The blog post is related to
SQL Server 2008 Express, but the information is still compliant with SQL Server 2012
Express.
You can download SQL Server 2012 Express from the SQL Server Express Edition web
site (http://www.microsoft.com/sqlserver/en/us/editions/express.aspx).
230
Preparing to Upgrade
Table 1 shows the upgrade paths that Microsoft supports to SQL Server 2012 Express.
Table 1: Upgrade Paths to SQL Server 2012 Express
Upgrade From
and
Advanced Services
and
Advanced Services
Tools, and
Advanced Services
When you are upgrading an existing 32-bit instance to a 32-bit instance, both in-place
and side-by-side upgrades are supported. In all other cases, side-by-side upgrades are
required.
English SQL Server can be upgraded to any localized SQL Server. A localized SQL Server
can be upgraded to a localized version of the same language. However, localized-toEnglish upgrades are not supported, nor are upgrades of a localized SQL Server to
different languages.
Table 2 shows the features in three types of packages available for SQL Server Express.
Table 2: SQL Server Express Packages Features
SQL Server 2012
SQL Server
Express with
Express with
2012 Express
Tools
Advanced Services
LocalDB
Yes
Yes
Yes
Yes
Policy-Based
Yes (manual
Yes (manual
Management
only)*
Feature
Management
PowerShell
integration
only)*
231
SQL Server
Express with
Express with
Feature
2012 Express
Tools
Advanced Services
LocalDB
SSMS Basic
No
Yes
Yes
No (use
SQLLocalDB.ex
e)
SQL Engine
Integrated full-text
No
No
Yes
No
Yes
Yes
Yes
No
search
MERGE and UPSERT
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Advanced spatial
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Change tracking
Yes
Yes
Yes
Yes
Synchronization
Yes (separate
Yes (separate
Yes
Yes (separate
Services
installation)**
installation)**
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
data types
libraries
Support for spatial
standards
New tools
Import/Export
Wizard
Replication
installation)**
Reporting Services
Increase RS Memory
Limit
RS Word/Rich Text
Export
IIS Agnostic Report
Deployment
Enhanced gauges
and charting
Business Intelligence
Development Studio
* Policies can be created in SQL Server 2012 Express and run manually. There is no support for automated
Policy-Based Management.
** Synchronization Services support in SQL Server 2012 Express requires that you install the component
separately from the Microsoft Download Center
(http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23217).
232
Deprecated Features
All the deprecated features discussed in other chapters that apply to other SQL Server
2012 editions also apply to SQL Server 2012 Express. For details about deprecated
features, see the following SQL Server 2012 Books Online topics:
Discontinued Functionality
All the discontinued features discussed in other chapters that apply to other SQL Server
2012 editions also apply to SQL Server 2012 Express. For details about discontinued
functionality, see the following SQL Server 2012 Books Online topics:
Breaking Changes
Many of the changes discussed in other chapters that could potentially break
applications also apply to SQL Server 2012 Express. For details about breaking changes,
see the following SQL Server 2012 Books Online topics:
Behavior Changes
Many of the behavior changes discussed in other chapters that apply to other SQL
Server 2012 editions also apply to SQL Server 2012 Express. For more details about
behavior changes that you need to watch out for, see the following SQL Server 2012
Books Online topics:
233
Upgrade Tools
You can take advantage of a variety of tools designed to make the upgrade to SQL
Server 2012 an easier process:
SQL Server 2012 Upgrade Advisor analyzes installed components from earlier
versions of SQL Server and generates a report that identifies issues to fix either
before or after you upgrade.
SQL Server 2012 Best Practices Analyzer analyzes the system and generates a
report based on a predefined list of SQL Server recommendations.
The first time you use Upgrade Advisor, run the Upgrade Advisor Analysis Wizard to
analyze SQL Server components. When the wizard finishes the analysis, view the
resulting reports in the Upgrade Advisor Report Viewer. Each report provides links to
information in Upgrade Advisor Help that will help you fix or reduce the effect of the
known issues.
You can download Upgrade Advisor as part of the Microsoft SQL Server 2012 Feature
Pack (http://www.microsoft.com/download/en/details.aspx?id=29065).
Running Best Practices Analyzer
Before upgrading your system, we recommend that you use best practices for your
existing system by running SQL Server Best Practices Analyzer (BPA). The BPA is
SQL Server 2012 Upgrade Technical Guide
234
available for all SQL Server versions. After gathering data from Windows and SQL
Server configuration settings, SQL Server BPA uses a predefined list of SQL Server
recommendations and best practices to determine if there are potential issues in the
database environment. Running BPA before upgrading gives you the opportunity to fix
any problems and helps ensure that you are using best practices before you go to the
new system. In the Microsoft Download Center, you can download the SQL Server 2005
BPA (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23864)
or SQL Server 2008 R2 BPA
(http://www.microsoft.com/download/en/details.aspx?id=15289).
Once you have upgraded to SQL Server 2012, you can use the SQL Server 2012 BPA to
further refine your systems. You can download the SQL Server 2012 BPA
(http://www.microsoft.com/download/en/details.aspx?id=29302) from the Microsoft
Download Center.
64-Bit Considerations
Table 3 shows the supported 64-bit architectures for SQL Server 2012 Express.
Table 3: 64-Bit Architectures Supported by SQL Server 2012 Express
Architecture
Supported
Yes
X64
Yes
IA64
No
Purpose
ENU\x86\SqlLocalDB.msi
ENU\x64\SqlLocalDB.msi
SQLEXPR32_x86_ENU.exe
SQLEXPR_x86_ENU.exe
SQLEXPR_x64_ENU.exe
SQLEXPRWT_x86_ENU.exe
235
SQLEXPRWT_x64_ENU.exe
SQLEXPRADV_x86_ENU.exe
SQLEXPRADV_x64_ENU.exe
Note that in the table, ENU refers to the English-language version. Other language
versions are also available.
We recommend that you run SQL Server 2012 Express on computers with the
NTFS file format. Installing SQL Server 2012 Express on a computer with FAT32
file system is supported but not recommended as it is less secure than the NTFS
file system.
To make sure that the Visual Studio component can be installed correctly, SQL
Server requires you to install an update. SQL Server Setup checks for the
presence of this update and then requires you to download and install the
update before you can continue with the SQL Server installation. To avoid the
interruption during SQL Server Setup, you can download and install the update
before running SQL Server Setup as described below (or install all the updates
for .NET Framework 3.5 SP1 available on Windows Update):
o If you install SQL Server 2012 on a computer with the Windows Vista SP2
or Windows Server 2008 SP2 operating system, you can get the required
update from An update is available for the .NET Framework 3.5 Service
Pack 1 in Windows Vista and in Windows Server 2008
(http://support.microsoft.com/?kbid=956250).
o If you install SQL Server 2012 on a computer with the Windows 7 SP1 or
Windows Server 2008 R2 SP1 operating system, this update is included.
The installation of SQL Server 2012 fails if you launch the setup through
Terminal Services Client. Launching SQL Server Setup through Terminal Services
Client is not supported.
SQL Server 2012 Upgrade Technical Guide
236
Table 5 shows the system requirements for SQL Server Express (all versions), taken from
Hardware and Software Requirements for Installing SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143506(v=sql.110).aspx) in SQL Server
2012 Books Online.
Table 5: SQL Server 2012 Express (All Versions) System Requirements
Component
Requirement
.NET
Based on selected features during the setup of SQL Server 2012 Express edition, you
Framework
Ensure that an Internet connection is available on the computer. SQL Server Setup
downloads and installs the .NET Framework 4.0 because it is not included in the SQL
Server Express media. SQL Server Setup will download.NET Framework 4 to complete
the installation of the prerequisites.
SQL Server Express does not install .NET Framework 4.0 when installing on the
Windows 2008 R2 SP1 Server Core operating system. You must install .NET 4.0 before
you install SQL Server Express on a Windows 2008 R2 SP1 Server Core operating
system.
.NET Framework 3.5 SP1 is a requirement for SQL Server 2012 Express Edition only
when you select Database Engine, Reporting Services, Replication or SSMS, but it is no
longer installed by SQL Server Setup.
If you run Setup on a computer with the Windows Vista SP2 or Windows
Server 2008 SP2 operating system, and you do not have .NET Framework 3.5
SP1, SQL Server Setup requires you to download and install.NET Framework
3.5 SP1 before you can continue with the SQL Server installation. The error
message includes a link to the download center, or you can download .NET
Framework 3.5 SP1 from Windows Update. To avoid interruption during SQL
Server Setup, you can download and install .NET 3.5 Framework SP1 before
you run SQL Server Setup.
If you run Setup on a computer with the Windows Server 2008 R2 SP1
operating system, you must enable .NET Framework 3.5 SP1 before you install
SQL Server 2012.
237
Component
Requirement
Windows
SQL Server 2012 does not install or enable Windows PowerShell; however, Windows
PowerShell
Network
Network software requirements for the 64-bit versions of SQL Server are the same as
software
the requirements for the 32-bit versions. Supported operating systems have built-in
network software.
Standalone named and default instances support the following network protocols:
Shared memory
Named pipes
TCP/IP
VIA
Note: Shared memory and VIA are not supported on failover clusters. The VIA
protocol is being deprecated and will be removed in a future version of SQL Server.
Avoid using this feature in new development work, and plan to modify applications
that currently use this feature.
Virtualization
SQL Server 2012 is supported in virtual machine environments running on the Hyper-V
role in Windows Server 2008 SP2 Standard, Enterprise, and Datacenter Editions, and
Windows Server 2008 R2 SP1 Standard, Enterprise, and Datacenter Editions.
In addition to resources required by the parent partition, each virtual machine (child
partition) must be provided with sufficient processor resources, memory, and disk
resources for its SQL Server 2012 instance.
Within the Hyper-V role on Windows Server 2008 SP2 and Windows Server 2008 R2
SP1, a maximum of four virtual processors can be allocated to virtual machines
running Windows Server 2008 SP2 or Windows Server 2008 R2 SP1 32-bit or 64-bit
editions.
Internet
Internet Explorer 7 or later is required for Microsoft Management Console (MMC), SQL
software
Server Data Tools (SSDT), the Report Designer component of Reporting Services, and
HTML Help.
Hard disk
Disk space requirements will vary with the SQL Server components you install.
Drive
Display
SQL Server graphical tools require VGA or higher resolution: at least 1,024 x 768 pixel
resolution.
Other
devices
Table 6 shows the processor, memory, and operating system requirements for the 32bit version of SQL Server 2012 Express (Express, Express with Tools, and Express with
Advanced Services packages).
238
Table 6: SQL Server 2012 Express (32-Bit) Processor, Memory, and Operating System
Requirements
Component
Requirement
Processor
Processor type:
Processor speed:
Operating
system
239
Component
Requirement
Memory
RAM:
Minimum: 512 MB
Recommended: 1 GB
Table 7 shows the processor, memory and operating system requirements for the 64bit version of SQL Server 2012 Express (Express, Express with Tools, and Express with
Advanced Services packages).
Table 7: SQL Server 2012 Express (64-Bit) Processor, Memory, and Operating System
Requirements
Component
Requirement
Processor
Processor type:
Minimum: AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support,
Intel Pentium IV with EM64T support
Processor speed:
Operating
system
Memory
RAM:
Minimum: 512 MB
Recommended: 1 GB
240
Side-by-Side Upgrade
To upgrade from previous SQL Server Express versions when you cannot or do not
want to perform an in-place upgrade, use the following steps if you have the SQL
Server Express Management Tools installed; otherwise, perform the detach/attach
operations.
1. Log in to the previous SQL Server Express system as an administrator, and verify
that the instance of SQL Server Express that you want to upgrade is running.
2. Connect to the previous SQL Server Express system by using SSMS (Express or
another edition).
3. Detach each of the user databases by right-clicking the name of the database
and selecting the Detach option. (Note that you could also have done this using
the backup/restore method instead, but the detach/attach method is generally
easier.)
SQL Server 2012 Upgrade Technical Guide
241
4. Shut down the previous SQL Server Express instance by opening SQL Server
Configuration Manager and stopping the SQL Server services.
5. Repeat Step 4 for the Distributed Transaction Coordinator and SQL Server Agent
services if they are running.
6. Remove SQL Server Express by using the Add/Remove Programs applet from the
systems Control Panel. Note that you can perform this step later if the names of
the instances containing the old and new versions of SQL Server Express are
different.
7. Download and install .NET Framework 3.5 SP1. It is a prerequisite for SQL Server
2012 Express but is no longer installed by SQL Server Express setup. You can
download .NET Framework 3.5 SP1 (http://www.microsoft.com/enus/download/details.aspx?displaylang=en&id=22) from the Microsoft Download
Center. After downloading .NET Framework 3.5 SP1, install it by running the
dotnetfx.exe program.
8. Install SQL Server 2012 Express by running the SQL Server Express executable
program. Select the appropriate installation options for the new instance you are
installing, including the instance name if you want to specify a name other than
SQLEXPRESS, although the use of this name is recommended.
Important: In SQL Server 2005 Express and later, the Setup program sets the
name of a default instance to SQLEXPRESS rather than the old MSDE default of
the host computer name. If you want the instance name to be the name of the
host computer, you must specify that name as the named instances name.
9. After SQL Server 2012 Express is installed, connect to it using SSMS (Express or
another edition).
10. Attach each of the user databases that were detached from the SQL Server
2005/2008/2008 R2 Express instance by right-clicking the Databases node in
Object Explorer and choosing the Attach Database option. (As noted earlier, you
could alternatively restore the databases at this point if you used the
backup/restore option instead of detach/attach.)
11. Enable any needed protocols.
The default installation for SQL Server 2012 Express enables shared memory, which
enables local access only; the named pipes and TCP/IP protocols are disabled. If your
database installation requires network access, open SQL Server Configuration Manager,
open the SQL Server 2012 Network Configuration node, select Protocols for
SQL Server 2012 Upgrade Technical Guide
242
SQLEXPRESS (or your non-default instance name), and then enable the required
protocols by right-clicking the protocol and selecting the Enable option from the
context menu.
Post-Upgrade Tasks
You should verify the SQL Server 2012 Express installation by performing the following
post-upgrade steps:
1. Use SQL Server Configuration Manager to verify that the upgraded instance is
running. To start Configuration Manager, double-click SQL Server Configuration
Manager under Configuration Tools in the Microsoft SQL Server 2012 Express
program group.
2. Within Configuration Manager, open the SQL Server 2012 Services node and
check for an upgraded instance entry to verify that it has a status of running. If
the SQL Server service is not running, you can manually attempt to start it by
right-clicking the entry and selecting Start from the context menu. If the service
will not start, the installation was not successful and will need to be redone.
Note: When you are upgrading instances of SQL Server 2005/2008/2008 R2 Express
that support connections from networked users, it is important to know that SQL
Server 2012 Express, by default, disables all remote connections. If you need to
enable remote connections to SQL Server Express, open SQL Server Configuration
Manager, expand the SQL Server 2012 Network Configuration node, select
Protocols for SQLEXPRESS, and then enable the required protocols by right-clicking
the protocol and selecting the Enable option from the context menu.
Upgrading to LocalDB
To upgrade from previous SQL Server Express versions to LocalDB, use the following
steps if you have the SQL Server Express Management Tools installed; otherwise,
perform the detach/attach operations.
1. Log in to the previous SQL Server Express system as an administrator, and verify
that the instance of SQL Server Express that you want to upgrade is running.
2. Connect to the previous SQL Server Express system by using SSMS (Express or
another edition).
243
3. Detach each of the user databases by right-clicking the name of the database
and selecting the Detach option. (Note that you could also have done this using
the backup/restore method instead, but the detach/attach method is generally
easier.)
4. Shut down previous SQL Server Express instance by opening SQL Server
Configuration Manager and stopping the SQL Server services.
5. Repeat Step 4 for the Distributed Transaction Coordinator and SQL Server Agent
services if they are running.
6. Remove SQL Server Express by using the Add/Remove Programs applet from the
systems Control Panel. Note that you can perform this step later if the names of
the instances containing the old and new versions of SQL Server Express are
different.
7. Install SQL Server 2012 LocalDB by running the .msi installer. Select the
appropriate installation options for the new instance you are installing, including
the instance name if you want to specify a name other than SQLEXPRESS,
although the use of this name is recommended.
8. After SQL Server 2012 LocalDB is installed, connect to it using SSMS (Express or
another edition) or the SQLCMD command-line utility.
9. Attach each of the user databases that were detached from the SQL Server
2005/2008/2008 R2 Express instance by right-clicking the Databases node in
Object Explorer and choosing the Attach Database option. (As noted earlier, you
could alternatively restore the databases at this point if you used the
backup/restore method instead of the detach/attach method.) If you are using
the command-line option, you can attach the databases using the proper T-SQL
command.
244
Table 8: Comparing the SQL Server 2012 Express, Web, and Standard Editions
SQL Server
SQL Server
SQL Server
2012
Feature
2012 Express
2012 Web
Standard
50
50
50
Lesser of 1
Lesser of 4
Lesser of 4
socket or 4 cores
sockets or 16
sockets or 16
cores
cores
Maximum RAM
1 GB
64 GB
64 GB
10 GB
524 TB
524 TB
No
Yes
Yes
Witness only
Witness only
Yes (Safety
Full only)
No
No
Yes (2 nodes)
Backup compression
No
No
Yes
Replication publishing
No
No
Yes
No
Yes
Yes
No
Yes
Yes
BI Features
No
No
Yes
Express with
Yes
Yes
Web
Standard or
Advanced
Services only
Supported Report Server catalog DB
Express
higher
Supported Report data source
Express
Web
All editions
Service Broker
Client-only
Client-only
Yes
Express with
Yes
Yes
Advanced
Services only
SQL Profiler
No
No
Yes
Database Mail
No
Yes
Yes
StreamInsight
No
Yes
Yes
245
Processor Requirements Beyond the Level Supported by SQL Server 2012 Express
Although SQL Server 2012 Web supports 4 processors with a maximum of 16 cores
compared with SQL Server 2012 Express support for 1 processor with a maximum of 4
cores, it is unlikely that this would necessitate a move to SQL Server 2012 Web. In most
cases, it would be more cost-effective to upgrade to a higher performance processor.
SQL Server Express supports multicore processors and can be installed on any server,
but each installation of SQL Server Express can access only one physical processor.
Applications Need Scheduling Capability
SQL Server 2012 Express does not supply SQL Server Agent. If your application needs
to schedule jobs and database tasks, you can use the Windows Task Scheduler or
consider upgrading to SQL Server 2012 Web.
Instance Needs to Act as a Replication Publisher
SQL Server 2012 Express does not support using a SQL Server Express instance as a
replication Publisher to other SQL Server Express databases. If your application needs
to act as a Publisher in a replication scenario, you need to consider upgrading to SQL
Server 2012 Web.
Conclusion
SQL Server 2012 Express is the ideal upgrade path for SQL Server 2005/2008/2008 R2
Express database management systems. The upgrade is straightforward, and there are
only a few issues to review and prepare for before upgrading from previous versions of
SQL Server Express. But make sure you understand these upgrade issues before making
your move to ensure a smooth and successful upgrade.
SQL Server 2012 Upgrade Technical Guide
246
Additional References
For an up-to-date collection of additional references for upgrading to SQL Server 2012
Express, see the following links:
247
Preparing to Upgrade
Before you upgrade, make sure you can install SSDT:
If you already have Visual Studio 2010 Ultimate, Premium, or Professional Edition
installed, you will need to manually install the Visual Studio 2010 SP1 update
(http://www.microsoft.com/download/en/details.aspx?id=23691) before you
install SSDT.
If you dont have Visual Studio 2010 installed, the SSDT installation will install
the Visual Studio 2010 Integrated Shell SP1 on your PC along with the SSDT
functionality.
For a complete overview of the SSDT installation process, see Get Started with
Microsoft SQL Server Data Tools (http://msdn.microsoft.com/en-us/data/hh297027).
248
Notes
.sqlpermissions
Table 2 shows the elements that will not be upgraded. You can expect them either to
be highlighted in the conversion report at the end of the conversion or to fire an error
when building the project.
249
Error Upon
Solution
Conversion
Pre-upgrade task
Conversion
Pre-upgrade task
Conversion
None
Conversion
None
Extensibility files
Conversion
None
Server logins
Build
Pre-upgrade task
Full-text search
Build
Post-upgrade task
Build
Post-upgrade task
The next sections discuss the issues encountered while converting Visual Studio 2010
Database Projects to SSDT Database Projects and present a solution (if one exists)
either as a pre- or post-upgrade task.
250
251
Server Logins
In Visual Studio 2010, there are two types of projects: Database Projects and Server
Projects. A Database Project that references a Server Project can have server logins
configured in the Server Project that are used in the Database Project, as shown in
Figure 5.
Data generation. SSDT doesnt have a data generation tool at this time, but it is
a feature that will be added in a future release.
Database Unit Test Projects. This type of project is not currently supported by
SSDT, but database unit testing will be added in a future release.
Full-text search. When you use SSDT and debug your project, you use the new
LocalDB, which is an on-demand local instance of SQL Server 2012.
Linked server definitions. In Visual Studio 2010 Database Projects, you are able
to define linked servers and use the value from a SQLCMD variable. Used this
way, it will convert to SSDT but will raise an error when deploying or debugging.
SQL Server 2012 Upgrade Technical Guide
252
Pre-Upgrade Tasks
By completing some pre-upgrade tasks, you will be able to solve some of the
conversion problems described in the Breaking and Behavioral Changes section when
you convert your Visual Studio 2010 Database Projects to SSDT Database Projects.
In Visual Studio with SSDT, you can use SQL Server Object Explorer to create a new
project based on your new database, as shown in Figure 6.
253
254
Post-Upgrade tasks
After the conversion, there are still some changes to be made before you can compile,
deploy, or publish your projects. The following topics were detailed in the Breaking
and Behavior Changes section earlier, but if they are still present after your upgrade,
you should address them now.
Figure 10: SQLCMD variable being used to define the linked server
There are two alternatives for resolving this issue:
255
execute sp_addlinkedserver
@server = N'MyLinkedServer' , @srvproduct = N'',
@provider = N'SQLNCLI', @datasrc = N'$(Environment)'
Additional References
For more information, see these resources:
256
Preparing to Upgrade
Preparation is the key to a successful upgrade of your stored procedures, ad hoc
queries, and administrative scripts. Having a backup and rollback plan is critical, and
you need to know which features have been deprecated or discontinued in SQL Server
2012 as well as which features could derail an upgrade or cause problematic changes in
behavior after your upgrade. In this section, we discuss the key T-SQL changes you
need to understand for a smooth transition to SQL Server 2012 and the tools that can
help you identify and resolve possible problems.
257
Deprecated Features
Deprecated features are those that SQL Server 2012 still supports but that will be
removed in a future version of SQL Server. Although you do not have to remove these
features from your implementation to complete an upgrade, you need to address them
to make sure you avoid problems in the future. SQL Server 2012 includes System
Monitor, the Deprecation Announcement Event Class, and the
deprecation_announcement Extended Event to help you identify deprecated features
on your upgraded system.
SQLServer:Deprecated Features Object
After you have upgraded to SQL Server 2012, you might want to identify deprecated
features still in use so that you can address those issues and replace them with the
newer SQL Server 2012 counterparts. SQL Server 2012 has a System Monitor object
named SQLServer:Deprecated Features. This object enumerates a number of
deprecated features and how frequently they are used on your SQL Server system. You
can view this information with System Monitor or by using the DMV
sys.dm_os_performance_counters. For more information about this object, see SQL
Server, Deprecated Features Object (http://msdn.microsoft.com/enus/library/bb510662(v=sql.110).aspx) in SQL Server 2012 Books Online.
Deprecation Announcement Event Class
You can use the Deprecation Announcement Event Class from SQL Server Profiler to
identify deprecated features. For more information about this event class, see
Deprecation Announcement Event Class (http://msdn.microsoft.com/enus/library/ms186302(v=sql.110).aspx) in SQL Server 2012 Books Online.
258
Deprecated Feature
Replacement
None
PASSWORD
Backup and restore
None
MEDIAPASSWORD
Compatibility levels
from version 90
Database objects
None
triggers
Encryption
as AES.
is not deprecated)
Remote servers
Remote servers
sp_addremotelogin
sp_addserver
sp_dropremotelogin
sp_helpremotelogin
sp_remoteoption
@@remserver
Remote servers
Set options
SET
REMOTE_PROC_TRANSACTIONS
servers.
TOP keyword
parentheses
Tools
sqlmaint utility
259
For a comprehensive list of deprecated functionality in SQL Server 2008 R2 and SQL
Server 2012, see the following topics in SQL Server Books Online:
Discontinued Features
SQL Server 2012 has discontinued some stored procedure and T-SQL command
functionality from previous versions of SQL Server, including the sp_dboption system
stored procedure and sending emails by using the extended stored procedure
xp_sendmail.
Sending Email
Using xp_sendmail to send email messages is not possible anymore. This extended
stored procedure uses SQL Mail to send the message and this feature has been
removed from SQL Server 2012. You should change references to the extended stored
procedure xp_sendmail in all your scripts and use Database Mail instead. For more
information, see Database Mail (http://technet.microsoft.com/enus/library/ms189635.aspx).
sp_dboption
The system stored procedure sp_dboption has been removed from SQL Server 2012.
You should change references to this system stored procedure in all your scripts and
use ALTER DATABASE instead.
Discontinued Commands
Table 2 lists the commands that have been discontinued in SQL Server 2012. You
should change references to these commands in all stored procedures, ad hoc queries,
and scripts. Table 2 also lists some other features than have been discontinued.
260
Discontinued Feature
Replacement
Backup and
None
restore
PASSWORD
Backup and
restore
MEDIAPASSWORD
Backup and
restore
DBO_ONLY
WITH RESTRICTED_USER
Compatibility
80 compatibility levels
levels
None
Configuration
Options
Connection
protocols
(VIA) protocol
Database objects
Database options
sp_dboption
ALTER DATABASE
SQL Mail
Memory
Management
Metadata
DATABASEPROPERTY
DATABASEPROPERTYEX
Programmability
Objects (SQL-DMO)
(SMO)
Query hints
FASTFIRSTROW hint
OPTION (FAST n)
Remote servers
linked servers.
sp_dropalias
Security
None
integer 'string'
COMPUTE/COMPUTE BY
Use ROLLUP.
261
Category
Discontinued Feature
Replacement
T-SQL syntax
Use of *= and =*
XEvents
XEvents
databases_data_file_size_changed
database_file_size_change event
databases_log_file_size_changed
database_file_size_change
eventdatabases_log_file_used_size_changed
database_file_size_change event
locks_lock_timeouts_greater_than_0
lock_timeout_greater_than_0
locks_lock_timeouts
lock_timeout
XEvents
For a comprehensive list of discontinued functionality in SQL Server 2008 R2 and SQL
Server 2012, see the following topics in SQL Server Books Online:
Breaking Changes
Although Microsoft has worked hard to minimize the impact of upgrading, there are a
few breaking changes in SQL Server 2012 that could cause your upgrade to fail.
T-SQL
There are a number of T-SQL breaking changes in SQL Server 2012. Not all breaking
changes will affect your upgraded database. Some of them impact the system only if
you use the compatibility level 110 for your upgraded databases. Table 3 describes TSQL breaking changes that affect all database compatibility levels. Table 4 describes TSQL breaking changes that affect upgraded databases in the database compatibility
mode 110.
SQL Server 2012 Upgrade Technical Guide
262
Description
Sequences use the ANSI standard NEXT VALUE FOR function. If a table
WITHIN reserved
keyword
named 'within' will fail. Rename the object or column name or delimit
the name by using brackets or quotes. For example, SELECT * FROM
[Within].
ALTER TABLE
server.database.schema.table
.database.schema.table
..schema.table
Language (DML)
statements
sys.fn_get_audit_file
function
Browsing metadata
263
Feature
Description
sp_setapprole and
sp_unsetapprole
EXECUTE AS
Table 4: Breaking Changes in T-SQL under the Database Compatibility Level 110
Feature
Description
PIVOT operator
In earlier versions of SQL Server, the default style for CAST and
operations on
computed columns of
264
Feature
Description
SOUNDEX
DMVs
A few DMVs have been updated in SQL Server 2012. Table 5 lists the modifications that
might cause upgrade problems if you are not prepared for them.
Table 5: Breaking Changes in DMVs
Feature
Description
sys.dm_os_memory_cache_counters
sys.dm_os_memory_cache_counters
sys.dm_os_memory_cache_entries
sys.dm_os_memory_clerks
single_pages_kb
pages_kb
multi_pages_kb
pages_in_use_kb
single_pages_kb
pages_kb
multi_pages_kb
pages_in_use_kb
pages_allocated_count
pages_kb
sys.dm_os_memory_nodes
sys.dm_os_memory_objects
single_pages_kb
pages_kb
single_pages_kb
pages_kb
multi_pages_kb
foreign_committed_kb
pages_allocated_count
pages_in_bytes
max_pages_allocated_count
max_pages_in_bytes
265
Feature
Description
sys.dm_os_sys_info
sys.dm_os_workers
physical_memory_in_bytes
physical_memory_kb
bpool_commit_target
committed_target_kb
bpool_visible
visible_target_kb
virtual_memory_in_bytes
virtual_memory_kb
bpool_committed
committed_kb
Catalog Views
A few catalog views have been updated in SQL Server 2012. Table 6 lists the
modifications that might cause upgrade problems if you are not prepared for them.
Table 6: Breaking Changes in Catalog Views
View
Description
sys.data_spaces
sys.partition_functions
sys.partition_schemes
The new column is not the last column. Revise existing queries that rely
on the order of columns returned from these catalog views.
sys.filegroups
The new column is not the last column. Revise existing queries that rely
on the order of columns returned from these catalog views.
266
This occurs when the Database Engine cannot discover metadata for a procedure.
Additional Information
For a complete list of breaking changes in SQL Server 2008 R2 and SQL Server 2012,
see the following topics in SQL Server Books Online:
Behavior Changes
SQL Server 2012 changes the behavior of a number of features that your stored
procedures, queries, and scripts might use. These changes likely will not prevent an
upgrade to SQL Server 2012, but they might affect how your query-intensive system
works after the upgrade. Be sure to review your code for the changes covered in this
section to make sure that it works correctly after your upgrade.
Metadata Discovery
Improvements in the Database Engine beginning with SQL Server 2012 allow
SQLDescribeCol to obtain more accurate descriptions of the expected results than
those returned by SQLDescribeCol in previous versions of SQL Server. For more
information, see Metadata Discovery (http://msdn.microsoft.com/enus/library/ff878240.aspx).
The SET FMTONLY option for determining the format of a response without actually
running the query is replaced with sp_describe_first_result_set,
sp_describe_undeclared_parameters, sys.dm_exec_describe_first_result_set, and
sys.dm_exec_describe_first_result_set_for_object. For more information, see:
sp_describe_first_result_set (Transact-SQL)
(http://msdn.microsoft.com/en-us/library/ff878602(v=sql.110).aspx)
267
sp_describe_undeclared_parameters (Transact-SQL)
(http://msdn.microsoft.com/en-us/library/ff878260(v=sql.110).aspx)
sys.dm_exec_describe_first_result_set (Transact-SQL)
(http://msdn.microsoft.com/en-us/library/ff878258(v=sql.110).aspx)
sys.dm_exec_describe_first_result_set_for_object (Transact-SQL)
(http://msdn.microsoft.com/en-us/library/ff878236(v=sql.110).aspx)
Note that compatibility levels 65, 70, and 80 are deprecated and will be removed in a
future SQL Server release. SQL Server Management Studio (SSMS) and SQL Server
Management Objects (SMO) do not support compatibility level 80 and might produce
errors if you try to use them against a database with this compatibility level.
You can determine the compatibility level of your databases either by right-clicking the
database in SSMS and selecting Properties and then Options, or by executing the
following statement:
SQL Server 2012 Upgrade Technical Guide
268
The compatibility level of a database governs the ability of DBAs and developers to use
some of the new features in SQL Server 2012 as well as their ability to retain some
legacy behaviors. If you want to use all the features available in the new release of SQL
Server, you should resolve any upgrade issues before changing the compatibility level
of a database to 110.
To change the compatibility level of a database, right-click the database in SSMS and
select Properties and then Options. In the Compatibility Level drop-down list, select the
desired compatibility level. You can also change the compatibility level by issuing the
following ALTER DATABASE command:
ALTER DATABASE <Database Name> SET COMPATIBILITY_LEVEL = 110
Note: You can change the compatibility level of the model database so that you
can create a new database with a non-default compatibility level. The default
compatibility level for new SQL Server 2012 installations is 110.
For more information about changing compatibility levels, see ALTER DATABASE
Compatibility Level (Transact-SQL) (http://msdn.microsoft.com/enus/library/bb510680(v=sql.110).aspx) in SQL Server 2012 Books Online.
System Tables
SQL Server 2012 includes several changes to system tables, so you need to review your
stored procedures, ad hoc queries, and administrative scripts to determine whether the
changes will affect your code. Table 7 lists some of the key changes.
Table 7: Changes to System Tables
System Table
Change
sysdercv
syscerts
sysrowsets
sysrowsets
sysrscols
sysallocunits
sysowners
sysschobjs
269
System Table
Change
sysiscols
sysxmitqueue
Change
sp_setapprole
sp_unsetapprole
The system stored procedure returns a value of 0 for the objid and
indid columns instead of the object id and index id, respectively.
sp_readerrorlog
sp_flush_commit_table
sp_addmergelogsettings
sp_changemergelogsettings
sp_dboption
sp_dropalias
sp_processmail
sp_ActiveDirectory_SCP
sp_ActiveDirectory_Obj
Functions
SQL Server 2012 has changed the behavior of built-in functions. Review your code to
make sure it accounts for changes listed in Table 9.
Table 9: Changes to the Behavior of Built-In Functions
Function
Change
fn_translate_permissions
The data type of the second parameter named perms has been
changed from bigint to varbinary(16).
270
Reserved Keywords
One possible issue you might face when upgrading a database and changing the
compatibility level of that database involves keywords marked as reserved. SQL Server
uses reserved keywords for defining, manipulating, and accessing databases. Reserved
keywords are part of the grammar of the T-SQL language that SQL Server uses to parse
and understand T-SQL statements and batches.
Although you can use T-SQL reserved keywords as identifiers or names of databases or
database objects (e.g., tables, columns, views), you can do this only by using either
quoted identifiers or delimited identifiers. Using reserved keywords as the names of
variables and stored procedure parameters is not restricted.
SQL Server 2012 Upgrade Advisor will flag stored procedures for usage of new reserved
keywords. But make sure to perform a manual review of T-SQL code embedded in
application code and other external sources. The reserved keywords introduced in SQL
Server 2012 are:
SEMANTICKEYPHRASETABLE
SEMANTICSIMILARITYDETAILSTABLE
SEMANTICSIMILARITYTABLE
TRY_CONVERT
WITHIN GROUP
EXTERNAL
PROCEDURE
ALL
FETCH
PUBLIC
ALTER
FILE
RAISERROR
AND
FILLFACTOR
READ
ANY
FOR
READTEXT
AS
FOREIGN
RECONFIGURE
ASC
FREETEXT
REFERENCES
AUTHORIZATION
FREETEXTTABLE
REPLICATION
BACKUP
FROM
RESTORE
BEGIN
FULL
RESTRICT
BETWEEN
FUNCTION
RETURN
BREAK
GOTO
REVERT
BROWSE
GRANT
REVOKE
271
BULK
GROUP
RIGHT
BY
HAVING
ROLLBACK
CASCADE
HOLDLOCK
ROWCOUNT
CASE
IDENTITY
ROWGUIDCOL
CHECK
IDENTITY_INSERT
RULE
CHECKPOINT
IDENTITYCOL
SAVE
CLOSE
IF
SCHEMA
CLUSTERED
IN
SECURITYAUDIT
COALESCE
INDEX
SELECT
COLLATE
INNER
SEMANTICKEYPHRASETABLE
COLUMN
INSERT
SEMANTICSIMILARITYDETAILSTABLE
COMMIT
INTERSECT
SEMANTICSIMILARITYTABLE
COMPUTE
INTO
SESSION_USER
CONSTRAINT
IS
SET
CONTAINS
JOIN
SETUSER
CONTAINSTABLE
KEY
SHUTDOWN
CONTINUE
KILL
SOME
CONVERT
LEFT
STATISTICS
CREATE
LIKE
SYSTEM_USER
CROSS
LINENO
TABLE
CURRENT
LOAD
TABLESAMPLE
CURRENT_DATE
MERGE
TEXTSIZE
CURRENT_TIME
NATIONAL
THEN
CURRENT_TIMESTAMP
NOCHECK
TO
CURRENT_USER
NONCLUSTERED
TOP
CURSOR
NOT
TRAN
DATABASE
NULL
TRANSACTION
DBCC
NULLIF
TRIGGER
DEALLOCATE
OF
TRUNCATE
DECLARE
OFF
TRY_CONVERT
DEFAULT
OFFSETS
TSEQUAL
DELETE
ON
UNION
DENY
OPEN
UNIQUE
DESC
OPENDATASOURCE
UNPIVOT
DISK
OPENQUERY
UPDATE
DISTINCT
OPENROWSET
UPDATETEXT
DISTRIBUTED
OPENXML
USE
DOUBLE
OPTION
USER
DROP
OR
VALUES
DUMP
ORDER
VARYING
ELSE
OUTER
VIEW
END
OVER
WAITFOR
ERRLVL
PERCENT
WHEN
272
ESCAPE
PIVOT
WHERE
EXCEPT
PLAN
WHILE
EXEC
PRECISION
WITH
EXECUTE
PRIMARY
WITHIN GROUP
EXISTS
WRITETEXT
EXIT
PROC
In addition, the ISO standard defines a list of reserved keywords. Avoid using ISO
reserved keywords for object names and identifiers. The ISO reserved keyword list is
the same as the ODBC reserved keyword list, which is provided in the next section.
Note: The ISO standard reserved keywords list sometimes can be more restrictive
than SQL Server and at other times less restrictive. For example, the ISO reserved
keywords list contains INT. SQL Server does not distinguish this as a reserved
keyword.
ODBC Reserved Keywords
ODBC features keywords reserved for use in ODBC function calls. These words do not
constrain the minimum SQL grammar. However, to ensure compatibility with drivers
that support the core SQL grammar, applications should avoid using these keywords.
Table 11 lists the SQL Server 2012 ODBC reserved keywords.
Table 11: ODBC Reserved Keywords
ABSOLUTE
EXEC
OVERLAPS
ACTION
EXECUTE
PAD
ADA
EXISTS
PARTIAL
ADD
EXTERNAL
PASCAL
ALL
EXTRACT
POSITION
ALLOCATE
FALSE
PRECISION
ALTER
FETCH
PREPARE
AND
FIRST
PRESERVE
ANY
FLOAT
PRIMARY
ARE
FOR
PRIOR
AS
FOREIGN
PRIVILEGES
ASC
FORTRAN
PROCEDURE
ASSERTION
FOUND
PUBLIC
AT
FROM
READ
AUTHORIZATION
FULL
REAL
AVG
GET
REFERENCES
BEGIN
GLOBAL
RELATIVE
BETWEEN
GO
RESTRICT
273
BIT
GOTO
REVOKE
BIT_LENGTH
GRANT
RIGHT
BOTH
GROUP
ROLLBACK
BY
HAVING
ROWS
CASCADE
HOUR
SCHEMA
CASCADED
IDENTITY
SCROLL
CASE
IMMEDIATE
SECOND
CAST
IN
SECTION
CATALOG
INCLUDE
SELECT
CHAR
INDEX
SESSION
CHAR_LENGTH
INDICATOR
SESSION_USER
CHARACTER
INITIALLY
SET
CHARACTER_LENGTH
INNER
SIZE
CHECK
INPUT
SMALLINT
CLOSE
INSENSITIVE
SOME
COALESCE
INSERT
SPACE
COLLATE
INT
SQL
COLLATION
INTEGER
SQLCA
COLUMN
INTERSECT
SQLCODE
COMMIT
INTERVAL
SQLERROR
CONNECT
INTO
SQLSTATE
CONNECTION
IS
SQLWARNING
CONSTRAINT
ISOLATION
SUBSTRING
CONSTRAINTS
JOIN
SUM
CONTINUE
KEY
SYSTEM_USER
CONVERT
LANGUAGE
TABLE
CORRESPONDING
LAST
TEMPORARY
COUNT
LEADING
THEN
CREATE
LEFT
TIME
CROSS
LEVEL
TIMESTAMP
CURRENT
LIKE
TIMEZONE_HOUR
CURRENT_DATE
LOCAL
TIMEZONE_MINUTE
CURRENT_TIME
LOWER
TO
CURRENT_TIMESTAMP
MATCH
TRAILING
CURRENT_USER
MAX
TRANSACTION
CURSOR
MIN
TRANSLATE
DATE
MINUTE
TRANSLATION
DATE
MINUTE
TRANSLATION
DAY
MODULE
TRIM
DEALLOCATE
MONTH
TRUE
DEC
NAMES
UNION
DECIMAL
NATIONAL
UNIQUE
274
DECLARE
NATURAL
UNKNOWN
DEFAULT
NCHAR
UPDATE
DEFERRABLE
NEXT
UPPER
DEFERRED
NO
USAGE
DELETE
NONE
USER
DESC
NOT
USING
DESCRIBE
NULL
VALUE
DESCRIPTOR
NULLIF
VALUES
DIAGNOSTICS
NUMERIC
VARCHAR
DISCONNECT
OCTET_LENGTH
VARYING
DISTINCT
OF
VIEW
DOMAIN
ON
WHEN
DOUBLE
ONLY
WHENEVER
DROP
OPEN
WHERE
ELSE
OPTION
WITH
END
OR
WORK
END-EXEC
ORDER
WRITE
ESCAPE
OUTER
YEAR
EXCEPT
OUTPUT
ZONE
EXCEPTION
FREE
PRESERVE
ACTION
FULLTEXTTABLE
PRIOR
ADMIN
GENERAL
PRIVILEGES
AFTER
GET
READS
AGGREGATE
GLOBAL
REAL
ALIAS
GO
RECURSIVE
ALLOCATE
GROUPING
REF
ARE
HOST
REFERENCING
ARRAY
HOUR
RELATIVE
ASSERTION
IGNORE
RESULT
275
AT
IMMEDIATE
RETURNS
BEFORE
INDICATOR
ROLE
BINARY
INITIALIZE
ROLLUP
BIT
INITIALLY
ROUTINE
BLOB
INOUT
ROW
BOOLEAN
INPUT
ROWS
BOTH
INT
SAVEPOINT
BREADTH
INTEGER
SCROLL
CALL
INTERVAL
SCOPE
CASCADED
ISOLATION
SEARCH
CAST
ITERATE
SECOND
CATALOG
LANGUAGE
SECTION
CHAR
LARGE
SEQUENCE
CHARACTER
LAST
SESSION
CLASS
LATERAL
SETS
CLOB
LEADING
SIZE
COLLATION
LESS
SMALLINT
COMPLETION
LEVEL
SPACE
CONNECT
LIMIT
SPECIFIC
CONNECTION
LOCAL
SPECIFICTYPE
CONSTRAINTS
LOCALTIME
SQL
CONSTRUCTOR
LOCALTIMESTAMP
SQLEXCEPTION
CORRESPONDING
LOCATOR
SQLSTATE
CUBE
MAP
SQLWARNING
CURRENT_PATH
MATCH
START
CURRENT_ROLE
MINUTE
STATE
CYCLE
MODIFIES
STATEMENT
DATA
MODIFY
STATIC
DATE
MODULE
STRUCTURE
DAY
MONTH
TEMPORARY
DEC
NAMES
TERMINATE
DECIMAL
NATURAL
THAN
DEFERRABLE
NCHAR
TIME
DEFERRED
NCLOB
TIMESTAMP
DEPTH
NEW
TIMEZONE_HOUR
DEREF
NEXT
TIMEZONE_MINUTE
DESCRIBE
NO
TRAILING
DESCRIPTOR
NONE
TRANSLATION
DESTROY
NUMERIC
TREAT
DESTRUCTOR
OBJECT
TRUE
DETERMINISTIC
OLD
UNDER
DICTIONARY
ONLY
UNKNOWN
276
DIAGNOSTICS
OPERATION
UNNEST
DISCONNECT
ORDINALITY
USAGE
DOMAIN
OUT
USING
DYNAMIC
OUTPUT
VALUE
EACH
PAD
VARCHAR
END-EXEC
PARAMETER
VARIABLE
EQUALS
PARAMETERS
WHENEVER
EVERY
PARTIAL
WITHOUT
EXCEPTION
PATH
WORK
FALSE
POSTFIX
WRITE
FIRST
PREFIX
YEAR
FLOAT
PREORDER
ZONE
FOUND
PREPARE
For the most recent reserved keyword list, see Reserved Keywords (Transact-SQL)
(http://msdn.microsoft.com/en-us/library/ms189822(v=sql.110).aspx) in SQL Server
2012 Books Online.
Additional Information
For a complete list of behavior changes in SQL Server 2008 R2 and SQL Server 2012,
see the following topics in SQL Server Books Online:
Upgrade Tools
There are two main tools available to help identify potential problems before you
upgrade to SQL Server 2012: the SQL Server 2012 Upgrade Advisor and the Best
Practices Analyzer (BPA). For details about using these upgrade tools, see Chapter 1,
"Upgrade Planning and Deployment."
SQL Server 2012 Upgrade Advisor
Perhaps the most useful upgrade tool is the SQL Server 2012 Upgrade Advisor. This is a
part of the Upgrade Assistant for SQL Server 2012 (UAFS). The Upgrade Assistant is an
external tool that lets you determine, in a test environment, how an application
currently running on SQL Server 2005, 2008, or 2008 R2 will run on SQL Server 2012.
SQL Server 2012 Upgrade Technical Guide
277
This tool quickly identifies blocking issues and many other known potential problems
so that you can address them before or during the upgrade process. You should always
run this tool on your SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2
instances, including T-SQL database code and external scripts, before upgrading.
For more information and download instructions, see Upgrade Assistant for SQL Server
2012 (UAFS) (http://www.scalabilityexperts.com/tools/downloads.html) on the
Scalability Experts Tools Downloads page. You can also find more information about
this valuable tool in Use Upgrade Advisor to Prepare for Upgrades
(http://msdn.microsoft.com/en-us/library/ms144256(v=sql.110).aspx).
SQL Server 2012 Best Practices Analyzer
You can use the SQL Server 2012 Best Practice Analyzer (BPA) to help identify bad
practices in your T-SQL database code and T-SQL scripts. You should always run BPA
on your T-SQL code before an upgrade because you might identify practices that you
need to change. The upgrade process could be the opportunity you need to implement
these changes. There are various versions of this tool, so make sure you get the one
designed especially for SQL Server 2012. You can download the SQL Server 2012 BPA
(http://www.microsoft.com/en-us/download/details.aspx?id=29302) from the Microsoft
Download Center.
64-Bit Considerations
T-SQL queries are completely compatible between 32-bit and 64-bit editions of SQL
Server 2012.
278
You can then use either the sp_updatestats stored procedure or the UPDATE
STATISTICS command to update statistics immediately to ensure optimal performance.
For more information, see:
sp_updatestats (Transact-SQL)
(http://msdn.microsoft.com/en-us/library/ms173804(v=sql.110).aspx)
Query Hints
The table hint FIRSTFASTROW is discontinued in SQL Server 2012. You have to replace
this query hint with OPTION (FAST 1) in your stored procedures, ad hoc queries, and
administrative scripts.
With a few exceptions, SQL Server 2012 requires the WITH keyword when you use a
table hint in the FROM clause of a query. You need to review your stored procedures,
ad hoc queries, and administrative scripts for table hint usage and modify the table hint
syntax to include the WITH keyword. For information about which hints do not require
the WITH keyword, see Table Hints (Transact-SQL) (http://msdn.microsoft.com/enus/library/ms187373(v=sql.110).aspx) in SQL Server 2012 Books Online.
Old Outer Join Operators
In SQL Server 2012, you cannot use old outer join operators (*= and =*). This feature is
discontinued. You have to rewrite your queries and procedures to use ANSI join syntax.
For information, see FROM (Transact-SQL) (http://msdn.microsoft.com/enus/library/ms177634(v=sql.110).aspx) in SQL Server 2012 Books Online.
Not Ending T-SQL Statements with a Semicolon
In SQL Server 2012, ending T-SQL statements with a semicolon (;) is not required, but in
future releases, it will be. Therefore, you should end all T-SQL statements with a
semicolon. For some statements, it is already required (e.g., a statement prior to WITH
or MERGE).
RAISERROR
The RAISERROR statement in the format RAISERROR integer 'string' is discontinued in
SQL Server 2012. You need to review your stored procedures, ad hoc queries, and
SQL Server 2012 Upgrade Technical Guide
279
administrative scripts for RAISERROR syntax and modify them according to the right
syntax. For information about which hints do not require the WITH keyword, see
RAISERROR (Transact-SQL) (http://msdn.microsoft.com/enus/library/ms178592(v=sql.110).aspx) in SQL Server 2012 Books Online.
COMPUTE/COMPUTE BY
This feature is discontinued in SQL Server 2012. You need to review your stored
procedures, ad hoc queries, and administrative scripts and use ROLLUP instead. For
more information, see GROUP BY (Transact-SQL) (http://msdn.microsoft.com/enus/library/ms177673(v=sql.110).aspx).
HOLDLOCK
Specifying the HOLDLOCK table hint without parentheses is deprecated in SQL Server
2012. Future versions of SQL Server will require parentheses for this table hint.
sp_dboption
The system stored procedure sp_dboption has been removed from SQL Server 2012.
You should change references to this system stored procedure in all your scripts and
use ALTER DATABASE instead.
Sending Email
Using the extended stored procedure xp_sendmail to send email messages is not
possible anymore. This extended stored procedure uses SQL Mail to send the message
and this feature has been removed from SQL Server 2012. You should change
references to extended stored procedure xp_sendmail in all your scripts and use
Database Mail instead. For more information, see Database Mail
(http://technet.microsoft.com/en-us/library/ms189635.aspx)
In-Place Upgrade
The T-SQL code in database objects will remain unchanged by a direct, in-place
SQL Server 2012 Upgrade Technical Guide
280
upgrade. Any changes you must make to the scripts should be applied after the
upgrade (see the "Post-Upgrade Tasks" section later in this chapter). In addition,
external scripts on disk will be unaffected.
Side-by-Side Upgrade
In a side-by-side upgrade, any T-SQL objects stored in the database will be
automatically moved to the new server, but their T-SQL code will remain unchanged.
You will need to ALTER or re-create the objects directly to update them as required. In
addition, you might need to move any T-SQL external scripts to a new server or correct
references within your database to those scripts.
Post-Upgrade Tasks
After upgrading to SQL Server 2012, work through the following checklist to ensure
optimum performance:
Execute DBCC CHECKDB WITH DATA_PURITY to check the database for column
values that are not valid or are out of range. After you have successfully run
DBCC CHECKDB WITH DATA_PURITY against an upgraded database, you do not
need to specify the DATA_PURITY option again because SQL Server will
automatically maintain "data purity." This is the only DBCC CHECKDB check that
you need to run as a post-upgrade task.
Update statistics by using the sp_updatestats stored procedure to ensure that all
statistics are up-to-date.
Update revised database T-SQL objects such as stored procedures and functions.
Run a set of test scripts against the new database, and validate the results.
After the upgrade, you will want to analyze how your new SQL Server 2012 instance
performs compared with your original SQL Server 2005, SQL Server 2008 or SQL Server
2008 R2 instance. See RML Utilities for SQL Server (x86) (http://www.microsoft.com/enus/download/details.aspx?DisplayLang=en&id=8161) for a suite of tools for load
testing, workload replay, and performance analysis. For additional post-upgrade details,
see Chapter 3, "Relational Databases.
Conclusion
Although SQL Server 2012 introduces a number of great new features, Microsoft has
SQL Server 2012 Upgrade Technical Guide
281
worked hard to minimize the impact on upgrading existing code. With a good
understanding of how the changes to T-SQL features might affect your stored
procedures, ad hoc queries, and administrative scripts, you can make needed fixes
before the upgrade. In addition, the Upgrade Advisor can help ease your transition
from SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2 to SQL Server 2012.
Additional References
For an up-to-date collection of additional references for upgrading T-SQL queries to
SQL Server 2012, see the Upgrade to SQL Server 2012 page
(http://technet.microsoft.com/en-us/library/bb677622.aspx) and the following links:
282
Preparing to Upgrade
The first step for preparing to upgrade to SQL Server 2012 is to search for features that
have been deprecated or discontinued. Then, you need to determine whether any
deprecated or discontinued feature will affect your upgrade. You also need to search
for changes that might prevent an upgrade (i.e., breaking changes) and changes in
feature behavior that might require modifications after the upgrade (i.e., behavior
changes).
For a complete list of depreciated features, discontinued features, breaking changes,
and behavior changes, see SQL Server Database Engine Backward Compatibility
(http://msdn.microsoft.com/en-us/library/ms143532(SQL.110).aspx).
Deprecated Features
There are no server side spatial features that are deprecated. However, client-side code
should start using IGeometrySink110 (http://msdn.microsoft.com/eses/library/microsoft.sqlserver.types.igeometrysink110.aspx) and IGeographySink110
(http://msdn.microsoft.com/eses/library/microsoft.sqlserver.types.igeographysink110.aspx) instead of IGeometrySink
SQL Server 2012 Upgrade Technical Guide
283
(http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.types.igeometrysink.aspx)
and IGeographySink (http://msdn.microsoft.com/enus/library/microsoft.sqlserver.types.igeographysink.aspx), respectively. This is needed
because of circular arcs, which are new spatial objects introduced in SQL Server 2012.
Before you upgrade, see Deprecated Database Engine Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143729(v=sql.110).aspx) for any lastminute changes.
Discontinued Functionality
When this guide was being written, there were no discontinued features for the spatial
data type in SQL Server 2012. Before you upgrade, see Discontinued Database Engine
Functionality in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms144262(v=sql.110).aspx) for any last-minute changes.
Breaking Changes
Before you upgrade, you need to be aware of several breaking changes. This section
will discuss the breaking changes brought about by improved precision in SQL Server
2012 and SQL Azure, the introduction of new type of object named FullGlobe, and an
upgrade to the Microsoft.SQLServer.Types.dll assembly. In addition, you should check
Breaking Changes to Database Engine Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143179(v=sql.110).aspx) for any lastminute breaking changes.
Improved Precision
In SQL Server 2012, all constructions and relations are now done with 48 bits of
precision compared to 27 bits used in SQL Server 2008 and SQL Server 2008 R2. This
can result in differences that range from how individual coordinates (vertices) in spatial
objects appear (rounding) to differences in computational results produced in different
versions of the database server for certain spatial operations.
You need to take this into count because SQL Azure has been recently upgraded in all
data centers to incorporate the new SQL Server 2012 spatial library. This upgrade,
which is known as the September 2011 Service Release, enables spatial operations in
SQL Azure to be identical to those in SQL Server 2012.
Some results from spatial operations in SQL Azure (after the September 2011 Service
Release) and SQL Server 2012 can differ from the results produced from spatial
operations in SQL Server 2008, SQL Server 2008 R2, and SQL Azure (before the
SQL Server 2012 Upgrade Technical Guide
284
September 2011 Service Release). In some cases, these changes will not be noticed and
will not affect the results. However, there are potential cases where this might matter.
For example, consider the following coordinate, which was processed using the
STUnion() method in SQL Server 2008 but which was not involved in the resulting
geometry:
Original Vertex Coordinate
82.339026 29.661245
In SQL Server 2012, the greater numerical precision assists in the preservation of
original coordinates of input points in most cases. Here is the result of the same
STUnion() method in SQL Server 2012 shown earlier:
Original Vertex Coordinate
82.339026 29.661245
FullGlobe
SQL Server 2012 has support for geography objects larger than a logical hemisphere.
Restricted to slightly less than a logical hemisphere in SQL Server 2008 and SQL Server
2008 R2, geography features in SQL Server 2012 can now be as big as an entire globe.
A new type of object named FullGlobe can be constructed or received as a result of an
operation. You can also construct objects because the interior for geography objects is
defined by the orientation of its rings. There is no difference between exterior and
interior rings in the geography data type.
For example, consider the three images in Figure 1. The first image shows an example
of a small hole in a FullGlobe object, the second image shows a regular polygon, and
the third image shows the union of the two, yielding a spatial object that covers the
Earth with three small holes.
UNION
yields
285
Here is sample Transact-SQL (T-SQL) code that constructs a new FullGlobe object and
executes a method on that object:
DECLARE @g GEOGRAPHY = GEOGRAPHY::STGeomFromText('FULLGLOBE',4326);
SELECT @g.STArea()-- calculate the area of the WGS84 ellipsoid
--Result: 510,065,621,710,996 meters squared
Vertex order is critical for the geography type. In SQL Server 2008 and SQL Server 2008
R2, if you enter an incorrect coordinate order for a geography polygon, you receive the
error: The specified input does not represent a valid geography instance because it
exceeds a single hemisphere. Each geography instance must fit inside a single
hemisphere. A common reason for this error is that a polygon has the wrong ring
orientation.
For the SQL Server geography data type, ring order is defined by the left-foot rule. The
left-foot rule specifies the interior region of the polygon. (When you walk the
boundary of a polygon, your left foot is always inside.) Traditional outer ring/inner ring
(hole) relationships can be modeled on the closed surface of the globe by using this
definition.
Note: The term left-foot rule is used in deference to the term left-hand rule, which
is already in use by physicists and mathematicians to describe phenomena other than
polygon ring order.
The following examples demonstrate how the geography type deals with large (greater
than a logical hemisphere) objects.
Here is an example of T-SQL code that returns a small (less than a logical hemisphere)
polygon:
DECLARE @R GEOGRAPHY;
SET @R = GEOGRAPHY::Parse('Polygon((-10 -10, 10 -10, 10 10, -10 10,
-10 -10))');
SELECT @R;
286
287
Antipodal edges are not allowed. For example, LineString(0 90, 0 -90) is
considered antipodal whereas LineString(0 90, 0 0, 0 -90) is not.
There are now two types of arcs in geography: great circle arcs defined with two
points and small circle arcs defined with three points.
Degenerate arcs will be treated as great circle arcs between the start and end
points for the geography type. (For the geometry type, degenerate arcs will be
treated as straight edges.)
EnvelopeAngle() will return 180 for objects larger than a logical hemisphere and
< 90 for objects smaller than a logical hemisphere.
288
You can work around this issue by calling the GetSqlBytes method
(http://msdn.microsoft.com/enus/library/system.data.sqlclient.sqldatareader.getsqlbytes.aspx) instead of the
methods just listed. For more information about how to use the GetSqlBytes
method, see the "SQL CLR Data Types (geometry, geography, and hierarchyid)"
section in Breaking Changes to Database Engine Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143179(v=sql.110).aspx).
Behavior Changes
You need to be aware of several behavior changes before upgrading to SQL Server
2012. This section will discuss the behavior changes resulting from enhancements to
the STEnvelope method and the geography data type in SQL Server 2012. In addition,
you should check Behavior Changes to Database Engine Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143359(v=sql.110).aspx) for any lastminute behavior changes.
STEnvelope Method
The STEnvelope method is now consistent with the behavior of other SQL Server Spatial
methods.
If you call the STEnvelope method in SQL Server 2008 and 2008 R2, you get the
following results:
select geometry::Parse('POINT EMPTY').STEnvelope().ToString()
Result: POINT EMPTY
select geometry::Parse('LINESTRING EMPTY').STEnvelope().ToString()
Result: LINESTRING EMPTY
select geometry::Parse('POLYGON EMPTY').STEnvelope().ToString()
Result: POLYGON EMPTY
When you run the same Transact-SQL (T-SQL) code in SQL Server 2012, the results will
be the following:
SQL Server 2012 Upgrade Technical Guide
289
The best practice for determining when a spatial object is empty is to call the
STIsEmpty (geometry data type) method. For more information about this method and
others, review geometry Data Type Method Reference (http://msdn.microsoft.com/enus/library/bb933973(v=sql.110).aspx).
Note: For more information about empty spatial types, see Behavior of
STEnvelope() Method Has Changed with Empty Spatial Types in Behavior Changes
to Database Engine Features in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms143359(v=sql.110).aspx).
Geography Data Type
In SQL Server 2012, geography data type supports objects that are bigger than a
hemisphere. The following methods used to return NULL if result is such object, but in
SQL Server 2012, they will return the expected result. However they are all controllable
by DB COMPATIBILITY LEVEL and will continue to return NULL if the compatibility level
is set to 100.
290
In addition, a new spatial type is added, called FullGlobe (represents entire globe),
which may be returned by all methods specified above or methods like ToString(),
STAsText(), and similar (that return binary or text representation of a geography object).
Post-Upgrade Tasks
After you complete the upgrade to SQL Server 2012, review and make changes in your
code to get the best performance from the new spatial data features.
For information on upgrading to SQL Server 2012, see Chapter 1, Upgrade Planning
and Deployment, and Chapter 3, Relational Databases, in this guide. For information
about the new spatial data features, see Spatial Data (SQL Server)
(http://msdn.microsoft.com/en-us/library/bb933790(v=sql.110).aspx) in SQL Server
2012 Books Online.
Conclusion
When you upgrade to SQL Server 2012, the effort for spatial data is very minimal. Just
be sure to check for behavior changes, especially with the STEnvelope method.
The new spatial features and improvements in SQL Server 2012 provide a major
milestone in the evolution of SQL Server spatial data support. The ability to support full
globe spatial objects and circular arcs on the ellipsoid are industry firsts for relational
database systems.
After you have your databases upgraded to SQL Server 2012, all these new features
and improvements will be available to you.
Additional References
291
Preparing to Upgrade
Before upgrading to SQL Server 2012, you should investigate which features are
discontinued or deprecated in SQL Server 2008 R2. These features will not affect your
upgrade, but you might need to change your applications and queries. You also need
to know what functionality cannot be upgraded because is it discontinued or because it
has changed in SQL Server 2012. Plus, you need to be aware of some behavior changes
in XML support between in SQL Server 2005, 2008, 2008 R2, and 2012; otherwise, you
could get unexpected results. Lets look at each of these categories of changes. For a
complete reference of XML changes in SQL Server 2012, see SQL Server Database
Engine Backward Compatibility (http://msdn.microsoft.com/enus/library/ms143532(SQL.110).aspx) in SQL Server 2012 Books Online.
Deprecated Features
You can validate XML documents against a schema. An old XML schema language is
XML Data Reduced (XDR) language. You can create XDR documents with the XMLDATA
directive in the FOR XML clause of the SELECT T-SQL statement. The current validation
language is called XML Schema, which is stored in XML Schema Document (XSD) XML
files. SQL Server 2005 supports XSD generation. In SQL Server, you can validate XML
SQL Server 2012 Upgrade Technical Guide
292
Note that AdventureWorksDW is the 2005 version of the AdventureWorks demo data
warehouse. We have chosen this version of the demo database in order to make
examples work on any SQL Server version from 2005 to 2012.
The following code generates XSD instead of XDR schema:
SELECT C.CustomerKey,
C.FirstName + ' ' + C.LastName AS CustomerName,
I.SalesAmount
FROM dbo.DimCustomer AS C
INNER JOIN dbo.FactInternetSales AS I
ON C.CustomerKey = I.CustomerKey
WHERE 1 = 0
FOR XML AUTO, XMLSCHEMA;
Discontinued Functionality
There is no discontinued functionality for XML and XQuery support in SQL Server 2012.
So, you do not have to worry about this.
Breaking Changes
From SQL Server 2012, XQuery string functions are surrogate pair-aware. SQL Server
Unicode data types, including NCHAR, NVARCHAR, and XML, encode text in UTF-16
format. SQL Server allocates for each character a unique codepoint, a value in the range
0x0000 to 0x10FFFF. Most of the characters fit into a 16-bit word. Characters with
SQL Server 2012 Upgrade Technical Guide
293
codepoint values larger than 0xFFFF require two consecutive 16-bit words (i.e., two
bytes). These characters are called supplementary characters, and the two consecutive
16-bit words are called surrogate pairs.
The standard World Wide Web Consortium (W3C) recommendation for XQuery
functions and operators requires them to count a surrogate pair as a single character.
In SQL Server versions prior to 2012, XQuery string functions did not recognize
surrogate pairs as a single character. For example, string length calculations returned
incorrect results.
The XML data type in SQL Server only allows well-formed surrogate pairs. However, it is
possible to pass invalid or partial surrogate pairs to XQuery functions as string values.
Below is an example of providing surrogate pairs to XML data type variable through
string values. The value of the CustomerName element is 12. The first three
characters of the name are surrogate pairs. The length of this value is 5. However, in
versions before SQL Server 2012, you would get a length of 8.
If you execute the following code in SQL Server 2005, 2008, or 2008 R2
DECLARE @x AS NVARCHAR(MAX), @y AS XML;
SET @x=
N'<C11003>
<CustomerKey>11003</CustomerKey>
<CustomerName>12</CustomerName>
<SalesAmount>2294.9900</SalesAmount>
</C11003>';
SET @y = CAST(@x AS XML);
SELECT @y.query('
for $i in /C11003
return
<NumberOfCharacters>
{ string-length($i/CustomerName[1]) }
</NumberOfCharacters>
');
This changed behavior affects the following XQuery functions, operators, and clauses:
fn:string-length
SQL Server 2012 Upgrade Technical Guide
294
fn:substring
Comparison operators including +, <, >, <=, >=, eq, lt, gt, le, and ge (only when
the compatibility level is 110 or higher)
If you are upgrading from SQL Server 2005, you should also consider breaking changes
in SQL Server 2008 and 2008 R2.
In SQL Server 2005, the data types xs:time, xs:date, and xs:dateTime do not allow time
zone supportdata is always mapped to the Coordinated Universal Time (UTC) time
zone. Starting with version 2008, SQL Server provides standard conformant behavior.
This behavior includes:
The internal storage representation is modified. This does not have any influence
on your applications.
The sqltypes schema namespace has been extended to include the date and time SQL
Server data types introduced in version 2008, including TIME, DATE, DATETIME2, and
DATETIMEOFFSET. You can also use the XML data type value() method to cast XML
elements and attributes to the new SQL Server date and time data types. The following
code does not run on SQL Server 2005; however, it runs on SQL Server 2008 and later.
It shows usage of the new date and time data types.
DECLARE @myDoc AS XML;
DECLARE @OrderID AS INT;
DECLARE @OrderDate AS DATE;
DECLARE @OrderTime AS TIME;
DECLARE @OrderDateTime AS DATETIMEOFFSET;
SET @myDoc = '
<Root>
<OrderDescription
OrderID="1" OrderDate="2012-02-10"
OrderTime="13:40:58.47786" OrderDateTime="1999-12-20 13:40:58.123-05:00">
</OrderDescription>
</Root>';
295
SET @OrderID =
@myDoc.value('(/Root/OrderDescription/@OrderID)[1]', 'int');
SET @OrderDate =
@myDoc.value('(/Root/OrderDescription/@OrderDate)[1]', 'date');
SET @OrderTime =
@myDoc.value('(/Root/OrderDescription/@OrderTime)[1]', 'time');
SET @OrderDateTime =
@myDoc.value('(/Root/OrderDescription/@OrderDateTime)[1]',
'datetimeoffset');
SELECT @OrderID,@OrderDate,@OrderTime,@OrderDateTime;
Finally, in SQL Server 2005, steps in an XQuery or XML Path Language (XPath)
expression that begin with a colon are allowed. This behavior does not conform to XML
standards and is disallowed in all versions after SQL Server 2005. For example, the
following code works on SQL Server 2005:
DECLARE @x AS XML;
SET @x=
N'<C11003>
<CustomerKey>11003</CustomerKey>
<CustomerName>Customer 1</CustomerName>
<SalesAmount>2294.9900</SalesAmount>
</C11003>';
SELECT @x.query('
for $i in /C11003
return $i/:CustomerName[1]
');
However, this code does not work on SQL Server 2008 or later. You should remove the
colon on these versions.
Behavior Changes
The XML data type value() method has changed internally. In previous versions, the
value method internally converted the source value to an xs:string, and then converted
the xs:string to the target SQL Server data type. In SQL Server 2012, the conversion to
xs:string is skipped in some cases. This means that some queries are slightly faster. This
conversion is skipped if:
The source XML data type is byte, short, int, integer, long, unsignedByte,
unsignedShort, unsignedInt, unsignedLong, positiveInteger, nonPositiveInteger,
negativeInteger, or nonNegativeInteger, and the destination SQL data type is
TINYINT, SMALLINT, INT, BIGINT, DECIMAL, or NUMERIC.
The source XML data type is decimal, and the destination SQL data type is
DECIMAL or NUMERIC.
The source XML data type is float, and the destination SQL data type is REAL.
SQL Server 2012 Upgrade Technical Guide
296
The source XML data type is double, and the destination SQL data type is FLOAT.
In addition, if the XML data type exist() function returns NULL and is used in
comparison with 0, the comparison returns NULL in SQL 2012. Such a comparison
returned TRUE in previous versions. Consider the following code:
DECLARE @test AS XML;
SET @test = NULL;
-- Returns 0 in SQL Server 2012 and 1 in earlier editions
SELECT COUNT(1) WHERE @test.exist('/whatever') = 0;
-- Returns 1 in all editions
SELECT COUNT(1) WHERE @test.exist('/whatever') IS NULL;
The first query returns 0 in SQL Server 2012, while it returns 1 in previous editions.
Post-Upgrade Tasks
After you upgrade SQL Server Database Services to version 2012, you should consider
revising your code in order to benefit from the new features. There are not many new
features regarding XML and XQuery in SQL Server 2012; however, some new features
were added in SQL Server 2008. Therefore, if you are upgrading from SQL Server 2005,
you might decide to make more code changes than when upgrading from SQL Server
2008 or 2008 R2.
sys.xml_schema_components
sys.xml_schema_attributes
sys.xml_schema_component_placements
The following three queries return one row each in SQL Server 2012 and zero rows in
previous versions:
SQL Server 2012 Upgrade Technical Guide
297
If you validate your XML data type values against an XML schema collection, the
schema collection is upgraded when you upgrade your database as well. After the
upgrade, the new supplementaryCharacters global attribute is exposed in your
upgraded XML schema collection if the schemas in the collection import the SQL Types
XML schema. Finally, the new supplementaryCharacters global attribute is added to
XML column set values that represent UTF-16 collation sql_variant strings.
298
with a predicate, sort the nodes, and format the returned XML. The parts of a FLWOR
statement are:
For. With the for clause, you bind iterator variables to input sequences. Input
sequences are either sequences of nodes or sequences of atomic values. You
create atomic value sequences using literals or functions.
Let. With the optional let clause, you assign a value to a variable for a specific
iteration. The expression used for assignment can return a sequence of nodes or
a sequence of atomic values.
Where. With the optional where clause, you filter the iteration.
Order by. Using the order by clause, you can control the order in which the
elements of the input sequence are processed. You control the order based on
atomic values.
Return. The return clause is evaluated once for each iteration, and the results
are returned to the client in the iteration order.
In SQL Server 2005, the let clause is not supported. Consider the following example:
DECLARE @x AS XML;
SET @x = N'
<CustomersOrders>
<Customer custid="1">
<!-- Comment 111 -->
<companyname>Customer NRZBB</companyname>
<Order orderid="10692">
<orderdate>2007-10-03T00:00:00</orderdate>
</Order>
<Order orderid="10702">
<orderdate>2007-10-13T00:00:00</orderdate>
</Order>
<Order orderid="10952">
<orderdate>2008-03-16T00:00:00</orderdate>
</Order>
</Customer>
<Customer custid="2">
<!-- Comment 222 -->
<companyname>Customer MLTDN</companyname>
<Order orderid="10308">
<orderdate>2006-09-18T00:00:00</orderdate>
</Order>
<Order orderid="10952">
<orderdate>2008-03-04T00:00:00</orderdate>
</Order>
</Customer>
</CustomersOrders>';
299
Both queries return the same result. In the for loop, the query iterates through all Order
nodes using an iterator variable and returns those nodes. The resulting XML instance is
filtered by the orderid attribute. The orderid attribute is converted to an element by
creating the element manually and extracting only the value of the attribute with the
data() function. The orderdate element is returned as well, both wrapped in the Orderorderid-element element. Note the braces around the expressions that extract the
value of the orderid element and the orderdate element. XQuery evaluates expressions
in braces; without braces, everything would be treated as a string literal and returned as
such. The result is ordered by the orderdate element.
Note that in the first query, the orderdate element of the $i iterator variable is referred
twice, once in the order by clause and once in the return clause. You can spare some
typing if you use the let clause to assign a name to the repeating expression. To name
the expression, you have to use a variable different from $i (e.g., $j) in the second
query.
Conclusion
You probably wont decide to upgrade to SQL Server 2012 only because of the new
XML and XQuery features. However, there are many other reasons for the upgrade. And
once you have your database upgraded, you can start exploiting XML and XQuery
improvements as well.
300
Additional References
301
Preparing to Upgrade
To prepare for the CLR upgrade process, you need review the changes that could block
your upgrade or change the behavior of your applications after the upgrade.
Breaking Changes
Breaking changes are those changes that introduce the possibility of blocking an
upgrade.
The .NET Framework
The SQL Server 2012 CLR is based on the .NET Framework 4.0, which replaces the .NET
Framework 2.0 used by previous versions of SQL Server. This means compatibility issues
between the previous versions of the .NET Framework (1.0, 2.0, 3.0, 3.5, 3.5 SP1) and the
.NET Framework 4.0 are also applicable to SQL CLR assemblies. For details on whats
new in the .NET Framework 4.0, see:
SQL Server 2012 Upgrade Technical Guide
302
Note: As far as the upgrade to SQL Server 2012 is concerned, the .NET Framework is
part of the installation process.
Behavior Changes
Behavioral changes are those changes that do not block the upgrade process but you
need to be aware of them as they might affect the existing CLR objects because of the
way the .NET Framework 4.0 works.
Managed Code Can No Longer Catch Exceptions from Corrupted Process States
In version 4.0 of the CLR, CLR database objects no longer catch corrupted state
exceptions (e.g., access violations) in catch blocks. These exceptions are now caught in
the CLR integration hosting layer. The <legacyCorruptedStateExceptionsPolicy> setting
in the .NET Framework 4.0 that would enable applications to catch exceptions for
corrupted process states is not available in SQL Server 2012, so the only method to
catch these exceptions is to apply the
System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute to
the method that contains the exceptions catch block. For details, see
HandleProcessCorruptedStateExceptionsAttribute Class (http://msdn.microsoft.com/enus/library/system.runtime.exceptionservices.handleprocesscorruptedstateexceptionsattr
ibute.aspx).
Here is an example of applying this attribute:
using System.Runtime.ExceptionServices
/*
Individual managed methods can override the defaults and catch these
exceptions by applying the HandleProcessCorruptedStateExceptions attribute to
the method.
*/
[HandleProcessCorruptedStateExceptions]
public static void HandleCorruptedState()
{
// Write Exception Notification code here.
// Can log or send mail to admin, etc.
}
303
304
When you move a custom application from a computer on which SQL Server
2008 R2 was installed to a computer on which only SQL Server 2012 is installed,
the application will fail because the referenced version 10.0 of the SqlTypes
assembly is not present. You may see this error message: Could not load file or
assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system
cannot find the file specified.
When you reference the SqlTypes assembly version 11.0 and version 10.0 is also
installed, you may see this error message: System.InvalidCastException: Unable
to cast object of type 'Microsoft.SqlServer.Types.SqlGeometry' to type
'Microsoft.SqlServer.Types.SqlGeometry'.
SQL Server 2012 Upgrade Technical Guide
305
When you reference the SqlTypes assembly version 11.0 from a custom
application that targets the .NET Framework 4.0 or 4.5, the application will fail
because SqlClient by design loads version 10.0 of the assembly. This failure
occurs when the application calls one of the following methods:
o GetValue method of the SqlDataReader class
o GetValues method of the SqlDataReader class
o bracket index operator [] of the SqlDataReader class
o ExecuteScalar method of the SqlCommand class
Changing the connection string. In .NET 4.5 and later, client applications can use the
Type System Version property of the connection string to set up the version of types
used on the client. If Types System Version = 2012 is specified, the client will load
version 11.0.0.0 of Microsoft.SqlServer.Types.dll. If not, version 10.0.0.0 will be loaded
by default.
Note: .NET 4.5 will deprecate the Type System Version = Latest option. That option
will stay locked into SQL Server 2008 and will always load version 10.0.0.0.
Using the GetSqlBytes method. You can work around this issue by calling the
GetSqlBytes method instead of the Get methods to retrieve CLR SQL Server system
types, as shown in the following example:
306
307
Type
Description
total_processor_time_ms
bigint
total_allocated_memory_kb
bigint
survived_memory_kb
bigint
Additional References
For an up-to-date collection of additional references for upgrading CLR objects, refer
to the following links:
Support policy for untested .NET Framework assemblies in the SQL Server CLRhosted environment
(http://support.microsoft.com/kb/922672)
309
Preparing to Upgrade
Before upgrading to SQL Server 2012, you should investigate which features are
deprecated or discontinued.
Deprecated Features
Several SQL Server 2005/2008/2008 R2 features have been deprecated in SQL Server
2012. When you upgrade to SQL Server 2012 SMO, you might have to modify the code
by changing or removing deprecated functionalities. For more information about
deprecated features, see Deprecated Database Engine Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143729(v=sql.110).aspx) in SQL Server
2012 Books Online.
SQL Server 2012 Upgrade Technical Guide
310
There are also several deprecated objects into SMO libraries that will be removed in
future SQL Server versions. Table 1 shows the deprecated SMO objects in SQL Server
2012. For more information, see Deprecated Management Tools Features in SQL Server
2012 (http://msdn.microsoft.com/en-us/library/cc879341(v=SQL.110).aspx) in SQL
Server 2012 Books Online.
Table 1: Deprecated Objects in SMO
Deprecation
Feature
Stage
Microsoft.SQLServer.Management.Smo.Information class
Announcement
Microsoft.SQLServer.Management.Smo.Settings class
Announcement
Microsoft.SQLServer.Management.Smo.DatabaseOptions class
Announcement
Microsoft.SqlServer.Management.Smo.DatabaseDdlTrigger.NotForReplication
Announcement
property
Discontinued Functionality
When you upgrade to SQL Server 2012 SMO, you might have to modify the code by
changing or removing discontinued functionalities. For more information about general
database engine discontinued features, see Discontinued Database Engine
Functionality in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms144262(v=sql.110).aspx) in SQL Server 2012 Books Online.
Keep in mind that if you are still using SQL-DMO, you should be aware that this
functionality is no longer included in SQL Server 2012 and must be converted to use
SMO. For more information about SQL-DMO mapping to SMO, see SQL-DMO
Mapping to SMO (http://msdn.microsoft.com/en-us/library/ms162159(v=sql.110).aspx)
in SQL Server 2012 Books Online.
311
Cache (GAC) with the SQL Server SDK installation option. The assemblies are located in
C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\ with release number
11.0.0.0, as Figure 1 shows.
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.Management.Sdk.Sfc
SmoEnum.dll has been removed, so references to this DLL must be removed from the
SMO project.
If your code uses Urn functionality, such as Server.GetSqlSmoObject(Urn), you must
also reference and link to the Microsoft.SqlServer.Management.Sdk.Sfc namespace. If
your code uses the Transfer object directly, you will have to link to the
Microsoft.SqlServer.Management.SmoExtended namespace. For more information
SQL Server 2012 Upgrade Technical Guide
312
about SMO assemblies, see Files and Version Numbers (http://msdn.microsoft.com/enus/library/ms162161(v=sql.110).aspx) in SQL Server 2012 Books Online.
Load the SMO assemblies using the PowerShell 2.0s AddType cmdlet
Add-Type -AssemblyName Microsoft.SqlServer.Smo
Existing PowerShell scripts should work without modifications because the PowerShell
runtime loads the latest version of the SMO assemblies, which are fully compatible with
older SQL Server versions.
Conclusion
Upgrading SMO projects to SQL Server 2012 can be a straightforward process. By
referencing new DLLs and recompiling existing applications, it is possible to access new
features exposed by new SMO libraries (to manage AlwaysOn Availability Groups, for
example).
313
Additional References
For an up-to-date collection of additional references for upgrading SMO projects to
SQL Server 2012, see the following links:
Overview (SMO)
(http://msdn.microsoft.com/en-us/library/ms162557(v=sql.110).aspx)
314
BI Tools Users
BI includes the participation of professionals in different business roles, with users and
technical professionals having different perspectives and different reasons for using
various tools. User roles for the BI tools fall into three categories, which generally
include business information workers, software developers, and system administrators.
Excel 2010
Report Builder
315
Software Developers
Members of this role write complex queries and custom programming code to process
business rules and give reports conditional formatting and behavior. Developers may
prefer to work within the SQL Server Data Tools (SSDT) report designer environment
because it is similar to familiar programming tools. SSDT and other editions of Visual
Studio 2010 support multi-project solution management, version control, and team
collaboration. Report design is not the same as application development, but reports
can be integrated into custom dashboards and applications. Designing a report can be
faster and easier in some ways than developing software. Advanced report design can
involve writing code and even developing custom components.
System Administrators
System administrators are typically concerned with the setup and ongoing
maintenance of servers and the infrastructure to keep reporting solutions available and
working. Administrators typically spend their time and energy managing security and
optimizing the system for efficiency. Reporting Services has an administrative
component that is especially important in large-scale implementations.
In smaller organizations, the same person may play the role of system administrator,
developer, and report designer. As an Administrator, your primary management tools
for BI projects and components will be SQL Server Management Studio (SSMS),
configuration tools, and SQL Server Profiler. For Reporting Services, you will use Report
Manager in native mode and the SharePoint context menus for reports in SharePoint
integrated mode. For other BI content in SharePoint, you will use the context menus
and SharePoint configuration pages.
BI Tools Overview
The term BI tools refers to a collection of several configuration and design
applications that can be found in a few different places, including the Windows Start
menu, SharePoint, and Office application add-ins. To get started, we will enumerate
these tools and show you where to find them. To locate many of the available tools, a
good place to start is the Windows Start menu shown in Figure 1.
316
Figure 1: Windows Start menu with SQL Server 2012 tools and shortcuts
Referring to these menu items, the BI tools covered in this chapter include:
317
Additional tools that dont appear on the Start Menu in this configuration include:
Report Builder
Power View
318
Integration Services
Reporting Services
Database
Additionally, the New Project dialog box includes templates that will launch wizards
enabling you to create projects from imported objects. These include an Analysis
Services Multidimensional project imported from a server database, an Analysis
Services Tabular project imported from a server database, and an Analysis Services
Tabular project imported from a PowerPivot Excel workbook file. A Reporting Services
project can also be created using the Report Server Project Wizard. This feature works
just as it did in earlier versions of BIDS. Selecting the Database project type from the
SQL Server group will prompt you to download and install the Database Projects
template using the Web Platform Installer, as shown in Figure 2.
319
320
the project. Reports created for SQL Server 2008 can optionally be upgraded to the
2008 R2 standard. SQL Server 2012 does not introduce a new report definition
language (RDL) version and allows you to deploy reports in one of two compatibility
modes, which include SQL Server Reporting Services (SSRS) 2008 and SSRS 2008 R2.
Refer to Chapter 18, Reporting Services, for guidance on planning a Reporting
Services project upgrade and for upgrading reports deployed to a report server.
BI Semantic Tabular Model Projects
The BI Semantic Tabular Model project type is introduced in SQL Server 2012. The
designer experience in SSDT has many similarities to the PowerPivot for Excel 2010
add-in. A significant difference is that, even during the design stage, tabular model
data and metadata is stored is a live SQL Server 2012 Analysis Services (SSAS) instance
configured for tabular storage. This means that a developer must have connectivity to
the development SSAS database server or must have a local instance installed. Figure 3
shows the tabular model project designer in SSDT.
321
Management Tools, for details about using SSMS to upgrade earlier SQL Server
versions and to manage new features in SQL Server 2012.
SQL Server 2012 includes many enhancements and user interface improvements for
solution development and administration of the SQL Server Database Engine, Analysis
Services, and Reporting Services. Like SSDT, SSMS utilizes the Visual Studio shell,
providing more extensible support and compatibility. SSMS is a vital tool for upgrading
to SQL Server 2012. Database objects from earlier SQL Server version can be scripted
and converted. Backward compatibility and the ability to upgrade databases are
provided for versions back to SQL Server 2005 (90). Be mindful that databases can only
be upgraded and not converted. For specific considerations and details regarding
compatible editions and product versions for upgrade, see Use SQL Server
Management Studio (http://msdn.microsoft.com/enus/library/ms174173(v=sql.110).aspx) in SQL Server 2012 Books Online.
322
report server content database in native mode. To migrate the instance from native to
SharePoint integrated mode, use the Central Administrator. Note that existing report
content will not be moved in either case. The recommended approach to migrate
existing report server content is to save reports, shared data sources, and data sets to
files in the file system and then upload them using SharePoint or an SSDT report
project. More information about migrating report server instances and switching
integration modes may be found in Configuration and Administration a Report Server
(Reporting Services SharePoint Mode) (http://msdn.microsoft.com/enus/library/ms159624(v=sql.110).aspx).
323
You can also run the conversion wizard as a stand-alone application. To do this, use a
command prompt, create a shortcut, or locate the SSISUpgrade.exe file located in the
C:\Program Files\Microsoft SQL Server\110\DTS\Binn folder.
The Integration Services Project Conversion Wizard will allow you to save a backup
copy of any converted package or SSIS project prior to converting the files to work with
SQL Server 2012 Integration Services. The location of the converted files and backup
folders created by the wizard may be different depending on the method used to
launch the wizard. For details, see Upgrade Integration Services Packages Using the
SSIS Package Upgrade Wizard (http://msdn.microsoft.com/enus/library/cc280547(v=sql.110).aspx).
Report Builder
The Report Builder design tool in SQL Server 2012 is similar to Report Builder 3.0 in
SQL Server 2008 R2 and includes the same feature set. The original Report Builder tool,
available in SQL Server 2005 (and later called Report Builder 1.0) is deprecated in SQL
Server 2012, along with the first-generation semantic report models and report model
projects.
Report Builder is available by default when Reporting Services is installed in native or
SharePoint integrated mode. Report Builder can be launched directly from the web
browser using Report Manager in native mode or from a document library in
SharePoint integrated mode. The first time a user opens Report Builder from a report
server or SharePoint site collection, it will be installed to their desktop as a .NET
ClickOnce application. Note that if a user were to navigate to a different site collection
or report server, they will be prompted to install Report Builder multiple times. This is
expected behavior.
SQL Server 2012 Upgrade Technical Guide
324
To open Report Builder in native mode and create a new report, navigate to Report
Manager (typically http://<server name>/Reports by default), and in any report folder,
click the Report Builder button on the toolbar.
To edit an existing deployed report with Report Builder, hover the mouse pointer over
the report name in Report Manager, click the down arrow, and select Edit in Report
Builder. In SharePoint, the context menus work exactly the same way.
To create a new report with Report Builder in SharePoint integrated mode, a document
library must be configured to include the Report Builder Report content type. For
information on how to add a content type to a library, see Add Report Server Content
Types to a Library (Reporting Services in SharePoint Integrated Mode)
(http://msdn.microsoft.com/en-us/library/bb326289(v=sql.110).aspx).
To open Report Builder, navigate to the document library and choose the Documents
tab under the Library Tools group. In the left-side ribbon, select the Report Builder
Report option on the New Document menu.
Report Builder can also be installed to run as a standalone application. It can then be
launched from the Windows Start menu.
The highest compatibility level for reports created with either Report Builder or SSDT in
SQL Server 2012 is SQL Server 2008 R2. Both Report Builder and SSDT can be used to
deploy reports with SQL Server 2008 compatibility. Note that certain features may be
lost in 2008 compatibility mode that cannot be recovered if they are saved again to the
newer version.
325
PowerPivot models can be visualized using an Excel PivotTable or PivotChart, the Power
View visualization tool in SharePoint 2010, or any reporting tool that can consume a
SQL Server 2012 BI Semantic Tabular Model. The volume of data in a PowerPivot model
is limited to the file size restrictions for Excel, which is 2 GB per file. This happens to be
the same document size restriction in SharePoint, due to the data type used to store
list and library data in the SharePoint SQL Server content database. You should store
only text and numeric values in a PowerPivot model and not binary, image, XML,
geospatial, and other structured data types. Following these guidelines, a PowerPivot
workbook can be used to store a large volume compressed data. To download the
PowerPivot add-in for Excel 2010 and to learn more about PowerPivot, visit the
PowerPivot product site (http://www.microsoft.com/en-us/bi/powerpivot.aspx).
The PowerPivot for Excel 2010 add-in has been updated with SQL Server 2012. Figure 4
shows PowerPivots new graphical relationship designer. Another improvement is that
there is no dependence on having any installed SQL Server instance for desktop users.
326
Power View
Power View is one of the most notable additions to the SQL Server 2012 BI and
SharePoint arsenal. This tool enables a powerful data visualization experience that was
designed with business users in mind. Power View may be easy to use, but it is not light
on capabilities and useful features for serious business data analysis. Do not think of
Power View as a report design tool like SSDT report designer or Report Builder. Power
View is a utility to browse and visualize information in order to make it more graphical
and meaningful. With it, business users can gain insights and make impactful
presentations with data in prepared semantic models.
Data sources are either a PowerPivot workbook published to SharePoint 2010 or a BI
semantic tabular model, stored in an Analysis Services tabular instance. In SharePoint
2010, you can launch Power View directly from a published PowerPivot workbook or
from a BISM or RSDS connection defined in a SharePoint connection library. A
connection can provide connectivity to a PowerPivot workbook or tabular model.
The tool is highly-interactive. Figure 5 shows a Power View report with multiple related
visuals. When the name of an airline is clicked in the bar chart on the right side, this
acts a slicer, filtering the highlighted data displayed in the stacked column series chart
on the left.
327
Power View is installed and enabled in SharePoint 2010 Enterprise Edition with the
Reporting Services add-in for SharePoint 2010. To use Power View with published
PowerPivot workbooks, the PowerPivot add-in for SharePoint 2010 must also be
installed and configured.
As with any production solution, an upgrade should be tested and validated on a nonproduction server using a backup copy of the databases and deployed objects. The
Visual Studio Conversion Wizard and each of the project type-specific conversion
utilities perform backups but it is always a good idea to create a master backup of
SQL Server 2012 Upgrade Technical Guide
328
these project files on separate media. The most reliable way to backup a project is to
copy the entire directory structure, starting with the solution folder, including all
projects and subfolders, to a network share or external storage device.
Any configuration change comes with an inherent risk so its advisable to proceed with
caution and to have a comprehensive recovery plan. Some product features in SQL
Server 2012 have changed more than others and if you plan to take advantage of these
improvements, you should consider the potential impact of making a change to an
existing solution. Table 1 provides some considerations for upgrading each project
type.
Table 1: Upgrade Considerations for the Types of Projects
Project Type
Integration Services
Considerations
Convert the BIDS project to SSDT.
Convert and test each package in the SSDT
designer. Redeploy and thoroughly test all
packages on a test server and then in
production.
Use the Convert to Package Deployment
Model to check compatibility.
Analysis Services
Multidimensional
Analysis Services
Tabular
Reporting Services
Database Project
When planning to upgrade multiple projects of different types that were created using
SQL Server 2008 or SQL Server 2008 R2, be mindful that the upgrade story for these
different SQL Server services is somewhat different. Each project type (SSIS, SSAS, and
SSRS) may be upgraded to the SQL Server 2012 project type, but the upgrade path for
SQL Server 2012 Upgrade Technical Guide
329
the individual files within those projects may be different. Integration Services object
definition files have changed significantly compared to SSAS and SSRS object definition
files, and in some cases, these files do not need to be upgraded. For those that do
require an upgrade, SSDT will prompt you to upgrade files created in BIDS for SQL
Server 2008 and 2008 R2 and will update those files to the appropriate version.
You cant depend on Windows to open projects for conversion from the file system.
When a BIDS/Visual Studio 2008 project or solution is opened from Windows Explorer,
it will simply open in that version of the BIDS designer. To upgrade the project, start
SSDT and then open the solution or project from the File menu. Figure 6 shows the
Visual Studio Conversion Wizard.
330
Visual Studio 2010 database projects converted to SSDT 2012 database projects
will not include:
o Properties such as Server.sqlsettings and SQLCMD variables defined in
.sqlcmd files
o Partial projects
o Unit test projects
o Data generation files
o Extensibility files
Some SSIS packages may contain properties that will not be compatible with the
new project deployment model. When converting these packages, the Convert
to Package Deployment Model dialog box will analyze compatibility and inform
you about any restrictions.
SSAS Tabular Model projects dont have all of the capabilities of SSAS
Multidimensional Model projects. The differences between these tools and
architectures are extensive. Consider these differences if you plan to replace
SQL Server 2012 Upgrade Technical Guide
331
Additional References
The following resources may be helpful to plan and configure the tools for your SQL
Server 2012 upgrade:
Configuration guides, troubleshooting advice, and other in-depth articles and papers
related to SQL Server and SharePoint BI tools and architecture are available from the
SQL Server Customer Advisory Team (SQLCAT) web site (http://sqlcat.com).
332
333
SQL Server 2008 R2 did not place the focus on SSAS specifically. There were not a
significant number of new SSAS features in SQL Server 2008 R2 compared to SQL
Server 2008.
SSAS has been significantly upgraded in SQL Server 2012. SQL Server 2012 added the
tabular model and introduced the Business Intelligence Semantic Model (BISM). One
choice that must be made when performing an upgrade is whether to continue using
the multidimensional model or to switch to the tabular model. You cannot specifically
upgrade a multidimensional instance to tabular mode, but you can install a new
instance of SSAS that supports tabular model solutions and run both instances side by
side. In other words, you can upgrade an instance of the multidimensional instance, or
you can add a new instance of the tabular model. Since the tabular model did not exist
in previous versions of SQL Server, there is no upgrade for it. For more information, see
Install Analysis Services in Tabular Mode (http://msdn.microsoft.com/enus/library/hh231722(v=sql.110).aspx).
For information on how to upgrade data mining models, see Chapter 19, Data
Mining.
For information on how to upgrade PowerPivot, see:
In-Place Upgrade
With an in-place upgrade, the SSAS 2005, 2008, or 2008 R2 engine and associated tools
are removed and replaced by SSAS 2012. During the upgrade process, the older SSAS
database metadata is moved to SSAS 2012, and the upgraded databases do not need
to be reprocessed.
SQL Server 2012 Upgrade Technical Guide
334
After the in-place upgrade is complete, only SSAS 2012 will remain. An in-place
upgrade is an all-or-nothing approach. If an in-place upgrade fails, you must roll back
to an earlier version. (There is a go/no-go point in the Setup program before which you
can cancel the upgrade.) To roll back to an earlier version of SSAS after an upgrade to
SSAS 2012, you have to uninstall SSAS 2012, restart, reinstall the older version of SSAS,
and restore the SSAS databases. Downtime because of upgrade problems can be
significant and backups of the existing SSAS databases are critical.
Side-by-Side Upgrade
With a side-by-side upgrade, you install an instance of SSAS 2012 alongside the
existing version of SSAS, which remains until uninstalled. During the upgrade process,
users can continue to access the databases in the older versions of SSAS, which are
unaffected by the upgrade process. After a side-by-side upgrade is complete, both the
previous version of SSAS and SSAS 2012 are installed. You can move and test database
metadata without affecting the previous SSAS installation. After SSAS 2012 is fully
tested, the older version of SSAS can be uninstalled.
Note: With a side-by-side upgrade, you can either use the existing server
environment for the new installation or install SSAS 2012 on a new server.
Important: The side-by-side upgrade option provides for greater availability during
the upgrade process, simplifies rollback (should that be required), and results in
simpler testing scenarios because both versions are available at the same time.
Be aware that you cannot do a side-by-side upgrade of PowerPivot on the same
machine. It has a hardcoded instance name, so if you tried to install a new instance, you
would get an error. You can put it on a different machine as a new instance.
Both upgrade options will result in SSAS 2012 versions of the databases from a given
instance of SSAS 2005, 2008, or 2008 R2.
335
If you are upgrading from SQL Server 2005, Upgrade Advisor helps you determine
whether you will encounter breaking issues during an upgrade. If Upgrade Advisor
reports any of these issues, follow its recommendations and guidance for possible
mitigation options and strategies. For more information about how to install and run
this tool, see Chapter 1, Upgrade Planning and Deployment. There is also a category
of issues that either cannot be detected by Upgrade Advisor or whose detection would
result in too many false-positive results.
The following sections discuss the most important upgrade issues. For a complete list
of backward-compatibility issues, breaking changes, and behavior changes to SSAS
2012, see Analysis Services Backward Compatibility (http://technet.microsoft.com/enus/library/ms143479(v=sql.110).aspx) in SQL Server 2012 Books Online.
Note: The list of discontinued, deprecated, behavior, and breaking changes from
SSAS 2005 to SSAS 2008/2008 R2 is important to understand if you are moving
from SSAS 2005 to SSAS 2012. For more information, see Chapter 11, Analysis
Services, in the SQL Server 2008 R2 Upgrade Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
Deprecated Features
Table 1 describes the most common SSAS objects and settings that are deprecated in
SQL Server 2012, which means that they will not be supported in future releases of SQL
Server.
Table 1: Deprecated Objects and Settings
Deprecated Feature/Functionality
Comments
336
Deprecated Feature/Functionality
Comments
Language (PMML)
For more information about deprecated features in SSAS 2012, see Deprecated Analysis
Services Functionality in SQL Server 2012 (http://technet.microsoft.com/enus/library/ms143346(v=sql.110).aspx) in SQL Server 2012 Books Online.
Discontinued Functionality
There are two features no longer available in SSAS 2012:
The Migration Wizard, used to migrate SQL Server 2000 Analysis Services
databases to newer versions, has been discontinued because SQL Server 2000 is
no longer supported.
The Decision Support Objects (DSO) library that provided compatibility with SQL
Server 2000 Analysis Services databases has been discontinued.
For more information about these discontinued features in SSAS 2012, see
Discontinued Analysis Services Functionality in SQL Server 2012
(http://technet.microsoft.com/en-us/library/ms143229(v=sql.110).aspx) in SQL Server
2012 Books Online.
Breaking Changes
There is only one breaking change moving to SSAS 2012. Table 2 covers this one
breaking change. Remember though, to review breaking changes between SSAS 2005
to SSAS 2008/2008 R2 if you are upgrading from SSAS 2005 to SSAS 2012.
337
Description/Recommended Action
If you created installation scripts for unattended setup, you will need to
modify those scripts for a PowerPivot for SharePoint installation. The
alternative is to use PowerShell cmdlets to configure the server in
unattended mode. For more information, see Install PowerPivot from the
Command Prompt (http://technet.microsoft.com/enus/library/ee210645(v=sql.110).aspx) and PowerPivot Configuration using
PowerShell (http://technet.microsoft.com/enus/library/hh230903(v=sql.110).aspx).
For more information about breaking changes in SSAS 2012, see Breaking Changes to
Analysis Services Features in SQL Server 2012 (http://technet.microsoft.com/enus/library/ms143742(v=sql.110).aspx) in SQL Server 2012 Books Online.
Behavior Changes
There are only two areas of behavior changes in SSAS 2012. The first area is for the
multidimensional mode of SSAS, and the second area is for PowerPivot for SharePoint.
Multidimensional Mode
In SQL Server Management Studio (SSMS) and in Cube Designer, the Cube browser has
been removed because it was based on a control that was an Office Web Control
(OWC) component. OWC was deprecated by Office and is no longer available. In its
place, a new browser is available that flattens out queries to only rows, similar to the
MDX query designer in the SQL Server Reporting Services Report Designer.
PowerPivot for SharePoint
Higher permission requirements for using a PowerPivot workbook as an external data
source are now required. In this release, permission requirements have changed for
Excel workbooks that render PowerPivot data from an external file. You must have Read
permissions (or more specifically, the Open Items permission) to connect to an external
PowerPivot workbook from a client application. The additional permissions specify that
a user has download rights to view the source data embedded in the workbook. The
additional permissions reflect the fact that model data is wholly available to the client
application or workbook that links to it, resulting in a better alignment between
permission requirements and the actual data connection behavior.
SQL Server 2012 Upgrade Technical Guide
338
64-bit Considerations
SSAS 2005, SSAS 2008, SSAS 2008 R2, and SQL 2012 are available for 64-bit and 32-bit
hardware platforms. You should perform an in-place upgrade using the same platform
edition you already have installed. Therefore, the 64-bit edition of SSAS 2005 should be
upgraded to the 64-bit edition of SSAS 2012.
When you perform a side-by-side upgrade using two servers, you can upgrade from
one hardware platform edition to another. For example, you can upgrade the 32-bit
edition of SSAS 2005 to the 64-bit edition of SSAS 2012.
339
Before you start an in-place upgrade, take steps to ensure that a failed upgrade can be
rolled back. Although the in-place upgrade process should handle most situations,
unforeseen problems might occur and result in a failed upgrade.
Important: With an in-place upgrade, the upgrade process handles all aspects of
the upgrade, automatically upgrading the metadata for each database found in
SSAS 2005, SSAS 2008, and SSAS 2008 R2.
If a failed upgrade occurs, frequently the easiest resolution is to reinstall the previous
version of SSAS and restore the installation to its state before the upgrade process was
started. Back up all databases by using the Back Up command in SSMS. To do this,
open SSMS, right-click each database that is listed, and select Back Up. Provide a
unique filename for each .abf file that is created, optionally choosing to also encrypt
them with a password.
We recommend that you put all the files that are generated by the previous steps in a
single directory on a network share for safe-keeping during the upgrade process.
Side-By-Side Upgrade
As mentioned previously, in a side-by-side upgrade, you install an instance of SSAS
2012 alongside the existing version of SSAS. After installing SSAS 2012, users can
continue to access the databases in the older versions of SSAS. After installing the
multidimensional SSAS 2012 engine as a new named instance, you can move SSAS
databases to it using one of the following methods:
Back up the database from the older version of SSAS and restore it to the SSAS
2012 instance.
Detach the database from the older version of SSAS and attach it to the SSAS
2012 instance.
Open the project files in Visual Studio 2010 and deploy the database to SSAS
2012. In this case, the cube will have to be processed, unlike the previous two
options.
In-Place Upgrade
To start the in-place upgrade, start the Setup application for SQL Server 2012, selecting
Installation and then Upgrade from SQL Server 2005, SQL Server 2008 or SQL Server
2008 R2. The Setup program will run a system configuration check, collect system
information, and prompt for a product key. After it installs any necessary setup files, the
Setup application will then prompt you to select the instance to upgrade.
SQL Server 2012 Upgrade Technical Guide
340
The next screen shows the features to be installed. All the installed components are
selected and no changes can be made. If it is impossible to select different options, you
will need to run Setup again to add features. For example, if Visual Studio 2010 is not
already installed on the server but is needed in the future, a second run of the Setup
application will be required.
After you have selected the components to install, the Setup application will prompt
you for an instance name for the newly installed SQL Server 2012 components. To
upgrade an existing installation of SSAS, leave the InstanceID the same. The Setup
application should detect any running services based on which components were
selected for installation. Ensure that the existing installation of SSAS is selected, and
continue.
After you select the instance name, Setup will check for the necessary disk space. The
Setup application will then check the server configuration, check the full-text search
upgrade option, and prompt the user to turn on Error and Usage Reporting. This is an
optional setting. Enabling it means the server might try to send data to Microsoft on an
as-needed basis.
The Setup application next checks a series of upgrade rules. You should examine any
failures in the rules and address them as necessary. When there are no failures,
installation can continue.
When the Setup application is ready to continue with the upgrade, it will display a
summary of actions that will be taken. Ensure that the action to be taken is upgrade,
and then continue.
Clicking the Upgrade button starts the upgrade process. During the upgrade, an
Upgrade Progress status screen will show status information about the various steps
taken by the Setup application. When Setup is complete, a screen that displays the
upgrade steps together with a success or failure message will be shown. A final screen
will provide a summary of the installation along with any notes that are relevant to the
upgrade process.
After the upgrade process is finished, you should perform a short set of postinstallation tasks to ensure that the upgrade completed successfully. See the PostUpgrade Tasks topic later in this section for information about these tasks.
341
Post-Upgrade Tasks
After the upgrade of an SSAS server to SSAS 2012 is complete, you must complete a
series of post-installation tasks before the upgraded databases will be available to
users. In addition, you should perform other post-installation tasks to ensure that each
database is working correctly and can be modified in the future if necessary.
Review upgraded databases. Each database that was upgraded by the SQL Server
2012 Setup application should be reviewed to ensure that the upgrade process
completed successfully. Using SSMS, connect to SSAS on the upgraded server. If the
workstation components were installed as part of the upgrade, SSMS should be
available on the upgraded server; otherwise, SSMS will have to be started on another
server or workstation that has the workstation components for SQL Server 2012
installed.
After a connection to SSAS on the upgraded server is established, expand the
Databases folder in the Object Explorer window. If the Object Explorer window is not
visible, open the View menu and select Object Explorer. The Auto Hide button,
represented by a pushpin in the upper-right corner of the Object Explorer window, can
be used to pin the window so that it stays open.
The cubes that are upgraded from SSAS 2005, SSAS 2008, or SSAS 2008 R2 do not have
to be processed to be browsed. Also, projects from Business Intelligence Development
Studio (BIDS) 2005, 2008, and 2008 R2 can be opened in Visual Studio 2010 without
SQL Server 2012 Upgrade Technical Guide
342
modifications, so we strongly recommend that you back up the BIDS 2005, 2008, and
2008 R2 projects if they need to be opened in BIDS 2005, 2008, or 2008 R2.
In SSAS, the database CompatibilityLevel property determines whether certain data
operations are available based on a particular version of the server. For example,
setting the database compatibility level property to 1100 enables the use of the
scalable string storage feature in SQL Server 2012.
Valid values for the CompatibilityLevel property include the following:
1050. This value is set when you attach or restore a database that was created in
SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2 on a SQL Server 2012
SSAS server. A new property named CompatibilityLevel, set to 1050, is
automatically added when you attach or restore the database.
1100. This is the default value for new databases that you create in SQL Server
2012. You can also specify it for databases created in earlier versions of SSAS to
enable the use of features that are supported only at this compatibility level
(namely, scalable string storage for dimension attributes or distinct count
measures that contain string data).
When changing database compatibility levels, you increase the level from 1050 to 1100
to take advantage of new features. You cannot set a SQL Server 2012 SSAS database to
1050 (the value is ignored), nor can you roll back the compatibility level from 1100 to
its original value of 1050. Setting the database compatibility to a higher level is
irreversible. Be sure to back up the database in case you want to use the previous
version on an earlier version of SSAS. For more information, see Set the Compatibility
Level of a Multidimensional Database (Analysis Services)
(http://msdn.microsoft.com/en-us/library/gg471593.aspx).
Conclusion
Upgrading to SSAS 2012 provides a wealth of new capabilities and features. Upgrading
to SSAS 2012 can be accomplished by using either an in-place upgrade or a side-byside upgrade. The in-place upgrade is a bit more risky because it replaces the earlier
version of SSAS. Before you do an in-place upgrade, it is important to make backups of
all the SSAS databases. The side-by-side upgrade lets two versions of SSAS run at the
same time, with SSAS 2012 being a named instance. When the earlier version of SSAS is
removed, the SSAS 2012 version can be changed to the default instance on the server.
343
Moving from SSAS 2005, SSAS 2008, or SSAS 2008 R2 provides performance and
scalability improvements, together with a better set of developer tools for creating and
managing SSAS databases. Although there are some functionality changes, a full
redesign is not necessary.
Organizations upgrading from previous versions of SSAS will find a smooth transition.
There are improved tools for creating dimensions and cubes. The engine also contains
some performance and scalability improvements. The good news is that the number of
breaking changes is very small, and the overall design of cubes, dimensions, and the
like has not changed.
Additional References
For an up-to-date collection of additional references for upgrading to SQL Server 2012,
see the following links:
344
Running Upgrade Advisor. This section shows you how to use the SQL Server
2012 Upgrade Advisor to find out if there are any issues you need to address
prior to your upgrade.
Project Conversion Wizard. This section shows you how to use the SSIS 2012
Project Conversion Wizard to upgrade SQL Server packages. It also introduces
you to the configuration, deployment, and management features in SSIS 2012s
new project deployment model.
Additional Resources. This section contains useful online links for this topic.
Check out What's New (Integration Services) (http://msdn.microsoft.com/enus/library/bb522534(v=sql.110).aspx) in SQL Server 2012 Books Online.
View Matt Massons TechEd 2011 presentation Whats New in Microsoft SQL
Server Code-Named Denali for SQL Server Integration Services
SQL Server 2012 Upgrade Technical Guide
345
(http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DBI317). He
gives a very good overview of SSIS 2012s capabilities for both developers and
administrators.
346
DTS has been discontinued and is no longer supported in SSIS 2012. DTS packages will
need to be migrated to SSIS packages prior to upgrading to SQL Server 2012. For more
information on this topic, see Considerations for Upgrading Data Transformation
Services (http://msdn.microsoft.com/en-us/library/ms143716(v=SQL.105).aspx) in SQL
Server 2008 R2 Books Online.
The SQL Server 2008 R2 Upgrade Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx) also
contains information on how to migrate DTS packages to SSIS, including how to use
the DTS Package Migration Wizard. In addition, Migrating Data Transformation Services
Packages (http://msdn.microsoft.com/en-us/library/ms143501(v=SQL.105).aspx) in SQL
Server 2008 R2 Books Online has more information on the DTS Package Migration
Wizard.
Finally, there are third-party products such as DTS xChange
(http://pragmaticworks.com/Products/Business-Intelligence/DTSxChange/Default.aspx)
that can be used to convert your DTS packages to SSIS packages.
ActiveX scripting is also being discontinued with the SSIS 2012 release. Existing ActiveX
scripting tasks will need to be rewritten, using a combination of SSIS tasks (including
the Script task) and task control flow.
Note that you can choose a side-by-side installation if you still have some DTS
packages that havent been converted yet. However, at some point in time, these DTS
packages will need to be migrated to SSIS. In addition, a side-by-side installation
creates a more complex environment with multiple versions of SQL Server and the SQL
Server Data Tools (SSDT) residing on one server.
64-Bit Considerations
The 64-bit vs. 32-bit considerations section is becoming less relevant as the computing
world moves to 64-bit systems. However, there are still some scenarios where running
SSIS in 32-bit mode is required.
The most common scenario is when Microsoft Excel is a either a source or destination
within a dataflow. For more information on this topic, see the following:
347
The next step is to run Upgrade Advisor. Before you do that, though, it is useful to
know about some of the details of the sample SSIS solution and packages used in the
remainder of this chapter.
ETL Frameworks
Custom ETL Frameworks are common in existing SSIS production solutions and this
sample uses a lightweight version of the Stonemeadow Solutions ETL Framework
(http://etlframework.codeplex.com) found on CodePlex. Another example of a custom
SSIS ETL Framework is the BI Monkey SSIS ETL Framework
(http://ssisetlframework.codeplex.com).
One common pattern for an ETL Framework is to have two types of packages: master
packages and execution packages. The master package is responsible for larger
deployment and workflow responsibilities. The execution packages contain the ETL
code. Note that this pattern fits well within SSIS 2012s new project deployment model
(i.e., one project will contain one master package and multiple execution packages).
In addition, SSIS 2012 has made significant investments in configurations, logging, and
deployments to the point where third-party or custom ETL Frameworks are no longer
necessary. If you are upgrading to SSIS 2012, you should study these new capabilities
to decide whether to replace an existing ETL Framework capability (e.g., configurations)
SQL Server 2012 Upgrade Technical Guide
348
with the SSIS 2012 equivalent. However, you can continue to use your existing ETL
Framework if desired; the SSIS 2012 Project Conversion Wizard fully supports this. For
new SSIS implementations, you should strongly consider using SSIS 2012s new
capabilities to meet your ETL Framework needs.
The SQL Server Worldwide Users Group (SSWUG) article SQL Server 2012 ETL
Framework Features in the New SSIS Catalog
(http://www.sswug.org/articles/viewarticle.aspx?id=59199) provides a list of what types
of features are in the SSIS Catalog out-of-the-box. Although this is an unofficial list, it
provides a good categorization of ETL Framework features along with whats supported
in SSIS 2012.
Master Package
The master package is responsible for:
Batch creation and logging. The batch represents one instance of the master
package invocation and is used for logging as well as creating execution lineage
identifiers.
Error logging. The master package has an OnError event that logs error
information for every master package error as well as unhandled execution
package errors.
Figure 1 shows the task flow for a master package. Five out of the seven tasks in this
task flow are Execute Package tasks. The other two are responsible for creating a batch
record in the ETL Framework logging database and then updating this batchs status
after the execution packages complete.
349
350
Note that two different configuration types are used. The ETL Framework logging
database is populated by an environment variable. The source and database
connection strings as well as the DTSX package directory are loaded by an XML
configuration file. The ETL operator or DBA is responsible for maintaining the values
stored in both of these locations.
SSIS expressions are heavily used in this sample in support of runtime configurations.
These allow the solution to be moved across environments (i.e., development, test, QA,
staging, and production), without having to open and edit the package. Figure 3 shows
the properties for one of the file connections, each of which point to a DTSX package
file.
Execution Packages
The execution packages are responsible for the real ETL work. Each of the five
execution packages in this sample follows a similar pattern for both their task flow and
data flow. Figure 4 shows an example of this task flow.
351
Three logging tasks. InitActivity, UpdateActivity and LogXfr are SQL tasks that
call a stored procedure to insert one or more records into an ETL Framework
logging table. Note that the InitActivity task is also responsible for creating the
execution lineage ID stored in all destination tables.
One data flow. This data flow implements either a Slowly Changing Dimension I
(SCD1) or Slowly Changing Dimension II (SCD2) data flow. Simply put, SCD2 is
about versioning every change, while SCD1 updates one record.
One SCD Post Process task. This is a Script task that builds and executes SQL
statements used in SCD post-processing activities. For example, an SCD2
(versioned table) will need to update the previous version with an End Date and
change the Record status from Active to Inactive.
Note that each of these execution package tasks has the same source, destination, and
logging database configurations. This is a common pattern, which is nicely supported
by SSIS 2012s Shared Connections.
SQL Server 2012 Upgrade Technical Guide
352
353
Each execution package also has one of two patterns, depending upon whether the
destination table is an SCD1 or SCD2. Figure 7 shows an example of an SCD1 data flow.
The package adds record count instrumentation. Note that logging and
reporting on record counts is a useful component in an ETL Framework.
If the record doesnt exist, the package inserts it. Before inserting, the package
generates a primary key if SQL Server IDENTITY columns are not in place.
SQL Server 2012 Upgrade Technical Guide
354
If the record does exist, the package checks to see if anything has changed in
the record.
If the record has not changed, the package ignores the record.
If the record changed, the package inserts a record into the History table.
Note that the SCD1 post processing logic will build and execute the UPDATE statement
that is applied to the destination SCD1 table.
That concludes the review of the SSIS sample solution that will be converted to SSIS
2012. The first step after planning has completed is to run the Upgrade Advisor wizard.
355
You can proceed with installing Upgrade Advisor after you install SQLDOM.MSI. For
more information on installing Upgrade Advisor, see Chapter 1, "Upgrade Tools," in this
guide.
After the Upgrade Advisor installation completes, it is available within the SQL Server
2012 program group. You can navigate to this program group by pressing the Start
button, and then All Programs. Clicking the Launch Upgrade Advisor Analysis Wizard
button and then the Next button gets you to the SQL Server Components screen
shown in Figure 9.
356
357
358
This concludes the walkthrough for running Upgrade Advisor for SSIS. In summary, it is
a good practice to run Upgrade Advisor for your SSIS packages to ensure that you will
not have an issue with the post upgrade steps.
After addressing the Upgrade Advisor warnings and errors, the next step is to install
SQL Server 2012.
359
For a complete installation of Integration Services, together with the tools and
documentation for developing and managing packages, select both Integration
Services and the following Shared Features:
SQL Server Data Tools to install the tools for designing packages
Data Quality Client to install the Data Quality Services (DQS) client objects.
Note that this feature isnt required by SSIS 2012, but provides data scrubbing,
cleansing, and transformations that are core to many ETL solutions.
For more information on SSIS 2012 installations, see Install Integration Services
(http://technet.microsoft.com/en-us/library/ms143731(SQL.110).aspx).
360
For more information on the SSIS 2012 server, see Integration Services (SSIS) Server
(http://technet.microsoft.com/en-us/library/gg471508(SQL.110).aspx) in SQL Server
2012 Books Online.
The SSIS 2012 server leverages the project deployment model, which is new to SSIS
2012. This will be covered later in the Convert to Project Deployment Model section
in this chapter.
In-Place Upgrade
To upgrade in place, first navigate to the SQL Server Installation Center screen, select
Installation, and then select the Upgrade from SQL Server 2005, SQL Server 2008 or SQL
Server 2008 R2 option. This option will upgrade all of your existing SQL Server 2005,
2008, or 2008 R2 components and does not allow you to selectively upgrade SQL
Server components.
Also note that you cannot use an in-place upgrade to perform the following actions:
Move from a 32-bit to a 64-bit version of SQL Server or from a 64-bit version to
a 32-bit version.
Move from one localized version of SQL Server to another localized version.
Side-by-Side Upgrade
A side-by-side upgrade requires you to select the SQL Server 2012 features shown in
Figure 14. You will need to provide a new instance name. Note that an instance name is
optional for new installations.
Other areas that you need to consider with a side-by-side upgrade involve:
SQL Server 2012 Upgrade Technical Guide
361
Designing SSIS packages. You will need the version-specific instance of the SQL
Server Data Tools to work with packages stored in either SQL Server 2005 format
or SQL Server 2008 format (SQL Server 2008 R2 uses this format as well).
Managing SSIS packages. You will not be able to mix and match SQL Server Data
Tools with different versions of the SQL Server database. This means that the
SQL Server package formats (i.e., 2005, 2008, and 2012) must be stored in the
SQL Server msdb database of the same version and must be accessed by the
same version of SSMS.
Running packages. The SQL Server 2012 version of dtexec will convert SQL
Server 2005 and SQL Server 2008 packages to the SQL Server 2012 package
version prior to executing.
New Installations
New installations require you to select the SQL Server 2012 features previously shown
in Figure 14. You will also need to upgrade existing SSIS packages to SSIS 2012. As part
of this process, make sure that all of your package configurations are moved to this
new instance of SQL Server, and that these package configurations reference the
correct files, directories and database connections.
362
In summary, upgrading to SSIS 2012 requires the installer to choose the SSIS -related
components covered in this section. Side-by-side installations result in the most
complexity on the server but allow you to keep your SSIS packages in the downstream
format. Upgrading in place and new installations reduce the complexity on the server
but require a packages upgrade.
After the install completes, the next step is to upgrade your SSIS packages.
The Visual Studio 2010 Program Group (Start, All Programs, Microsoft Visual
Studio 2010, Microsoft Visual Studio 2010)
The SQL Server 2012 program group (Start, All Programs, SQL Server 2012, SQL
Server Data Tools)
363
Once inside the shell, select Open Project, as shown in Figure 17.
Figure 17: Selecting Open Project in the Visual Studio 2010 Shell
The next step is to select the SSIS project, as shown in Figure 18.
364
Figure 19: Viewing the Visual Studio Conversion Wizards Welcome page
Click the Next button to start the conversion. The wizard then gives you the option of
creating a backup of the existing project prior to conversion, as shown in Figure 20. It is
highly recommended that you back up your existing packages and supporting files.
365
The summary page, shown in Figure 21, is then displayed. This is a good time to make
sure that everything is ready to be converted, especially if the SSIS project and
packages are under source control. Click the Finish button to start the conversion from
Visual Studio 2008 to Visual Studio 2010.
366
Figure 24: Viewing the SSIS Package Upgrade Wizards welcome page
The next page, shown in Figure 25, allows you to select the packages to be upgraded.
You can change the name of each as well as provide the password if one exists. Notice
SQL Server 2012 Upgrade Technical Guide
367
how you can apply one password to multiple packages. You do this by highlighting the
packages, entering the password once, and clicking the Apply to selection button.
Updating connection strings so that they use new provider names (default)
Clicking the Next button gets you to the Summary page shown in Figure 26. In this
page, you can review all of your upgrade options prior to starting the upgrade. You can
click the Back button to change one or more upgrade options, or you can click the
Finish button to start the upgrade process.
368
369
DTSX package format change. The wizard automatically upgraded the package
to SSIS 2012s new package format. This new format makes it easier: to read the
XML package file, to work with source control and diff/merge software and to
share transforms between data flows.
Script migration. The wizard automatically upgraded the Script tasks. Note that
this is displayed as a warning but should not be viewed as one since the scripts
will continue to work after the upgrade without user modification.
SQL Server 2012 Upgrade Technical Guide
370
Figure 29 shows the file directory after the SSIS Package Upgrade Wizard completes.
371
to the SSIS Packages dialog box. Select AWDW and click OK. At this point, the upgrade
process is the same as the process documented earlier in this chapter.
Now that the packages have been upgraded, the next step is to test the converted
packages within SSIS 2012. Figure 31 is a modified screenshot of the upgraded master
package.
372
package deployment model to the project deployment model. We will cover this topic
shortly.
Finally, dont forget about your package configurations. Make sure that:
Figure 32 shows the directory after the upgrade completes. Note that the project and
solution files have been converted to Visual Studio 2010. Also note that the original
solution, project, and packages have been safely backed up to the Backup directory.
Figure 32: SSIS project files after the package upgrade wizard completes
The last screenshot in this section demonstrates SSIS 2012s enhanced usability for
developers. Figure 33 is a screenshot of the data flow for one of the converted
execution packages. Note that the data flow has been modified; the source has been
disconnected from other transforms.
373
Figure 33: Data flow for one of the converted execution packages
Figure 33 shows how you can work with a transform (in this case, Derived Column) even
though it is not connected to an upstream transform. This may seem like a minor point,
but it is a great example of an SSIS 2012 usability feature. Previous versions would not
let you open a transform that did not have upstream transform input feed.
In summary, the SSIS Package Upgrade Wizard walks you through a series of input
screens before upgrading your packages to SSIS 2012. This wizard is thorough and the
majority of packages will run post upgrade without changes to the code. Note that
package configuration values will need to be changed.
This is covered, along with other best practices, in the MSDN article "5 Tips for a
Smooth SSIS Upgrade to SQL Server 2012" (http://msdn.microsoft.com/enus/library/hh667275.aspx).
Now that the packages have been upgraded and successfully tested, you can look to
convert to SSIS 2012s project deployment model.
374
375
Clicking Next moves the wizard to the Select Packages page, shown in Figure 36.
376
The wizard has identified the master package and all execution package references.
Moving to the new project reference model ensures that the project is self-contained.
Some benefits are that missing packages will not occur during deployment and the
need for separate file connections for each Execute package task is eliminated.
Selecting the Next button brings up the Select Configurations screen shown in Figure
38.
377
Keep all of the configurations that were identified and click the Next button to navigate
to the Create Parameters page shown in Figure 39.
378
379
The parameter value and description can be modified. You can also select the Required
check box to make it a required attribute. Press the Cancel button to leave these values
as is for now. Click the Next button to go to the Review screen shown in Figure 42.
380
381
382
To see this, open EP_Load_State_Province in the Execute Package Task Editor, as shown
in Figure 45. Note that this is a partial screenshot to reduce the picture size.
383
384
The last screenshot, shown in Figure 47, is the converted version of the master package.
385
SSIS 2012 preserves the ETL Framework custom logging and batch/lineage logic while
improving logging capabilities. These logging capabilities combined with the use of
project and package parameters reduce the need for third-party ETL Frameworks. It is
recommended that any new development utilize the built-in SSIS 2012 features unless
there is already a widely adopted and integrated ETL Framework in place.
Additional References
The following resources provide additional information on upgrading to SSIS 2012 as
well as on the SSIS 2012 feature set and new capabilities:
386
387
In addition, you can find more information about SSRS versions and editions in How to:
Detect Version Information (Reporting Services) (http://msdn.microsoft.com/enus/library/bb630446(SQL.110).aspx) in SQL Server 2012 Books Online.
Note that in this chapter, we refer to SQL Server 2005 with Service Pack (SP4) simply as
SQL Server 2005 to simplify the text and readability.
It is generally recommended that you upgrade each edition of SSRS 2005, SSRS 2008,
or SSRS 2008 R2 to the same edition of SSRS 2012. However, certain cross-edition
upgrades are supported. Specifically, you can upgrade the Standard Edition of SSRS
2005, SSRS 2008, or SSRS 2008 R2 to the Enterprise Edition of SSRS 2012 (as well as to
the Standard Edition of SSRS 2012).
If you upgrade the Standard Edition of SSRS 2005, SSRS 2008, or SSRS 2008 R2 to the
Business Intelligence or Enterprise Editions of SSRS 2012, you will be able to use some
new features, such as data-driven subscriptions, custom security extensions, scale-out
capabilities, alerting, and Power View. For information about the new features, see the
"Reporting Services" section in Features Supported by the Editions of SQL Server 2012
(http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx#reporting).
For complete information about version and edition upgrade paths, see Chapter 1,
Upgrade Planning and Deployment, and Supported Version and Edition Upgrades
(http://msdn.microsoft.com/en-us/library/ms143393(v=SQL.110).aspx) in SQL Server
2012 Books Online.
Note: This document does not discuss the integration of new features in
conjunction with an upgrade of a database instance to SQL Server 2012.
Upgrade Considerations
When upgrading from SSRS 2005, SSRS 2008, or SSRS 2008 R2 to SSRS 2012, you
should consider the following possible issues.
SSRS is installed as a default instance. If the report server database resides within the
default instance of SQL Server on the same server, the relational engine and the report
server must be upgraded together if you are performing an in-place upgrade. In this
case, the SQL Server 2012 Setup program upgrades the relational engine first and then
upgrades the report server components. When the report server database is upgraded,
the Setup program modifies the table structures to reflect the schema needed for SSRS
2012. Most (if not all) schema changes occur when the upgraded Report Server service
starts up and runs its auto-upgrade functionality.
SQL Server 2012 Upgrade Technical Guide
388
You can upgrade the Reporting Services component without upgrading the
relational engine. If the report server database resides within a named instance of SQL
Server (2008 SP2 or later) on the same server or resides on a remote server, you can
upgrade the Reporting Services component without upgrading the relational engine. In
this case, on startup of the upgraded Report Server service, the auto-upgrade feature
modifies the table structures of the report server database to reflect the schema
needed for SSRS 2012. The SQL Server 2012 Report Server service will continue to
connect to the SQL Server (2008 SP2 or later) relational engine, with the new database
schema in place.
SSRS includes client and server components. If you upgrade an SSRS 2005
installation to SSRS 2012 (i.e., upgrade the server components), you should also
upgrade the client components used by all report developers. Although it is possible to
use the prior version of Report Designer with an SSRS 2012 server, report developers
might see a disparity between report preview in Report Designer and how the report is
rendered at runtime. Note, however, that once you upgrade Report Designer on a
given client, you can no longer use it to publish reports to an SSRS 2005 server. Report
namespace differences prevent publishing to the prior version of the report server, but
you can still use Report Designer from SSRS 2012 to deploy to SQL Server 2008 or later
by setting the TargetServerVersion property.
If you have the client components of SSRS 2005, SSRS 2008, or SSRS 2008 R2
installed on a report server, upgrading the server to SSRS 2012 will remove them.
If you need the previous SSRS 2005, SSRS 2008, or SSRS 2008 R2 client components,
you can reinstall them after the upgrade is complete.
If you need to upgrade a scale-out deployment, you must upgrade each SSRS
2005, SSRS 2008, or SSRS 2008 R2 report server in the scale-out deployment. You
can upgrade the servers in any order, but you should stop all the report servers until all
the upgrades are complete. To stop an SSRS 2005 report server, simply stop Microsoft
Internet Information Services (IIS) and the Reporting Services Windows service. To stop
an SSRS 2008 or SSRS 2008 R2 report server, you should use Reporting Services
Configuration Manager to stop the report server instance. When the first report server
is upgraded, the shared report server database will be upgraded. After finishing the
upgrades, simply restart the Reporting Services Windows service on each report server.
Here are some general upgrade notes and best practices you should understand before
building your upgrade plan for SSRS:
SQL Server 2012 Upgrade Technical Guide
389
Cross-version instances of SQL Server 2012 are not supported. Version numbers
of the Database Engine, Analysis Services, and Reporting Services components
must be the same in an instance of SQL Server 2012.
Before upgrading SQL Server, enable Windows Authentication for SQL Server
Agent and verify the default configuration. (For example, verify that the SQL
Server Agent service account is a member of the SQL Server sysadmin group.)
Before upgrading from one edition of SQL Server to another, verify that the
functionality you are currently using is supported in the edition to which you are
upgrading. For more information, see the section for your component in
Features Supported by the Editions of SQL Server 2012
(http://technet.microsoft.com/en-us/library/cc645993(SQL.110).aspx) in SQL
Server 2012 Books Online.
The upgrade will be blocked if the Windows Installer service is not running.
390
To upgrade SQL Server 2005 to SQL Server 2012 on a computer that is running
Windows Server 2008, you must be running SQL Server 2005 Service Pack 4
(SP4).
391
Side-by-Side Upgrade
With a side-by-side upgrade, you install an instance of SSRS 2012 alongside SSRS 2005,
SSRS 2008, or SSRS 2008 R2, which remains until uninstalled. During the upgrade
process, users can continue to access the SSRS 2005, SSRS 2008, or SSRS 2008 R2
reports (unaffected by the upgrade process), but performance might be slower. After
SSRS 2012 is fully tested, you can uninstall your previous SSRS version.
Note: With a side-by-side upgrade, you can either use a copy of the existing report
server database for the new installation or redeploy reports and re-create server
settings on a new server. For more information about this process, see Migrate a
Reporting Services Native Mode Installation (http://technet.microsoft.com/enus/library/ms143724(v=sql.110).aspx) in SQL Server 2012 Books Online.
Important: The side-by-side upgrade option provides for greater availability during
the upgrade process, simplifies rollback (if it is required), and results in simpler
testing scenarios because both versions are available at the same time.
Table 1 shows which upgrade options can be applied to the SSRS 2005, SSRS 2008, and
SSRS 2008 R2 configurations described earlier in this chapter. Note that you can use
these options regardless of which edition of SSRS 2005, SSRS 2008, or SSRS 2008 R2 is
in place.
Table 1: Upgrade Options for SSRS 2005, SSRS 2008, and SSRS 2008 R2
Reporting Services 2005/2008/2008 R2
Side-by-Side
Configuration
In-Place Upgrade?
Upgrade?
Yes
Yes
Yes
Yes
Yes
Yes
Preparing to Upgrade
Before beginning an in-place upgrade of SSRS, take steps to ensure that a failed
upgrade can be rolled back. Although the in-place upgrade process has been designed
and tested to handle almost all situations, unforeseen problems might occur and result
in a failed upgrade. In extreme cases, a failed upgrade might even result in an unusable
SSRS 2005, SSRS 2008, or SSRS 2008 R2 installation. Thus, planning for a failed upgrade
process is critical.
For detailed, step-by-step instructions on how to prepare for an upgrade, see Section
SQL Server 2012 Upgrade Technical Guide
392
Deprecated Features
This section describes SSRS features that have been deprecated and will not be
supported in future releases.
SQL Server 2012 Upgrade Technical Guide
393
Discontinued Functionality
When this guide was being written, there were no discontinued features in SSRS 2012.
Before you upgrade, see Discontinued Functionality to SQL Server Reporting Services in
SQL Server 2012 (http://msdn.microsoft.com/en-us/library/ms144231(v=sql.110).aspx)
in SQL Server 2012 Books Online for any last-minute changes.
Breaking Changes
Breaking changes in SSRS are those that might break applications, scripts, or
functionalities that are based on earlier versions of SQL Server. You might encounter
these issues when you upgrade or in custom scripts or reports. SQL Server 2012
Upgrade Advisor identifies many breaking changes. Chapter 1, Upgrade Planning and
Deployment, and Use Upgrade Advisor to Prepare for Upgrades
(http://msdn.microsoft.com/en-us/library/ms144256(v=sql.110).aspx) in SQL Server
2012 Books Online describe how to use this tool to find and fix problems before the
upgrade.
Report Model Designer Not Available in SQL Server Data Tools
Report Model projects are no longer supported by SQL Server Data Tools (SSDT), and
the Report Model designer is not available in SSRS 2012. You cannot create new Report
Model projects or open existing projects in SSDT, and you cannot create or update
report models. To update report models, you can use SSRS 2008 R2 or earlier tools.
You can continue to use report models as data sources in reports authored in SSRS
2012 tools such as Report Builder and Report Designer. The query designer that you
use to create queries to extract report data from report models continues to be
available in SSRS 2012.
394
For complete information about breaking changes in SSRS 2012, see Breaking Changes
in SQL Server Reporting Services in SQL Server 2012 in SQL Server 2012 Books Online
or Section 14.2.5 Breaking Changes in Chapter 14 of the SQL Server 2008 R2 Upgrade
Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
Behavior Changes
There are a number of behavior changes in this release that might require corrective
action after the upgrade is complete. In this section, we look at fundamental changes
to this release functionality that might affect how you work.
View Items Permission Will Not Download Shared Datasets (SharePoint Mode)
In SSRS 2012, users with the SharePoint permission of View Items can no longer
download the contents of Reporting Services shared data sets like they did in previous
SSRS versions. This behavior change is now consistent with the View Items permissions
for reports, data sources, and models.
For complete information about the behavior changes in SSRS 2012, see Behavior
Changes in SQL Server Reporting Services in SQL Server 2012
(http://technet.microsoft.com/en-us/library/ms143200(SQL.110).aspx) in SQL Server
2012 Books Online.
395
Important: Once a report has been converted to the SSRS 2008 schema, it can no
longer be published to an SSRS 2005 instance. However, SSRS 2012 can read
previous version RDLs without conversion.
In the SQL Server 2012 version of BIDS, you can work with SQL Server 2012, SQL Server
2008, or SQL Server 2008 R2 versions of report definitions and Report Server projects.
You can edit, preview, and deploy any version of the reports.
Upgrade Tools
SQL Server 2012 Upgrade Advisor helps you prepare for upgrades to SQL Server 2012.
Upgrade Advisor analyzes installed components from earlier versions of SQL Server and
then generates a report that identifies issues to fix either before or after you upgrade.
For information about how to install and run Upgrade Advisor, see Chapter 1, "Upgrade
Planning and Deployment."
64-Bit Considerations
Cross-platform upgrades are not supported. You cannot upgrade a 32-bit instance of
SQL Server to native 64-bit. However, you can upgrade a 32-bit instance of SQL Server
to Windows On Windows 64 (WOW64), the 32-bit subsystem on a 64-bit server. You
can also back up or detach databases from a 32-bit instance of SQL Server and then
restore or attach them to a 64-bit instance of SQL Server if the databases are not
published in replication. In this case, you must also re-create any logins and other user
objects in the master, msdb, and model system databases.
396
behavior changes to SSRS in SQL Server 2012, see Reporting Services Backward
Compatibility (http://technet.microsoft.com/en-us/library/ms143251(SQL.110).aspx) in
SQL Server 2012 Books Online.
For a complete list of the SSRS upgrade issues that Upgrade Advisor detects, see
Reporting Services Upgrade Issues in the SQL Server 2012 Upgrade Advisor Help file.
For more information about known issues and workarounds, see Section 14.2.10
Known Issues and Workarounds in Chapter 14 of the SQL Server 2008 R2 Upgrade
Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
397
In-Place Upgrade
If you are performing an in-place upgrade of an SSRS 2005 installation to SSRS 2012,
you need to know the following: If SSRS 2005 is installed as a default instance and the
report server database resides within the default instance of SQL Server 2005 on the
same server, the relational engine and the report server must be upgraded together.
You cannot upgrade the Reporting Services component without upgrading the
relational engine. If the report server database resides within a named instance of SQL
Server on the same server or resides on a remote server (SQL Server 2005), you must
upgrade the Database Engine instance hosting the remote catalog first and then
upgrade the Reporting Services component.
398
In an in-place upgrade of an SSRS 2005 installation to SSRS 2012, the upgrade process
handles all aspects of the upgrade, automatically updating report server content, report
definitions, and component configurations. Note, however, that this upgrade does not
automatically handle updates to client workstations and computers that have the
Report Designer or management tools installed. You will have to upgrade those
workstations and computers after you upgrade the report server.
Upgrading via the Setup Application
Here are the steps for upgrading SSRS 2005 to SSRS 2012 (you follow the same steps
for an in-place upgrade from SSRS 2008 or SSRS 2008 R2 to SSRS 2012):
1. Insert the SQL Server installation media. From the root folder, double-click
Setup.exe. To install from a network share, navigate to the root folder on the
share, and then double-click Setup.exe.
2. If the server operating system that hosts the SSRS instance you want to upgrade
does not meet the minimum requirements for SQL Server 2012, Setup will block
the setup and pop up a message specifying the minimum requirements (see
Figure 1). Click OK, install the minimum requirements, and then restart Setup.
399
400
9. On the Select Instance page, specify the instance of SQL Server to upgrade.
Figure 3 shows the Select Instance screen. The grid will show instances of SQL
Server that are on the computer where Setup is running. If a default instance is
already installed on the computer, you must install a named instance of SQL
Server 2012. To continue, click Next.
401
402
14. On the Full-Text Search Upgrade Options page, specify the upgrade options for
the databases being upgraded. For more information, see Chapter 6, Full-Text
Search, in this guide.
15. On the Error and Usage Reporting page, specify the information you would like
to send to Microsoft that will help to improve SQL Server. By default, options for
error reporting and feature usage are enabled.
16. The Setup Support Rules process will check one more set of rules to validate
your computer configuration with the SQL Server features you have specified
before the upgrade operation begins. If some rule failed, you should install the
needed component or apply the corrective action. For example, if Microsoft .NET
Framework 3.5 SP1 is not installed, the Setup Support Rules process will prompt
you to install the feature, depending on the operating system used.
17. The Ready to Upgrade page displays a tree view of upgrade options that were
specified during Setup. To continue, click Install. During the upgrade, the
Upgrade Progress page provides a status bar so that you can monitor the
progress as Setup proceeds.
18. After installation, the Complete page (see Figure 5) provides a link to the
summary log file for the installation and other important notes. For information
about Setup log files, see View and Read SQL Server Setup Log Files
(http://msdn.microsoft.com/en-us/library/ms143702(v=sql.110).aspx) in SQL
Server 2012 Books Online. To complete the installation process, click Close.
403
19. If you are instructed to restart the computer, as Figure 6 shows, do so now. It is
important to read the message from the Installation Wizard when you are done
with Setup.
Side-by-Side Upgrade
You can upgrade SSRS 2005 installations to SSRS 2012 by using the side-by-side
upgrade method. You can perform a side-by-side upgrade on a single server (the
existing report server) or by using two servers (to take advantage of new hardware, for
example).
When you perform the upgrade on a single server, you install a new instance of SSRS
2012 alongside the existing SSRS 2005 installation and then manually move report
server content, report definitions, and other configuration information to the new
instance. When you perform the upgrade by using two servers, you install SSRS 2012
on the new server (as the default instance or as a named instance) and then perform
the same manual movement of report server content, report definitions, and
configuration information.
SQL Server 2012 Upgrade Technical Guide
404
Note: Regardless of the upgrade process you use, the workstations and computers
hosting the Report Designer or SSRS 2005 management tools will have to be
upgraded after the report server is upgraded.
Installing the New Instance
The first step for a side-by-side upgrade is to install (but not configure) SSRS 2012. The
following points should be considered when planning a single-server or a two-server
upgrade process:
If an additional server is available and will serve as the new SSRS 2012 report
server, you can install SSRS 2012 as the default instance or as a named instance
on the new server. After the upgrade (and testing) is complete, you can
decommission the old report server or reuse it for other purposes.
For information about installing SQL Server 2012, see Install SQL Server 2012 from the
Installation Wizard (Setup) (http://msdn.microsoft.com/enus/library/ms143219(v=sql.110).aspx).
For complete information about installing the new instance, see Section 14.3.2.1
Installing the New Instance in Chapter 14 of the SQL Server 2008 R2 Upgrade
Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
Configuring the New Instance
After you have installed the new instance, you should use the Reporting Services
Configuration tool to configure the instance. Launch the tool from the Configuration
Tools group within the Microsoft SQL Server 2012 Start menu group.
For complete information about configuring the new instance, see Section 14.3.2.2
Configuring the New Instance in Chapter 14 of the SQL Server 2008 R2 Upgrade
Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
SQL Server 2012 Upgrade Technical Guide
405
406
407
In-Place Upgrade
When upgrading an installation of SSRS 2008 in place to SSRS 2012, the upgrade
process handles all aspects of the upgrade, automatically updating report server
content, report definitions, and component configurations. Note, however, that this
upgrade does not automatically handle updates to client workstations and computers
that have the Report Designer or management tools installed. You will have to upgrade
those workstations and computers after you upgrade the report server.
You can upgrade the Reporting Services component without upgrading the relational
engine. If the report server database resides within a named instance of SQL Server
2008 SP2 on the same server or resides on a remote server, you can upgrade the
Reporting Services component without upgrading the relational engine. In this case, on
startup of the upgraded Report Server service, the auto-upgrade feature modifies the
table structures of the report server database to reflect the schema needed for SSRS
2012. The SQL Server 2012 Report Server service will continue to connect to the SQL
Server 2008 SP2 relational engine, with the new database schema in place. If a SQL
Server 2005 Database Engine instance is hosting the report server database, you cannot
upgrade the Reporting Services component without upgrading the relational engine. If
the report server database resides within a named instance of SQL Server on the same
server or resides on a remote server (SQL Server 2005), you must upgrade the Database
Engine instance hosting the report server database first and then upgrade the
Reporting Services component.
Note: The minimum product level requirements to upgrade SQL Server 2008 to SQL
Server 2012 is SQL Server 2008 Service Pack 2 (SP2) either remote catalog or default
instance.
Upgrading via the Setup Application
Upgrading from SSRS 2008 to SSRS 2012 via the Setup application is identical to
upgrading from SSRS 2005 via the Setup application. For detailed steps, see
Upgrading via the Setup Application in the Upgrading from SQL Server 2005 section
earlier in this chapter.
408
Side-by-Side Upgrade
Upgrading from SSRS 2008 to SSRS 2012 via the side-by-side method is identical to
doing a side-by-side upgrade from SSRS 2005. For detailed steps, see Side-by-Side
Upgrade in the Upgrading from SQL Server 2005 section earlier in this chapter.
Installing the New Instance
The steps and options for installing the new instance are the same as in an SSRS 2005
upgrade. You can find those steps in the Installing the New Instance section under
Upgrading from SQL Server 2005.
Configuring the New Instance
After you have installed the new SSRS 2012 instance, you should use the Reporting
Services Configuration tool to configure it. Start the tool from the Configuration Tools
group within the Microsoft SQL Server 2012 Start menu group.
The steps for configuring the new instance are the same as in an SSRS 2005 upgrade.
You can find those steps in Configuring the New Instance in the Upgrading from SQL
Server 2005 section earlier in this chapter.
In-Place Upgrade
When upgrading an installation of SSRS 2008 R2 in place to SSRS 2012, the upgrade
process handles all aspects of the upgrade, automatically updating report server
content, report definitions, and component configurations. Note, however, that this
upgrade does not automatically handle updates to client workstations and computers
that have the Report Designer or management tools installed. You will have to upgrade
those workstations and computers after you upgrade the report server.
You can upgrade the Reporting Services component without upgrading the relational
engine. If the report server database resides within a named instance of SQL Server
2008 SP2 on the same server or resides on a remote server, you can upgrade the
Reporting Services component without upgrading the relational engine. In this case, on
startup of the upgraded Report Server service, the auto-upgrade feature modifies the
table structures of the report server database to reflect the schema needed for SSRS
2012. The SQL Server 2012 Report Server service will continue to connect to the SQL
SQL Server 2012 Upgrade Technical Guide
409
Server 2008 SP2 relational engine, with the new database schema in place. If a SQL
Server 2005 Database Engine instance is hosting the report server database, you cannot
upgrade the Reporting Services component without upgrading the relational engine. If
the report server database resides within a named instance of SQL Server on the same
server or resides on a remote server (SQL Server 2005), you must upgrade the Database
Engine instance hosting the report server database first and then upgrade the
Reporting Services component.
Upgrading via the Setup Application
Upgrading from SSRS 2008 R2 to SSRS 2012 via the Setup application is identical to
upgrading from SSRS 2005 via the Setup application. For detailed steps, see
Upgrading via the Setup Application in the Upgrading from SQL Server 2005 section
earlier in this chapter.
Side-by-Side Upgrade
Upgrading from SSRS 2008 R2 to SSRS 2012 via the side-by-side method is identical to
doing a side-by-side upgrade from SSRS 2005. For detailed steps, see Side-by-Side
Upgrade in the Upgrading from SQL Server 2005 section earlier in this chapter.
Installing the New Instance
The steps and options for installing the new instance are the same as in an SSRS 2005
upgrade. You can find those steps in the Installing the New Instance section under
Upgrading from SQL Server 2005.
Configuring the New Instance
After you have installed the new SSRS 2012 instance, you should use the Reporting
Services Configuration tool to configure it. Start the tool from the Configuration Tools
group within the Microsoft SQL Server 2012 Start menu group.
The steps for configuring the new instance are the same as in an SSRS 2005 upgrade.
You can find those steps in Configuring the New Instance in the Upgrading from SQL
Server 2005 section earlier in this chapter.
410
Watson bucket
Error:
Detail_GlobalRules.txt
Detail_ComponentUpdate.txt
Detail.txt
411
Windows Installer (MSI) actions performed during Setup generate their own log files in
the following format: [product feature]_[cpu]_[LCID (optional)]_[attempt #].log. If an
MSI execution fails, look in the associated MSI log for return value 3 only for ENU
versions.
Datastore files contain a snapshot of the state of all configuration objects being tracked
by the Setup process and are useful for troubleshooting configuration errors. XML file
dumps are created for datastore objects for each execution phase. They are saved in
their own log subfolder under the time-stamped log folder, as follows:
Datastore_GlobalRules
Datastore_ComponentUpdate
Datastore
For more information, see View and Read SQL Server Setup Log Files
(http://msdn.microsoft.com/en-us/library/ms143702(v=sql.110).aspx) in SQL Server
2012 Books Online.
Post-Upgrade Tasks
After upgrading to SSRS 2012 from SSRS 2005, SSRS 2008, or SSRS 2008 R2, it is
important to ensure that the upgrade ran successfully and to configure SSRS 2012:
1. To begin, particularly if you performed an in-place upgrade, use the Reporting
Services Configuration tool to check the configuration of the report server. After
the tool is launched, connect to the upgraded instance.
2. Review the configuration settings by selecting each of the items in the left pane
of the tool. If any of the settings seem incorrect or are missing, update the
settings and save the changes.
3. Ensure that the report server is behaving as expected by running a sample set of
the reports deployed to the server. Start Report Manager by using the correct
URL (for example, http://locahost/Reports for an upgraded default instance or
http://localhost/Reportsnew for a newly installed and configured named
instance). At a minimum, you should select and execute reports to verify that the
following report server features and capabilities (if used) are working correctly:
412
Custom rendering and delivery extensions. You should fully test any
custom rendering and delivery extensions to ensure that each is working
correctly. Remember, you must recompile all custom extensions created
for SSRS 2000 or SSRS 2005 to use the Common Language Runtime (CLR)
provided with Visual Studio 2008.
4. SSRS 2005, SSRS 2008, and SSRS 2008 R2 come with an ad hoc reporting tool
called Report Builder. If you want to use this feature, you need to change the
existing security role definitions to provide end-user access to Report Builder.
Consider updating the existing role definitions as Table 2 shows.
Table 2: Role Updates After the SSRS Upgrade
Existing
Role
Definition
Suggested Changes
Browser
Content
Add Manage Models, View Models, and Consume Reports to grant full
Manager
permission over models and to provide the ability to create and modify
reports in Report Builder.
Publisher
Add Manage Models to grant permission to create, view, and delete Report
Builder models.
System
Administrator
System User
413
Moving Reports Between SSRS 2008, SSRS 2008 R2, and SSRS 2012
A report definition file includes a reference to the RDL namespace that specifies the
version of the report definition schema that is used to validate the .rdl file. In the SQL
Server 2012 version of BIDS, you can work with both SQL Server 2012 and SQL Server
2008 versions of report definitions and Report Server projects. You can edit, preview,
and deploy any version of the reports.
If you open, update, and then save a SQL Server 2008 report definition, it is saved as a
SQL Server 2008 report definition unless you added features that are new in SQL Server
2012. In such a case, the report definition is saved as a SQL Server 2012 report
definition to ensure that the definition is valid and the report will run. For more
information, see Deployment and Version Support in SQL Server Data Tools (SSRS)
(http://msdn.microsoft.com/en-us/library/ee635898(v=sql.110).aspx) in SQL Server
2012 Books Online.
When you open an .rdl file in Report Designer in BIDS that was created for the SQL
Server 2005 namespace, Report Designer automatically creates a backup file and
upgrades the report to the current namespace. If you save the upgraded report
definition, you have saved the converted .rdl file. As soon as you save it, you cannot
open it in earlier versions of Report Designer. This is the only way you can upgrade
these versions of report definition files.
SQL Server 2012 Upgrade Technical Guide
414
You can deploy an .rdl file created in an earlier version of SSRS to a SQL Server 2012
report server, and it is automatically upgraded on first use. The report server stores the
report definition file in the original format. The report is automatically upgraded the
first time it is viewed, but the stored report definition file remains unchanged.
For more information, see Upgrade Reports (http://msdn.microsoft.com/enus/library/ms143674(v=sql.110).aspx) in SQL Server 2012 Books Online.
415
that point, you can rename the virtual directories you created for SSRS 2012 to use the
names originally configured for SSRS 2005, SSRS 2008, or SSRS 2008 R2. End users and
applications that reference the report server can then continue to use the original URLs
and connection information as opposed to the virtual directory names you assigned to
SSRS 2012 for upgrade purposes.
For more information, see Section 14.7.5 Uninstalling SSRS 2000, SSRS 2005, or SSRS
2008 in Chapter 14 of the SQL Server 2008 R2 Upgrade Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
Conclusion
The key to a successful SSRS upgrade is a detailed, well-thought-out upgrade plan,
including a review of possible upgrade issues and a rollback strategy in case of a failed
upgrade. In planning for a rollback, you should include backups of at least the
following elements:
Use Upgrade Advisor to help discover blocking issues related to SSRS. And determine
the appropriate upgrade method for your organization and configuration. This chapter
discusses several advantages and disadvantages of using each method for upgrading
SSRS. For example, the side-by-side method is easy to roll back because your original
instance remains intact, whereas an in-place upgrade might be faster, but you would
have to restore the previous instance in case of a failed upgrade.
By following the preparation guidance and upgrade steps in this chapter, you should
have a smooth transition to SSRS 2012.
Additional References
For an up-to-date collection of additional references for upgrading SQL Server 2012,
see the following links:
416
417
For details about data mining functionality in SSAS 2012, see Data Mining (SSAS)
(http://msdn.microsoft.com/en-us/library/bb510516(SQL.110).aspx) in SQL
Server 2012 Books Online.
For additional SQL Server data mining information, see the Data Mining forum
(http://social.msdn.microsoft.com/Forums/en-US/sqldatamining/threads).
SQL Server 2012 Upgrade Technical Guide
418
For other useful data mining content, see the blogs by Jamie MacLennan
(http://blogs.msdn.com/b/jamiemac) and Bogdan Crivat
(http://www.bogdancrivat.net/dm).
EE = Enterprise Edition, available in SQL Server 2005, 2008, 2008 R2, and 2012
SE = Standard Edition, available in SQL Server 2005, 2008, 2008 R2, and 2012
WE = Web Edition, available in SQL Server 2008, 2008 R2, and 2012
SSE = SQL Server Express Edition and Express with Tools, available in SQL Server
2005, 2008, 2008 R2, and 2012
SSEA = SQL Server Express Edition with Advanced Services, available in SQL
Server 2005, 2008, 2008 R2, and 2012
In addition to the editions just mentioned, Microsoft offers the Developer Edition and
the Enterprise Evaluation Edition. They have the same functionality as the Enterprise
Edition, but the licensing is different. Data mining features are supported on quite
granular level in SQL Server 2005, 2008, and 2008 R2, as Table 1 shows. Cells with a
light gray background show editions and features available in SQL Server 2008 and SQL
Server 2008 R2 only.
Table 1: Data Mining Features in SQL Server 2008 R2 Editions
Feature
DC
EE
SE
WG
WE
SSE
SSEA
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Algorithm viewers
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
No
419
Feature
DC
EE
SE
WG
WE
SSE
SSEA
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Cross-validation
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Sequence prediction
Yes
Yes
No
No
No
No
No
prediction queries
transformation (SSIS)
Text-Mining Term Lookup
transformation (SSIS)
Data Mining Query transformation
(SSIS)
Data Mining processing destination
(SSIS)
structure data
Time series: custom blending
between ARTXP and ARIMA models
As you can see, in SQL Server 2008 R2, many features are supported in the Enterprise
and Datacenter Editions only. Beside those two editions, Standard is the only edition
that supports data mining.
Microsoft simplified licensing for SQL Server 2012. There are fewer editions, with the
three major ones being the Standard, Business Intelligence, and Enterprise Editions.
Basic data mining starts with the Standard Edition, and all data mining features are
available in the Business Intelligence and Enterprise Editions. Table 2 shows details of
data mining features supported by the different editions of SQL Server 2012.
SQL Server 2012 Upgrade Technical Guide
420
EE
BI
SE
WE
SSE
SSEA
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Cross-validation
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Sequence prediction
Yes
Yes
No
No
No
No
transformation (SSIS)
Text-Mining Term Lookup
transformation (SSIS)
Data Mining Query transformation
(SSIS)
Data Mining processing destination
(SSIS)
structure data
Time series: custom blending
between ARTXP and ARIMA models
Please note that if you are planning to downgrade an edition when migrating from SQL
Server 2008 R2 to SQL Server 2012for example, downgrading from the Enterprise
Edition to the Business Intelligence Editionyou are going to lose some data mining
functionality. Edition downgrading is not a supported in-place upgrade path, so you
would have to migrate your mining models using other means, as we describe later in
this chapter. Because SQL Server 2012 brings quite a few data mining enhancements
compared to SQL Server 2005, rebuilding your 2005 forecasting data mining models is
probably the best strategy. Additional validation of the 2005 predictive model is
SQL Server 2012 Upgrade Technical Guide
421
recommendable as well. Upgrading 2008 and 2008 R2 data mining models should be a
straightforward process, as there are nearly no changes in version 2012. However,
please check the discontinued and deprecated features, and the breaking and behavior
changes in SQL Server 2012, in order to prevent unpleasant surprises in your data
mining applications.
Preparing to Upgrade
After you select the SQL Server 2012 edition that suits your needs, you need to
investigate which features are deprecated in SQL Server 2008 R2. These features will
not affect your upgrade, but you will need to update your models to stop using them
before your next upgrade. You also need to know what functionality cannot be
upgraded because is it discontinued or because it has changed in SQL Server 2012. And
you also need to be aware of some behavior changes between data mining in SQL
Server 2005, 2008, 2008 R2, and 2012; otherwise, you could get unexpected results.
Lets look at each of these categories of changes. This section also notes potential
issues with data mining models. For a complete reference of SSAS changes in SQL
Server 2012, see SQL Server Database Engine Backward Compatibility
(http://msdn.microsoft.com/en-us/library/ms143532(SQL.110).aspx) in SQL Server 2012
Books Online.
Deprecated Features
SSAS 2000 supports the XML markup language called Predictive Model Markup
Language (PMML) 1.0. PMML is a standard language to describe data mining models.
However, the language is incomplete from the standards point of view, although some
specific extensions have been added. In contrast, SSAS 2012 supports standard PMML
2.1 and deprecates SSAS 2000 PMML extensions, meaning that you should not use
them. Note that this is probably not a big issue because you use PMML directly only if
you export your SSAS 2000 mining models to PMML. You can create a mining model in
SSAS 2012 from PMML and store it in an SSAS 2012 database. If you export it from
SSAS 2012, standard PMML will be generated. Some of the most important SQL Server
2000 extensions to PMML 1.0 include:
The Discretized, Ordered, and Cyclical model variables besides the simple
Categorical and Continuous model variables.
422
All model variables can have a missing state described, even those with a
continuous domain.
For a complete specification of SQL Server 2000 Data Mining functionality and
extensions, see OLE DB for Data Mining Specification 1.0
(http://www.microsoft.com/downloads/en/details.aspx?DisplayLang=en&FamilyID=010
05f92-dba1-4fa4-8ba0-af6a19d30217). For a complete list of deprecated features in
SSAS 2012, see Deprecated Analysis Services Functionality in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143346(SQL.110).aspx) in SQL Server 2012
Books Online.
Discontinued Functionality
Theres only a short list of discontinued data mining functionality from SSAS 2005 to
SSAS 2008, SSAS 2008 R2, and SSAS 2012:
In SSAS 2012, the OLE DB provider does not support the Mining Execution Location
and Mining Location properties. Although you can specify the Mining Execution
Location property in a connection string, SSAS 2012 ignores the setting. If you need to
upgrade your mining models from SQL Server 2000, please note that a direct upgrade
path to 2012 is not supported anymore. You should upgrade to SQL Server 2005, 2008,
or 2008 R2 first. Because a direct upgrade path is not supported, note that the
following is discontinued as well:
Decision Support Objects (DSO) library, which provides compatibility with SSAS
databases
You can find the complete list of SSAS 2012 discontinued functionality in Discontinued
Analysis Services Functionality in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms143229(SQL.110).aspx) in SQL Server 2012 Books Online.
423
Breaking Changes
If you upgrade your data mining modes from SSAS 2005 to SSAS 2012, the following
issues could prevent a successful upgrade, force you to update your SSAS databases
after the upgrade, or change the results of your mining models:
ODBC data sources are not supported in SSAS 2012. If you are using ODBC data
sources, you need to change them to OLE DB providers.
DSOs are not installed by default when you install SQL Server 2012.
You can use Visual Basic for Applications (VBA) functions in your Data Mining
Extensions (DMX) statements. However, VBA functions handle NULL values
differently in SSAS 2012. In SSAS 2005, VBA functions return 0 or an empty
string when NULL or empty values are used as arguments. In SQL Server 2012,
VBA functions return NULL.
For information about some of these breaking changes, see Breaking Changes to
Analysis Services Features in SQL Server 2012 (http://msdn.microsoft.com/enus/library/ms143742(SQL.110).aspx) in SQL Server 2012 Books Online.
Behavior Changes
There are no specific behavior changes in the mining models when you upgrade them
from SSAS 2005, 2008, or 2008 R2 to SSAS 2012. To confirm this information, see
Behavior Changes to Analysis Services Features in SQL Server 2012
(http://msdn.microsoft.com/en-us/library/ms143682(SQL.110).aspx) in SQL Server 2012
Books Online.
424
After we installed Upgrade Advisor, we started it. From the initial page, we selected the
Launch Upgrade Advisor Analysis Wizard link. After clicking Next in the Welcome page,
we selected Analysis Services from the SQL Server components window, as shown in
Figure 1.
Figure 1: Selecting the Analysis Services component in the SQL Server Upgrade Advisor
Analysis Wizard
Then we selected the 2005 instance and ran the analysis. After the analysis was finished,
we launched the Upgrade Advisor Report Viewer. As the results in Figure 2 shows, there
were no unresolved issues. This is what we expected because the differences between
the data mining models in SQL Server 2005, 2008, 2008 R2, and SQL Server 2012 are
minor.
425
Figure 2: Results of the analysis of the SQL Server 2005 data mining models
You can also expect to have no unresolved issues found in your SSAS 2005 data mining
models when you run Upgrade Advisor. (Similarly, there should be no unresolved issues
found in SSAS 2008 and 2008 R2 models.) However, this does not mean that you
should just upgrade the 2005 models. You should also perform post-upgrade tasks. As
we will show you later in this chapter, it makes sense to revise the 2005 predictive and
forecasting models after upgrading to SSAS 2012.
426
To demonstrate upgrading data mining models from SQL Server 2005 to SQL Server
2012, lets consider a sample SSAS 2005 database that has a data source from the SQL
Server 2005 AdventureWorksDW demo database, a data source view with all necessary
database views included (vTargetMail, vTimeSeries, vAssocSeqOrders, and
vAssocSeqLineItems), and seven data mining models in four data mining structures.
Four predictive models use the same structure, based on vTargetMail. The models try
to predict whether a customer is likely to buy a bike using demographic data and four
algorithms (Decision Trees, Nave Bayes, Neural Network, and Clustering). The Time
Series mining model has its own structure, based on the vTimeSeries view, for
forecasting the sales quantity and amount for bike models in different regions. The
Association Rules algorithm model uses the vAssocSeqOrders and vAssocSeqLineItems
database views to try to find out which products are sold together. Although the
Sequence Clustering algorithm uses the same source database views, it has its own
structure, with the keys defined differently than in the structure for the Association
Rules model. Sequence Clustering tries to find not only which products are sold
together but also the order of products in a transaction. Figure 3 shows the columns
usage for Association Rules, and Figure 4 shows the columns usage for Sequence
Clustering.
427
Figure 5: SSAS 2005 database with all objects that need to be upgraded
SQL Server 2012 Upgrade Technical Guide
428
In-Place Upgrade
You start an in-place upgrade from SSAS 2005 to SSAS 2012 by running SQL Server
Setup. The upgrade process is painless for the data mining models. Your SSAS
databases are automatically upgraded, and you can continue using your mining models
the same way you used them in SSAS 2005. In addition, you can use your SSAS 2005
mining projects in SSDT 2012 to continue with development. When you open the SSAS
2005 data mining project in SSDT 2012 for the first time, the Visual Studio Conversion
Wizard is launched automatically, and your project is converted to version 2012.
Consider using a version control system to maintain previous versions, or back up the
project manually before you convert it to SSDT 2012. Figure 6 shows how the Visual
Studio Conversion Wizard launches when you open a BIDS 2005 project.
Figure 6: SSDT 2012s Visual Studio Conversion Wizard launches when you open a
BIDS 2005 project
If you want to perform an in-place upgrade, run SQL Server Setup and select the
Upgrade from SQL Server 2005, SQL Server 2008 or SQL Server 2008 R2 link from the
Installation tab of the SQL Server Installation Center, as shown in Figure 7.
429
Figure 8: Message when you try to connect to an SSAS 2012 instance with SSMS 2005
SQL Server 2012 Upgrade Technical Guide
430
You will also need to perform some important data-mining tasks after your in-place
upgrade from SSAS 2005 to SSAS 2012. There are many valuable features in SSAS 2012
data mining that can help you deploy a different predictive model in production,
consolidate mining structures, or refine forecasting models. We will discuss these
important considerations in the Post-Upgrade Tasks section later in this chapter.
Side-by-Side Upgrade
For a side-by-side upgrade, you have plenty of options for migrating your mining
models from SSAS 2005 to SSAS 2012:
You can back up the SSAS 2005 database and restore it on SSAS 2012.
With SSMS, you can create an XMLA script for creating the complete database
or any object in the database and then execute the script on SSAS 2012.
You can open the SSAS 2005 project in SSDT 2012 and deploy it on SSAS 2012.
You can reverse-engineer an SSAS 2005 database in SSDT 2012 to create a 2012
project and then deploy the project on SSAS 2012.
You can also quickly import SSAS 2005 data mining models to an SSAS 2012 database
by using the EXPORT and IMPORT DMX commands. However, note that SSAS 2012
supports data mining only if it is installed in Multidimensional and Data Mining mode.
SSAS 2012 in Tabular mode does not support data mining at all, and you cannot
migrate your mining models to an SSAS 2012 Tabular instance.
Chapter 16, Analysis Services, covers the options for migrating a complete SSAS
database. So in this section, we focus on the data-mining-specific migration options.
With the EXPORT DMX command, you can export a complete mining structure, one or
more mining models, or a model or structure with dependencies. Exporting with
dependencies means that all objects needed to process the structure, such as the data
source and the data source view, are included in the backup (.abf) file. Here are some
examples of EXPORT commands executed on our sample SSAS 2005 database:
-- Exporting complete structure
EXPORT MINING STRUCTURE [TM2005]
TO 'C:\Upgrade2012WP\TM2005_Structure.abf';
-- Exporting a single model
EXPORT MINING MODEL [TM2005_DT]
TO 'C:\Upgrade2012WP\TM2005_Model.abf';
-- Exporting a model with dependencies
EXPORT MINING MODEL [AR2005]
TO 'C:\Upgrade2012WP\AR2005_Model_Dependencies.abf'
WITH DEPENDENCIES;
431
In SSAS 2012, you can use SSMS to create an empty database. Note that you cannot
create objects you need for processing the mining structures, namely data sources and
data source views, from SSMS. You can use SSDT 2012 to create a SSAS project that
includes only data sources and data source views, deploy it, and then import mining
models and structures.
If you already have the destination SSAS 2012 database and you need to import only a
mining structure, import it from the backup file with the complete structure, as follows:
-- Importing complete structure
IMPORT
FROM 'C:\Upgrade2012WP\TM2005_Structure.abf';
Note that if you import from a file with only the mining model, the associated structure
is created as well. Therefore, you cannot have a structure with the same name in the
destination SSAS database. The following command shows an example of importing a
mining model:
-- Importing a single model
IMPORT
FROM 'C:\Upgrade2012WP\TM2005_Model.abf';
This command imports from the file to which you exported the TM2005_DT model. And
as we just noted, the TM2005 structure cannot exist in the destination database
because it is recreated there during the import. If you executed the second import, the
third one fails. If there is no TM2005 structure in the destination database, then the
third import succeeds. After a successful third import, the TM2005 structure contains
only one model, TM2005_DT.
After the import, you should try to process the complete database to check whether all
dependent objects were imported correctly.
Post-Upgrade Tasks
After your upgrade from SSAS 2005 to SSAS 2012, you should check the accuracy and
the robustness of your predictive models before deciding which one to deploy in
production.
Lift Chart
A Lift Chart is the most popular way to view the accuracy of predictive models. For a Lift
Chart, you need to split your data into training and test sets. You use the training set to
train the models and then try to predict the target variable in the test set. Because you
SQL Server 2012 Upgrade Technical Guide
432
know the real value of the target variable in your test set, you can measure how many
times the predictions were accurate and compare the accuracy of different models. The
Lift Chart provides a standard way to graphically present this comparison. Figure 9
shows a Lift Chart for the predictive models we created in the sample SSAS 2005
database for the value 1 (buyers) of the predicted variable (Bike Buyer). From this chart,
you can easily see the performance of the different models.
433
434
Fold Count. With this setting, you define how many partitions you want to
create in your training data. In Figure 10, three partitions are created. When
partition 1 is used as the test data, the model is trained on partitions 2 and 3.
When partition 2 is used as the test data, the model is trained on partitions 1
and 3. When partition 3 is used as the test data, the model is trained on
partitions 1 and 2.
Max Cases. You can define the maximum number of cases to use for crossvalidation. Cases are taken randomly from each partition. Our example uses
9,000 cases, which means that each partition will hold 3,000 cases.
Target State. You can check overall predictions by leaving this field empty, or
you can check predictions for a single state that you are interested in. In our
example, we are interested in bike buyers (state 1).
SQL Server 2012 Upgrade Technical Guide
435
Target Threshold. You use this parameter to set the accuracy bar for the
predictions. If the predict probability exceeds your accuracy bar, the prediction is
considered correct; if not, the prediction is considered incorrect.
The cross-validation report below the settings shows many different measures to help
you check the reliability of your models. For example, the classifications True Positive,
False Positive, True Negative, and False Negative count cases in partitions where the
predicted probability is greater than your accuracy threshold and the predicted state
matches the target state.
You can see in Figure 10 that the True Positive classification of Decision Trees does not
give you very consistent results across partitions. The third partition has approximately
25 percent less True Positive scores than the first two partitions. The True Positive
classification counts cases predicted as positive (bike buyers, in the example) that are
actually positive. In addition, the standard deviation of this measure is quite high.
However, when checking the Neural Network model, which Figure 11 shows, you can
see that it is more consistent for the True Positive classification, which means that this
model is more robust on different data sets than the Decision Trees model.
436
From the cross-validation results, it seems that you should deploy the Neural Network
model in production. Although the accuracy of the Neural Network model is slightly
lower than that of the Decision Trees model, the reliability is higher. Of course, in
production, you should perform many additional accuracy and reliability tests before
deciding which model to deploy. But testing the reliability of predictive models is one
of the most important post-upgrade tasks when you upgrade to SSAS 2012. To learn
more about cross-validation, see Cross-Validation (Analysis Services Data Mining)
(http://msdn.microsoft.com/en-us/library/bb895174(SQL.110).aspx) in SQL Server 2012
Books Online.
Model Filtering
In SSAS 2005, you have to create a different mining structure if you want to use just a
subset of data for an additional mining model. In SSAS 2008, 2008 R2, and 2012, you
can filter a specific model to use only a subset of data for training. For example, using
the same structure, you can create a model trained on the complete training set,
another one trained only on the female population subset, and the third one trained
only on the male population subset. You can then compare the performance of the
models trained on the complete population with those trained on the various subsets.
If you used different structures for subsets of training data in SSAS 2005, you should
consider consolidating those structures into one structure in SSAS 2012 so that you can
compare the performance of the models in a single Lift Chart or with a single crossvalidation. To learn more about model filtering, see Filters for Mining Models (Analysis
Services - Data Mining) (http://msdn.microsoft.com/enus/library/bb895167(SQL.110).aspx) in SQL Server 2012 Books Online.
Measuring Quality of Time Series Algorithm
How can you measure the quality of forecasted values with the Time Series algorithm
when you do not have the actual data yet? Waiting until the data is available is likely
not practical because by that time, you might already have made wrong decisions
based on your forecasting model. There is a better way to measure the performance of
the Time Series model. Using a specific number of periods from the past, you can try to
forecast present values. If the model performs well for forecasting present values,
probability is good that it will perform well for forecasting future values.
You control the creation of historical models by using two algorithm parameters:
HISTORICAL_MODEL_COUNT and HISTORICAL_MODEL_GAP. The first one controls the
number of historical models that will be built, and the second one controls the number
of time slices between historical models.
SQL Server 2012 Upgrade Technical Guide
437
Figure 12 uses SSAS 2005 to show historical forecasts (the dotted lines before the
current point in time) for the R-250 model for sales amount in Europe. What you can
see is that the forecasts are very unstable and, thus, not very reliable. You can also see
that the forecasts (the dotted lines after the current time point) become even negative
after a future time point (about 20 points in the future in this example).
438
As you can see in Figure 13, the upgraded version of the Time Series algorithm uses a
MIXED forecast method (default). Therefore, ARTXP is used for short-term forecasts and
ARIMA for long-term forecasts.
439
You can back up the SSAS 2008 or 2008 R2 database and restore it on SSAS
2012.
SQL Server 2012 Upgrade Technical Guide
440
With SSMS, you can create an XMLA script for creating the complete database
or any object in the database and then execute the script on SSAS 2012.
You can open the SSAS 2008 or 2008 R2 project in SSDT 2012 and deploy it on
SSAS 2012.
For example, Figure 15 shows the Backup Database window started from SSMS 2008 R2
in order to back up the 2008 R2 version of the database.
441
Conclusion
There are many good reasons to upgrade your data mining models to SQL Server 2012.
If you are using SSAS 2005, you probably already measure the accuracy of your
predictive models, but you might decide to deploy a different model based on
reliability. In addition, you can get much better long-term forecasting with the Time
Series algorithm in SSAS 2012. Finally, you can consolidate multiple mining structures
into one if you need to compare mining models trained on only a subset of the
structure data. If you are upgrading from SSAS 2008 or 2008 R2, you do not gain any
new data mining features. However, you will probably want to consolidate all SSAS
databases on a single version, so upgrading your data mining models makes sense.
For upgrading your data mining models, a side-by-side migration is preferred to an inplace upgrade. The most important reason is that with a side-by-side installation, you
leave your original models intact. However, if you do not have enough hardware power,
you can perform an in-place upgrade. With thorough testing and planning, your
upgrade can go smoothly whether your mining models are in SSAS 2005, 2008, or 2008
R2.
SQL Server 2012 Upgrade Technical Guide
442
Additional References
443
Microsoft Dynamics
For information about Lync Server 2010, see the TechNet Library document
collection at Microsoft Lync Server 2010 (http://technet.microsoft.com/enus/library/gg398616.aspx).
For information about Lync Server 2010 and SQL Server 2008, see Configure SQL
Server for Lync Server 2010 (http://technet.microsoft.com/enus/library/gg425848.aspx).
For information about upgrading OCS 2007 or OCS 2007 R2 to Lync Server 2010,
download the SQL Server 2008 R2 Upgrade Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
For information about using OCS 2007 with SQL Server 2008 R2, download the
SQL Server 2008 R2 Upgrade Technical Reference Guide
(http://download.microsoft.com/download/3/0/D/30DB8D46-8ACF-442A-99A20F4CE74AE14D/SQL_Server_2008_R2_Upgrade_Technical_Reference_Guide.docx).
SQL Server 2012 Upgrade Technical Guide
444
At the time of this publication, Microsoft System Center 2012 is at the Release
Candidate phase. The current System Center 2010 (SCOM) Management Pack
for SQL Server 2008 R2 is compatible with SQL Server 2012.
Data Protection Manager 2012 will support SQL Server 2012 in a subsequent
service pack release.
445
Microsoft Dynamics
The Microsoft Dynamics products consist of a set of integrated financial, supply chain,
and customer relationship management (CRM) solutions. The products include
Dynamics AX, Dynamics CRM, Dynamics GP, Dynamics NAV, Dynamics SL, and
Dynamics Retail Management System.
Each current Dynamics product supports SQL Server 2012 but has very specific
requirements for Windows versions, SQL Server version, product service/feature packs,
and so on.
Generally, you should upgrade a Dynamics applications database server to SQL Server
2012 only after you follow specific guidance from your Dynamics Technical Account
Manager and by reviewing information found on the different Dynamics support web
sites. If you are a registered Dynamics user, you can find this information at Microsoft
Dynamics Customers and Partners (https://mbs.microsoft.com/partnersource).
Conclusion
As with any upgrade, planning is important for moving to any of these latest product
versions.
Additional References
For an up-to-date collection of additional references for upgrading any of these
Microsoft applications, especially in association with SQL Server, see Upgrade to SQL
Server 2012 (http://msdn.microsoft.com/en-us/library/bb677622(v=sql.110).aspx) and
Windows Server 2008 R2 Overview (http://www.microsoft.com/en-us/servercloud/windows-server/2008-r2-overview.aspx).
Also see the following resources:
446
447
Upgrade From
448
Upgrade From
Services
449
Factors
Notes
Preparing to Upgrade
Decide to upgrade to
SQL Server 2012
Choose SQL Server 2012
enhancements to
implement
Determine instances of
SQL Server to upgrade
Backward compatibility
and upgrade tools
450
Decision
Factors
Determine application
connectivity
requirements
Determine Windows
upgrades
Notes
451
Decision
Factors
Notes
452
Decision
Factors
Determine acceptance
and rollback steps
Post-Upgrade Tasks
Integrate the upgraded
server
Decommission servers
Notes
453
Did this paper help you? Please give us your feedback. Tell us on a scale of 1 (poor) to
5 (excellent), how would you rate this paper and why have you given it this rating? For
example:
Are you rating it high because of having good examples, excellent screenshots,
clear writing, or another reason?
Are you rating it low because of poor examples, fuzzy screenshots, or unclear
writing?
This feedback will help us improve the quality of white papers we release.
Send feedback.
454