Upgrade SQL Server
Upgrade SQL Server
1 Document Control............................................................................................................3
1.3 References.....................................................................................................3
2 Introduction.......................................................................................................................3
3 Summary............................................................................................................................4
5.1.6 Replication...........................................................................................5
Page 1 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
9 Appendices.......................................................................................................................12
Page 2 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
1.3 References
Online SQL Server Support home page
http://www.microsoft.com/sql/default.mspx
http://www.microsoft.com/sql/2005/default.mspx
http://www.microsoft.com/technet/prodtechnol/sql/default.mspx
2 Introduction
This document is written for the experienced SQL Server DBA. It is assumed that the DBA
knows T-SQL, Enterprise Manager, SQL Server 2005 Management Studio, and general SQL
Server database administration. This is not a Step-by-Step document for a novice DBA.
Page 3 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
This guide contains two components: Upgrading an existing instance of SQL Server to SQL
Server 2005 and migrating databases to SQL 2005. To read only about migrating
databases, skip to Section 8.
A direct upgrade to SQL Server 2005 is supported for SQL Server 7.0 SP4 and SQL Server
2000 SP3a. There is no direct instance upgrade from SQL Server 6.5 to 2005. The DBA
must first upgrade the 6.5 instance to 7.0 SP4, then to SQL Server 2005.
After an upgrade, SQL Server 2005 automatically sets the database compatibility level to
the level of the previous version of SQL Server. Therefore, if you upgrade from SQL Server
7.0 through SQL Server 2000 and then to SQL Server 2005, the compatibility level will be
set to SQL Server 2000.
3 Summary
This document provides a general checklist for upgrading SQL Server 7.0 or SQL Server
2000 instance to SQL Server 2005. It does not replace the SQL Server 2005 installation and
configuration documentation. It is a subset of information that can be used as a general
checklist. The information in this document is derived from the more detailed SQL Server
upgrade documents. It has been tested several times to ensure accuracy of the upgrade
instructions.
http://msdn2.microsoft.com/en-us/library/ms143506
Page 4 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
Disk space
Feature
requirement
Database Engine and data files, Replication, and Full-Text Search 150 MB
Integration Services 9 MB
Client Components 12 MB
Management Tools 70 MB
Development Tools 20 MB
SQL Server Books Online and SQL Server Mobile Books Online 15 MB
5.1.6 Replication
Stop any Replication and clear out the replication log.
Page 5 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
1. On the SQL Server Component Update page, Setup installs software required for
SQL Server 2005. For more information about component requirements, click the
Help button at the bottom of the page. To begin the component update process,
click Install. To continue after the update completes, click Finish.
3. On the Components to Install page, select the components for your installation. A
description for each component group appears in the Components to be Installed
pane when you select it. You can select any combination of check boxes. When you
select SQL Server or Analysis Services, if Setup detects that you are installing to a
virtual server, the Install as a Failover Cluster check box is enabled. You must
select this option to install a failover cluster.
4. If you clicked Advanced on the previous page, the Feature Selection page is
displayed. On the Feature Selection page, select the program features to install
using the drop-down boxes. To install components to a custom directory, select the
feature and then click Browse. To continue, click Next when your feature selections
are complete.
Page 6 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
http://www.nnam.eds.com/
6. To upgrade a SQL Server named instance already installed on your computer, click
Named Instance and then type the instance name in the space provided, or click
Installed Instances on the Instance Name page, select an instance from the
Installed Instances list and click OK to populate the instance name field. After you
have selected the instance to upgrade, click Next to continue.
8. On the Existing Components page, Setup lists the SQL Server components
installed on your computer. Components that can be upgraded to SQL Server 2005
have their check boxes enabled. If a component has a check box that is unavailable,
the component does not qualify for upgrade to SQL Server 2005. To view a report of
available options and alternatives, click Details. To upgrade a component listed on
the Existing Components page, select its check box and click Next.
9. If you are adding new components, on the Service Account page, specify the user
name, password, and domain name for the non-SQL Server accounts. For this
release, SQL Server 2005 Setup uses the service account information of the existing
SQL Server service being upgraded. You can use the same account for all of the
services.
10. You can optionally specify an individual account for each service. Select the
Customize for each service account check box, select a service name from the list
box, and then provide login credentials for each of the services in the list. To
proceed, click Next.
The domain name cannot be a full Domain Name Service (DNS) name. For example,
if your DNS name is my-domain-name.com, enter "my-domain-name" in the Domain
text box. SQL Server Setup does not accept "my-domain-name.com" in the Domain
text box.
11. The Upgrade Logon Information page is displayed if the SQL Server instance to
be upgraded is configured to use Mixed Mode (Windows Authentication or SQL
Server Authentication). Credentials supplied on this page are used to connect to the
existing SQL Server instance so that upgrade scripts can be run. If the existing SQL
Server instance is configured to use Windows Authentication, this page is not
displayed. To proceed, click Next.
Page 7 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
12. On the Ready to Install page, review the summary of features and components for
your SQL Server installation. For an upgrade scenario, all components and features
of the existing instance are selected for the upgrade. To proceed, click Install.
13. On the Completing the Microsoft SQL Server Installation Wizard page, you
can view the Setup summary log by clicking the link provided on this page. To exit
the SQL Server Installation Wizard, click Finish.
14. If you are instructed to restart the computer, do so now. It is important to read the
message from the Setup program when you are done with installation. Failure to
restart the computer may cause failures when you run the Setup program in the
future.
7 Post-Upgrade
After upgrading the Database Engine to SQL Server 2005, complete the following tasks:
Register your servers – Upgrade removes registry settings for the previous SQL
Server instance. After upgrading, you must reregister your servers.
Update usage counters - In earlier versions of SQL Server, the values for the
table and index row counts and page counts can become incorrect. To correct any
invalid row or page counts, we recommend that you run DBCC UPDATEUSAGE on all
databases following upgrade.
Configure your new SQL Server installation - To reduce the attackable surface
area of a system, SQL Server 2005 selectively installs and activates key services
and features. For more information on how to activate SQL Server 2005 features,
see SQL Server Surface Area Configuration.
Also, be sure to apply the latest Service Pack and Hotfixes for SQL Server 2005
Components. Those can be found here:
Page 8 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
Hofixes: http://support.microsoft.com/kb/918222/
Lastly, be sure to change the Autogrowth setting on the ‘model’ database. By default, in
SQL Server 2005, it is set to 1MB. Change it to a more appropriate value, such as 500MB.
Detach/Attach database
Backup/Restore database
It must be noted that these upgrade paths are available for SQL Server 7.0 SP4 and SQL
Server 2000 SP3a databases only. Your source databases must be upgraded to either of
these versions before moving to SQL Server 2005. For instance, SQL Server 6.5 database
can be upgraded to SQL Server 7.0 SP4 in order to be moved to SQL Server 2005.
If a database that was created by using SQL Server 6.5 or earlier has not been upgraded to
SQL Server 2005, you can convert it to SQL Server 2005 by using one of the following
methods. Remember, the schema must exist in the SQL 2005 database in order to directly
import data. Also, remember Referential Integrity when considering your order of copying
objects:
Use the Integration Services (SSIS) Import and Export Wizard to copy data between
multiple instances of SQL Server.
Migrate data from a SQL Server 6.0 or SQL Server 6.5 database by using bcp out to
export the data into a data file in character mode Then, use bcp in with the -V
option to import the data into a SQL Server 2005 database.
This topic describes how to use the Copy Database Wizard to upgrade a SQL Server 2000
database to a SQL Server 2005 database.
When using the Copy Database Wizard to upgrade a database, there are three
requirements. Firstly, before upgrading, place the database in single user mode, and make
sure that no applications or services are trying to access the database. Secondly, do not use
Page 9 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
Connect to any instance of SQL Server Database Engine using Object Explorer in SQL Server
Management Studio.
Expand Databases, right-click a database, point to Tasks, and then click Copy Database.
In SQL Server 2005, you can use detach and attach to upgrade a user database from SQL
Server version 7.0 or SQL Server 2000. However, some restrictions apply:
1. Backups of the master, model or msdb database created using SQL Server 7.0 or
2000 cannot be attached in SQL Server 2005.
3. If you attach a replicated database that was copied rather than detached:
If you attach the database to an upgraded version of the same server instance,
you must execute sp_vupgrade_replication to upgrade replication after
attaching is complete.
When using the APPLY, PIVOT, TABLESAMPLE, or UNPIVOT keywords against databases that
are upgraded to SQL Server 2005, the database's compatibility level must be set to 90.
In SQL Server 2000 Service Pack 3 (SP3) and later versions of SQL Server, attach and
detach disable cross-database ownership chaining for the database.
Detach the database from the SQL Server 7.0 or 2000 server instance using the
sp_detach_db stored procedure.
Optionally, move the detached database file(s) and the log file(s).
Page 10 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
If you try to attach the database without specifying the log file, the attach operation will
look for the log file in its original location. If the original copy of the log still exists there,
that copy is attached. To avoid using the original log file, either specify the path of the
new log file or remove the original copy of the log file (after copying it to the new
location).
1. Attach the copied files to the SQL Server 2005 server instance, using the CREATE
DATABASE Transact-SQL statement with the FOR ATTACH or FOR
ATTACH_REBUILD_LOG option. For more information, see CREATE DATABASE
(Transact-SQL).
2. Optionally, if you are making a copy of the database (rather than moving it), you
can reattach the original database on the SQL Server 7.0 or 2000 server using the
sp_attach_db or sp_attach_single_file_db stored procedure
When you use backup and restore to copy a database to another instance of SQL Server, the
source and destination computers can be any platform on which SQL Server runs.
1. Back up the source database, residing on an instance of SQL Server 7.0, SQL
Server 2000, or SQL Server 2005. The computer on which this instance of SQL
Server is running is the source computer.
2. On the computer to which you want to copy the database (the destination
computer), connect to the instance of SQL Server on which you plan to restore the
database. If needed, on the destination server instance, create the same backup
devices as used to the backup of the source databases.
3. Restore the backup of the source database on the destination computer. Restoring
the database automatically creates all of the database files.
The following topics address additional considerations that may affect this process.
If the files within the database backup cannot be restored onto the destination computer
because of the reasons mentioned earlier, it is necessary to move the files to a new location
while they are being restored. For example:
Page 11 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
You want to restore a database from backups created in the default location of either
SQL Server 7.0 or SQL Server 2000.
The name of the database can be changed as it is restored to the destination computer,
without having to restore the database first and then change the name manually. For
example, it may be necessary to change the database name from Sales to SalesCopy to
indicate that this is a copy of a database.
The database name that is explicitly supplied when you restore a database is used
automatically as the new database name. Because the database name does not already
exist, a new one is created by using the files in the backup.
When a database is restored on another computer, the SQL Server login or Microsoft
Windows user who initiates the restore operation becomes the owner of the new database
automatically. When the database is restored, the system administrator or the new database
owner can change database ownership. To prevent unauthorized restoration of a database,
use media or backup set passwords.
To ensure there are no orphaned users in the new database, be sure to synchronize the
database users with newly created SQL Server Logins or Windows Users/Groups, if Windows
Authentication is used. The DBA can accomplish this through the use of the
sp_change_users_login procedure in the master database.
In earlier versions of SQL Server, the values for the table and index row counts and page
counts can become incorrect. Therefore, databases that were created on versions prior to
SQL Server 2005 may contain incorrect counts. After you upgrade a database to SQL Server
Page 12 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
9 Appendices
If you want to migrate your DTS packages, SQL Server 2005 provides the Package Migration
Wizard to help in this process. Because the wizard leaves your original packages intact, you
can always continue to use the original packages if you experience migration difficulties.
The Package Migration Wizard is installed when Integration Services is installed.
1. Optionally, run the Upgrade Advisor to analyze your existing packages and obtain a report of
potential migration issues.
3. Reconfigure the package items that must be manually reconfigured as reported by the
Upgrade Advisor or the wizard.
Page 13 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005
Deprecated features include features that will not be supported in the next version of SQL
Server and features that will not be supported in a future version of SQL Server. Check
here for details:
http://msdn2.microsoft.com/en-us/library/ms143729.aspx
This topic describes the changes made to the Database Engine in Microsoft SQL Server 2005
that could cause applications based on earlier versions of SQL Server to break. Check here
for details:
http://msdn2.microsoft.com/en-us/library/ms143179.aspx
http://msdn2.microsoft.com/en-us/library/ms143359.aspx
There are many Database Engine features from earlier versions of SQL Server are not
supported in SQL Server 2005. Check here for details:
http://msdn2.microsoft.com/en-us/library/ms144262.aspx
Page 14 of 1613
EDS and the EDS logo are registered trademarks of Electronic Data Systems Corporation. © 2005 EDS. All rights reserved. 07/2005