This article is the second installment of a multi-part series detailing the SQL Server Upgrade process from the technical, logistical and business perspective. Read the first part here.
Introduction to SQL Server Upgrades
The first article of the series -- "Upgrade overview and project planning" -- detailed the business justification for upgrades to SQL Server 2000 related to TCO (Total Cost of Ownership), automation capabilities and new features from both business and DBA perspectives. The next portion of the article outlined a detailed process to break down the SQL Server 2000 project as well as the applicable upgrade project phases using high-level steps. Both sets of information were in simple terms for DBAs new to the upgrade process, experienced DBAs needing a refresher, or for technical managers interested in the level of effort and overall planning needed for a SQL Server 2000 upgrade.
This article will begin to detail the technical components faced by DBAs and developers during the upgrade process. The technical components detail critical upgrade decisions related to ANSI NULLS, quoted identifiers and other items. In addition, a valuable redundant upgrade architecture is introduced for the upgrade to prevent a significant set of problems. The combination of upgrade decisions and redundant upgrade architecture can easily make or break the upgrade for your business. Needless to say, these items require forethought at the inception of the project by the technical staff to prevent management's biggest fear: no available platform following the upgrade.
Critical upgrade decisions
In order to accurately and efficiently upgrade to SQL Server 2000, it is necessary to research critical decisions and determine the appropriate configurations based on the business environment. This is certainly the case with SQL Server upgrades because depending on the configurations entered during the upgrade and in the SQL Server 2000 environment, code can operate differently, causing unexpected results. Further, over the course of SQL Server's life, Microsoft has implemented a number of default configurations which have subsequently changed between versions. As such, the table below outlines key SQL Server configurations the upgrade must address due to the potential impacts.
CRITICAL UPGRADE DECISIONS2
|ITEM||SQL SERVER 6.5||SQL SERVER 2000||ADDITIONAL INFORMATION|
|ANSI NULLS||Default - ANSI NULLS is OFF||Default - ANSI NULLS is ON||Validate NULL comparisons are operating properly and ensure IS NULL and IS NOT NULL expressions are being used rather than = NULL or <> NULL|
|Quoted Identifiers||Default – SET QUOTED_IDENTIFIER OFF||Default - SET QUOTED_IDENTIFIER ON||
|SQL Server Keywords||Basic list of Keywords||Expanded list of Keywords that are reserved||Ensure object names are not SQL Server Keywords or rely on the Quoted Identifiers|
|System Objects||Baseline set of objects||
||Pay close attention to code directly accessing system tables and migrate to use stored procedures and INFORMATIONSCHEMA Views|
|Replication||Transactional Replication and Remote Servers||Snapshot and Merge Replication and Linked Server Additions||See the 'Replication Overview' article in Books Online for additional details|
|Registry Settings||Finite number of Registry Keys||Support for Multiple Instances and additional applications||Additional registry keys with the addition of Analysis Services and English Query|
|JOIN Types||ANSI syntax with WHERE clause comparison||ANSI JOIN syntax (INNER, OUTER, FULL and CROSS)||See the 'Types of Joins' article in Books Online for additional details|
|Query Plans||Default – LOOP||
||See the 'Understanding Hash Joins', 'Understanding Merge Joins', 'Understanding Nested Loops Joins' articles in Books Online for additional details|
|Database Compatibility Modes||Not Available||65, 70 and 80 Compatibility Modes||T-SQL command support based on the database configuration|
|Database Recovery Options||Read-Only Mode||Standby Mode||See the 'Using Standby Servers' article in Books Online for additional details|
|Database Recovery Models||Truncate Log on Checkpoint||Simple, Bulk Logged, Full||See the 'Using Recovery Models' article in Books Online for additional details|
|Sort Orders and Character Sets||SQL Server Specific||SQL Server or Windows Locale Options||See the 'Collation Settings in Setup' article in Books Online for additional details|
SQL Server Upgrade Wizard Versus BCP or DTS
One critical decision that a DBA faces is determining the proper tool for the SQL Server 2000 upgrade. The Microsoft SQL Server 2000 upgrade wizard is available for free as well as BCP (Bulk Copy) or DTS (Data Transformation Services). The upgrade wizard is typically the natural choice because Microsoft has built this tool specifically for the upgrade to verify the objects properly migrate, conduct exhaustive integrity checks and deliver the needed error handling. A second option is BCP or DTS, to migrate the data from SQL Server 6.5 to 2000. With this option it is a requirement to script the appropriate DDL (Data Definition Language) and DML (Data Manipulation Language) from the SQL Server 6.5 environment and apply the scripts to SQL Server 2000 in the proper order and verify no errors have occurred. Once these steps are completed, then it is necessary to compare row and object counts between the SQL Server 6.5 to 2000 environments. This would be followed by post upgrade testing with either the upgrade Wizard or the BCPDTS option prior to the production release.
As far as selecting the appropriate upgrade tool, one must assess the upgrade requirements in order to determine the ideal tool. Most upgrades can be categorized as one of the following:
- Complete server upgrade where all of the database on a single server are upgraded to another dedicated server
- Single database is upgraded to a shared SQL Server
- Consolidation of multiple databases into a single database
- Consolidation of multiple SQL Servers to a single SQL Server
Although these are the typical scenarios, more may exist depending on the unique characteristics of your environment. With the four scenarios listed above, I recommend the Microsoft upgrade wizard for most scenarios for the following reasons:
- A high level of effort is needed to duplicate the upgrade wizard functionality with the same level of error handling for BCP/DTS. Further, based on basic testing BCP/DTS is not substantially faster in most situations to justify the additional DBA time to setup and test this alternative.
- The upgrade wizard in an automated fashion manages the upgrade of all database objects and particular SQL Server configurations. Unfortunately, BCP and DTS impose a manual process from SQL Server 6.5 to 2000 with the ability to only migrate data. In this scenario, it is necessary for the DBA to properly manage the remainder of the code: i.e., Logins, Users, Stored Procedures, etc. It is also necessary to allocate time for rebuilding indexes which can be a very time consuming proposition that is sometimes overlooked.
- If you need to consolidate all the data from numerous SQL Server 6.5 databases to a single SQL Server 2000 database, I recommend first upgrading all of the databases to SQL Server 2000. Then leverage the advanced DTS features between the SQL Server 2000 databases for consolidation purposes. Another consolidation option is to use backup and restore commands to consolidate SQL Servers. If time is of the essence, use the DBAssociatesIT product SQL LiteSpeed for 50 to 90% time savings in order to expedite the consolidation process.
- If the entire SQL Server is being upgraded, the SQL Server upgrade wizard can automatically migrate the scheduled tasks. To accomplish this, it is necessary to upgrade the MSDB database and select the appropriate scheduled tasks options in the wizard interface. During consolidation scenarios where SQL Server scheduled tasks need to be migrated to jobs, handle those items individually via scripts. Unfortunately, BCP and DTS in this scenario will not be able to assist in the process from SQL Server 6.5 to 2000 and it will be necessary to script those items.
- When replication is setup in the environment, it will be necessary to un-subscribe and re-subscribe for the upgrade. Remote servers could become an issue during consolidation, as server and database names could change. As such, it may be easiest to leverage the upgrade wizard and select the appropriate replication settings in the interface to simplify the process or remove replication and reestablish following the upgrade. Once again BCP and DTS cannot assist in automating or expediting the replication items due to the limited capabilities between SQL Server 6.5 and 2000.
I do not want to be labeled as only having a hammer and seeing everything as a nail, but I believe in most circumstances the upgrade wizard will address most upgrade needs at most companies. The next article in the series will elaborate on the upgrade wizard steps in order to complete the upgrade under the circumstances listed above.
Redundant upgrade Architecture - SQL Server 6.5 to 2000
As you begin to work towards upgrading your core business systems to SQL Server 2000, ensure that you develop a comprehensive plan to properly manage the project successfully. An upgrade at the surface appears simplistic, but can become difficult to coordinate with many team members from multiple departments. Typically, numerous team members are responsible for a multitude of tasks such as hardware configurations, testing and code modifications to successfully deliver a reliable platform. For additional IT project management information, stay tuned for a project management eBook that I will be releasing in the summer of 2003 to address many of these critical items.
With this being said, Microsoft provides two basic recommendations for upgrading from SQL Server 6.5 to 2000. The options are either via the pipeline upgrade or the machine to machine upgrade (3).
- Pipeline upgrade: occurs on a single machine where SQL Server 2000 is installed over SQL Server 6.5 in order to complete the upgrade on a single server. Both the SQL Server 6.5 and 2000 databases are retained during scenarios with sufficient disk space as respective default instances, but only one version of SQL Server can be active at any given time3.
- Machine-to-machine upgrade: occurs over the network between the SQL Server 6.5 and SQL Server 2000 server with each machine operating independently, but controlled by the upgrade Wizard3.
Unfortunately, neither of these options delivers a fail safe mechanism for DBAs, nor is a clean SQL Server introduced to your production environment. Even with the Machine to Machine upgrade some historical system files may be migrated. This scenario introduces the risk of a network glitch on the LAN that could cause problems during critical downtime needed to complete the upgrade. These aspects are critical to efficiently managing the upgrade and the long term SQL Server environment. Further, the options are solely focused on the steps related to the SQL Server upgrade as opposed to a comprehensive initiative to support the business during each step of the larger project at hand.
A redundant upgrade architecture has been developed to address the needs previously outlined as well as the elimination of an extensive amount of network traffic that could ultimately result in a network glitch. The architecture demonstrated below ensures a successful SQL Server 2000 upgrade by retaining the SQL Server 6.5 server as a fail safe mechanism and introducing a clean SQL Server 2000 to the production environment. All of the upgrade tasks are performed on the Migration SQL Server, via the Microsoft upgrade wizard, with reliable backuprestoration commands used to migrate the data between the three servers; i.e., SQL Server 6.5 Production to Migration SQL Server and Migration SQL Server to SQL Server 2000 Production as illustrated in the following diagram.
First, a fail safe mechanism for the SQL Server 6.5 environment is needed to ensure the business system will be available at the completion of the downtime. If the upgrade experiences a situation out of the DBAs control, such as an unexpected power outage, it will be stressful for the DBA to recover the SQL Server 6.5 environment. The DBA needs to complete the recovery in an accurate manner, in order for users to conduct business. Another scenario where the SQL Server 6.5 server acts as a fail safe mechanism is during a production upgrade where there is not confidence in the SQL Server 2000 platform following the upgrade as determined by testing. For example, if a code change is introduced after testing is completed and uncovered during the upgrade, it is prudent to validate the code. If the code implications are not clearly understood, it may be beneficial to revert to the SQL Server 6.5 environment rather than moving forward with the upgrade based on the level of uncertainty. Without the SQL Server 6.5 environment maintained, it will be impossible to return to this platform to conduct business as usual. In an upcoming article, processes for configuring the SQL Server 6.5 environment to ensure this server is not altered will be detailed.
Second, the availability of a 'clean' production SQL Server 2000 server is beneficial in order to move forward with an issue-free server. Too often, a server with multiple software installations can quickly become a suspect for unexplainable server behavior due to the previous software installations, drivers and subsequent files. Unfortunately, application un-installs are rarely as clean as expected. Typically, the un-install leaves remnants in the registry that can cause more problems in the long term as opposed to instilling confidence in the environment with a clean Windows and SQL Server installation.
For some companies, the needed hardware and software are not an issue while at other organizations the additional hardware can become a major challenge. Ideally, a new piece of hardware that is properly tested should be introduced to the environment as the SQL Server 2000 Production server. It is always in your best interest as a DBA to ensure that production hardware is under warranty with the manufacturer in case a critical problem occurs. Too often production hardware is not under warranty, then low and behold a serious problem occurs that requires expensive equipment replacements and labor that a warranty would have easily resolved.
If a situation arises and hardware is not available in your organization or the budget, consider a short term lease for a temporary server. Another option may be to build a server or use a PC depending on the database's size. Although this may not be the ideal option, it may resolve the issues at hand and provide the needed level of comfort from a redundancy perspective. Be sure to incorporate these components into your plan as critical steps in order to properly address your upgrade and move forward with the proper hardware and software configurations.
An upgrade is a significant event in your organization and must be planned for accordingly. Planning will ensure confidence in moving forward with the upgraded system or have the ability to revert to the previous system in case an issue arises. As such, a comprehensive project plan should be developed in order to achieve proper technical decision making that is critical to the success of the upgrade. Needless to say, sufficient testing is also required to ensure the selected configurations are meeting your business needs. This confidence can be achieved with the redundant upgrade architecture to ensure a clean SQL Server 2000 server is introduced into the production environment as well as the ability to revert to the SQL Server 6.5 environment when necessary. Good luck!
In the coming weeks, the next article in the SQL Server upgrade series will be released related to an upgrade checklist for the technical team and the necessary steps for the SQL Server 2000 upgrade Wizard. Be sure to check it out!
- Successful Project Management for Database Administrators – Jeremy Kadlec – https://www.edgewoodsolutions.com/resources/presentations.asp - November 2002 - SQL PASS 2002 Seattle Community Summit - Accessed 01.28.2003
- SQL Server 2000 Books Online - Microsoft Corporation – Published January 2003 - Accessed 01.28.2003
- Upgrading to SQL Server 2000 – Microsoft Corporation - https://www.microsoft.com/en-us/sql-server/sql-server-2017 - Published September 2000 – Accessed 01.28.2003
Published 05.28.2003 – Jeremy Kadlec – Edgewood Solutions. All rights reserved 2003. Copyright © 2002-2003 Edgewood Solutions. Some names and products listed are the registered trademarks of their respective owners.
About the Author
Jeremy Kadlec is the Principal Database Engineer at Edgewood Solutions, a technology services company delivering full spectrum Microsoft SQL Server Services on the east coast of the United States, primarily in the Washington DC and Boston areas. Jeremy can be reached at 410.591.4683 or email@example.com. Learn more about how Edgewood Solutions delivers 'databases at their finest' at www.edgewoodsolutions.com.
For More Information
- Feedback: E-mail the editor with your thoughts about this tip.
- More tips: Hundreds of free SQL Server tips and scripts.
- Tip contest: Have a SQL Server tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize -- submit your tip today!
- Ask the Experts: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.
- Forums: Ask your technical SQL Server questions--or help out your peers by answering them--in our active forums.
- Best Web Links: SQL Server tips, tutorials, and scripts from around the Web.