Specifications

Upgrading a Data-Tier Application CHAPTER 3 59
Upgrading a Data-Tier Application
Let us recall the past for a moment, when updating changes to existing database schemas
and database applications was a noticeably challenging task. Database administrators usually
created scripts that included the new or updated database schema changes to be deployed.
The other option was to use third-party tools. Both processes could be expensive, time
consuming, and challenging to manage from a release or build perspective. Today, with SQL
Server 2008 R2, database administrators and developers can upgrade their existing deployed
data-tier applications to a new version of the DAC by simply building a new DAC package that
contains the new or updated schema and properties.
The upgrade can be accomplished by using Windows PowerShell commands or the Up-
grade Data-Tier Application Wizard in SQL Server Management Studio. The tools are intend-
ed to upgrade a deployed DAC to a different version of the same application. For example,
an organization may want to upgrade the Accounting DAC from version 1.0 to version 2.0.
The upgrade wizard rst preserves the database that will be upgraded by making a copy of
it. It then creates a new database that includes the schema and objects of the new version of
the DAC. The original database's mode is then set to read-only, and the data is copied to the
new version. After the data transfer is complete, the new DAC assumes the original database
name. The renamed DAC remains on the SQL Server instance.
There are a few actions that data-tier developers and database administrators should
always perform before a data-tier application upgrade. First, the schema associated with the
original DAC should be compared to the new DAC. Second, database administrators must
conrm that the amount of data held in the existing DAC does not exceed the size limit of the
new DAC database. To upgrade a data-tier application by using the Upgrade Data-Tier Ap-
plication Wizard, follow these steps:
1. In Object Explorer, connect to a SQL Server instance containing the DAC you want to
upgrade.
2. Expand the SQL Server instance, and then expand the Management folder.
3. Expand the data-tier applications tree and select the data-tier application that you
want to upgrade.
4. Right-click the data-tier application, and select Upgrade Data-Tier Application. This
starts the Upgrade Data-Tier Application Wizard.
5. Review the information on the Introduction page, and then click Next to begin the up-
grade process. Select the Do Not Show This Page Again check box if you do not want
the Introduction page displayed in the future when using the wizard.