Anda di halaman 1dari 107

Things to Know Before You Install

SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
This Chapter

• This chapter is all about installing and


upgrading to SQL Server 2008
• Included in this chapter are:
– Installing SQL Server 2008 for the first time
– Upgrading an entire SQL Server 2000 and 2005 to
SQL Server 2008
This Chapter

• Related topics not covered in this chapter


but covered later:
– Upgrading a single database to SQL Server 2008
What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
First Time Install of SQL Server
2008

• There are several items you need to


know before you install SQL Server 2008
for the first time
1. What type of server are you installing?
2. Hardware, software requirements
3. 32-bit or 64-bit?
4. Which machine(s) need to run the install program?
5. What security model will you use?
6. Where will you put the files?
7. What default server collation will you use?

• We’ll look at each one individually


Things You Need to Know Before
Installing SQL Server 2008

1. What type of server are you installing?


• The type of server determines the hardware
• What is the database profile of your server?
• 1 small database (DB) • 1 Large DB and 1 medium DB
• Multiple small DBs • 1 Large DB and multiple medium DBs
• 1 medium DB • 1 Very Large DB (VLDB)
• 1 medium DB and multiple small DBs • 1 VLDB and multiple medium DBs
• Multiple medium DBs • 1 VLDB and 1 Large DB
• 1 Large DB • 1 VLDB and multiple large DBs
• 1 Large DB and multiple small DBs
Things You Need to Know Before
Installing SQL Server 2008

• What other functions will this server


perform?
• SQL Server and Reporting Services • Standalone Analysis Services
on same machine • Standalone SQL Server
• SQL Server and Analysis Services on • File server
same machine • Domain controller
• Standalone Reporting Services • Mail server
server • SharePoint server
• Reporting Services web farm
In the next video…

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things to Know Before You Install
SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things You Need to Know Before
Installing SQL Server 2008

2. Hardware, software requirements


– The more you know about the type of server
you are installing, the more you can accurately
predict server needs
– Disk space is cheap but make sure you plan for
growth
Things You Need to Know Before
Installing SQL Server 2008

2. Hardware, software requirements


– Small and medium size databases need RAID 1
(OS, logs) and RAID 5 (data files) sets
– Large and VLDBs need RAID 10 SANs (Storage
Area Networks)
– Don’t forget about backups!
Things You Need to Know Before
Installing SQL Server 2008

3. 32-bit or 64-bit?
– Did you know? Windows Server 2008 will be
the last 32-bit server from Microsoft
– The advantage of 64-bit architectures are that
you can address more physical memory
– In a 32-bit system with 16GB of physical RAM,
you can only directly address 4GB
• You can still use the rest but it uses Address
Windowing Extensions (AWE) to “map” to the
memory whereas 64-bit can address the memory
directly
Things You Need to Know Before
Installing SQL Server 2008

3. 32-bit or 64-bit?
– 64-bit supports larger numbers of processors
and more linear scalability per processor
– This may mean lower Total Cost of Ownership
(TCO) since you can “do more with less
hardware”
Things You Need to Know Before
Installing SQL Server 2008

4. Which machine(s) need to run the


install program?
– One install on the server
– One install on each workstation that needs the
management/development tools
– Possible need to install SQL Server Native Client
on clients
In the next video…

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things to Know Before You Install
SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things You Need to Know Before
Installing SQL Server 2008

5. What security model will you use?


– Two choices:
• Windows Authentication only
• Combination of Windows Authentication and SQL
Server Authentication (“Mixed Mode”)
Things You Need to Know Before
Installing SQL Server 2008

5. What security model will you use?


– Windows Authentication only
• Can grant or deny Windows user or Windows group
access to SQL Server
Things You Need to Know Before
Installing SQL Server 2008
5. Windows Authentication Example:
– Chad is the user “chadw”
– chadw belongs to two Windows groups: Users and
SQLDevelopers
– The DBA adds “SQLDevelopers” group as a login to the
SQL Server
• Question: Can Chad now login to the SQL
Server?
– Yes
• Question: Who else can log in?
– Anyone else who is a member of the SQLDevelopers
group
Things You Need to Know Before
Installing SQL Server 2008

5. Windows Authentication
– PROs:
• No passwords are stored in SQL Server or sent across the
network
• Centralized management of users and groups (in Active
Directory)
– CONs
• The SQL Server DBA is no longer in control of security
– Windows admins can now add/remove users from Windows
groups thus elevating/denying privileges in SQL Server
• Non-Windows machines have trouble logging in
• Anyone without a Windows account cannot use SQL
Server
Things You Need to Know Before
Installing SQL Server 2008

5. What security model will you use?


– Mixed Mode
• Can grant or deny Windows user or Windows group
access to SQL Server
• DBA can also create SQL Server logins
– Have a login name and a password
Things You Need to Know Before
Installing SQL Server 2008

5. Mixed Mode Example


– Scott’s iPhone runs an application that uses SQL
Server
– Scott is a consultant who not have a Windows
account
– The DBA adds a SQL Server login “scottw” with
a password
Things You Need to Know Before
Installing SQL Server 2008

5. Mixed Mode
– PROs:
• Best of Windows Authentication mode
• SQL Server can control security more granularly
– CONs
• Passwords are passed across network
– Can be encrypted
• Microsoft says this is less secure
Things You Need to Know Before
Installing SQL Server 2008

5. Account Provisioning
– Depending on what features you install, you must
determine how they log in
– The following features are require a service account:
• SQL Server Database Engine
• SQL Server Agent
• SQL Server Browser
• SQL Server Analysis Services *
• SQL Server Reporting Services *
• SQL Server Full-text Daemon Launcher *
• SQL Server Integration Services *

* Only if you install this feature


Things You Need to Know Before
Installing SQL Server 2008

• Always run SQL Server services using


the lowest possible user privilege
• No need to run any SQL Server service
as Administrator
• Use separate accounts for all SQL
Server services (no account sharing)
Things You Need to Know Before
Installing SQL Server 2008

5. SQL Server Database Engine


– Usually a domain account
• Do not use NETWORK SERVICE account
• LOCAL SYSTEM is a bad idea since it has elevated
privileges
– May need to assign additional permissions to
the user account to allow SQL Server to access
directories for backups or import/export
In the next video…

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things to Know Before You Install
SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things You Need to Know Before
Installing SQL Server 2008

6. Where will you put the files?


– During the installation you are asked:
• Where do you want the “Program Files” to go?
• Where do you want the database and log files to go?
• Where do you want your backups to go?
Things You Need to Know Before
Installing SQL Server 2008

6. Default locations:
Item Path Can Be
Changed?
SQL Server \Program Files\Microsoft SQL Server\MSSQL10.<INSTANCE_ID>\ Yes
Program Files
Reporting Services \Program Files\Microsoft SQL Server\MSRSL10.<INSTANCE_ID>\ Yes
Program Files
Analysis Services \Program Files\Microsoft SQL Server\MSASL10.<INSTANCE_ID>\ Yes
Program Files
SQL Server Data <INSTALL DIRECTORY>\Data\ Yes
Files
SQL Server Backups <INSTALL DIRECTORY>\Backup\ Yes

Each installation is assigned an INSTANCE_ID. How this is named is covered later


Things You Need to Know Before
Installing SQL Server 2008

6. Where should you put the files?


– Program files should likely be in default location
– Data files and log files should be on RAID 5 and
RAID 1 respectively for small/medium
installations
– Backups should be on RAID 1 for small/medium
installations
Things You Need to Know Before
Installing SQL Server 2008

• Customize your installation:


Things You Need to Know Before
Installing SQL Server 2008

7. What server collation should you use?


– During setup you must decide the default
server collation
– Collation is for working with character data
•Things You Need to Know Before
Installing SQL Server 2008

SELECT * FROM Customer WHERE Lastname=‘Pérez’

– Which of the following results would you want


returned?
• Perez • PÉREZ • péréz
• PEREZ • pérez • Peréez
• perez • Péréz • PERÉZ
• Pérez • PÉRÉZ • peréz
Things You Need to Know Before
Installing SQL Server 2008

7. Collation defines:
– Sort order
• Does “A” sort before “a”?
– Whether accents, binary, and case-sensitivity
matter
• Are “Pérez” and “perez” the same?
– The characters available in a column
• More on this later...
Things You Need to Know Before
Installing SQL Server 2008

7. There are two types of Collations


– Windows Collation
• What is the collation of your Windows machine?
• Used when:
– You know that all of your Windows machines have the
“correct” collation settings
Things You Need to Know Before
Installing SQL Server 2008

7. There are two types of Collations


– SQL Server Collation
• Who cares what the collation of my Windows
machine is!
• Used when:
– You want to install multiple instances with different
collations
– Your Windows machines have different collations but you
want all SQL Servers to have the same collation
In the next video…

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Things to Know Before You Install
SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Instances

• Instances are “installations of SQL


Server”
• There are two types:
– Default – the name of the computer is the name
of the InstanceId
– Named – you must provide a unique InstanceId
Instances

• Most sites usually have a single instance


– Whether it is a default or named instance is hard
to assume
• Instances compete for:
– CPU
– Memory
– Disk space
Instances

• Single instances are appropriate for:


– Situations where having a single server for
security and management is best
– Serving multiple databases to a single user
– All databases should be on the same
version/edition of SQL Server
Instances

• Multiple instances are appropriate for:


– Situations where having a single server for all
databases would be a security breach
– Databases need be on the different
versions/editions of SQL Server
– Same database needs to exist on different
versions/editions of SQL Server (for testing)
Instances

• Multiple instances can be:


– Mixed versions
• SQL Server 2000, 2005, 2008
– Mixed Editions
• Enterprise, Developer, Standard, Express
– Mixed Releases
• SQL Server 2008 RTW, SQL Server 2008 SP1
Instances

• There can be only one default instance


• Instance names must be:
– Unique
– First character must be a letter
– Not contain underscores or #
– 16 characters or less
– Cannot use the word “DEFAULT” anywhere
– No funny business
Instances

• Instance Miscellany:
– Enterprise Edition: up to 50 instances
– Other editions: up to 16 instances
Instances

• Licensing
– All editions now allow CPU license to cover
“unlimited instances per operating environment”
Things to Know After You Install
SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Service Packs and Hotfixes

• Like all software, your SQL Server needs


to be updated
• You need updates for any and all features
you’ve installed
– SQL Server
– Analysis Services
– Reporting Services
– And all the rest that don’t fit on this page
Service Packs and Hotfixes

• Primarily, SQL Server is updated using the


Incremental Service Model (ISM)
– The ISM is meant to be a standardized approach
to keeping SQL Server up to date
– All ISM releases can be requested by any customer
regardless of their support offering
Service Packs and Hotfixes

• ISM is a way to distribute “hotfixes”


– Critical on-demand (COD)
• You must be vetted by Microsoft to qualify
– On-demand (OD)
• Same exact requirements as COD…
Service Packs and Hotfixes

• ISM model continued


– Cumulative Update (CU)
• Update released every two months
• Incremental numbers (CU1, CU2, CU3)
• Contains all previous COD and OD hotfixes rolled into
one update
• May contain other fixes as well
• All previous CUs since last service pack
Service Packs and Hotfixes

• ISM model continued


– General Distribution Release (GDR)
• “A GDR addresses an issue that has a broad customer
impact, that has security implications, or that has both”
– “An Incrementing Service Model…” – Microsoft Product Support, 2008

• Cannot be requested
– Released when MSFT decides
Service Packs and Hotfixes

• Service Packs
– Usually rollup every COD, OD, CU and GDR since
the last service pack
– Service packs are cumulative
• SP3 includes all of SP1 and SP2
– Often include new features
Service Packs and Hotfixes

• ISM model:
Service Packs and Hotfixes

• We use “Product Level” to determine the


service pack level
– RTM = “release to manufacturer”
• The initial release
– SP1 = “Service pack 1”
Service Packs and Hotfixes

• We also use “Build Numbers” to track


what has been installed
– Tell us which hotfixes, COD, OD, service packs, et
al have been installed
– Most hotfixes increment the build number
Service Packs and Hotfixes

• Build Numbers
– To determine the service pack level, you can check
the build number
– To determine hotfix, COD, OD, et al, sometimes
you need to look at the file version
• Build numbers are built around initial
release and service packs
Service Packs and Hotfixes

• Sometimes you need the file version and the


build number
Version Build Number File File Version

SQL 2005 SP1 9.00.2047.00 9.00.2047.00


SQL 2005 SP2 9.00.3042.00 Microsoft.SqlServer.Mainten 9.00.3042.00
ancePlanTasks.dll

SQL 2005 SP2 refresh 9.00.3042.00 Microsoft.SqlServer.Mainten 9.00.3043.00


ancePlanTasks.dll

SQL 2008 RTM 10.0.1600.22


SQL 2008 CU1 10.0.1763
Service Packs and Hotfixes

• To determine your SQL Server build


number:

SELECT
SERVERPROPERTY('productversion'),
SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')
Service Packs and Hotfixes

• “How do I get the hotfix/service


pack/etc?”
– Some are publicly available (from microsoft.com)
– Others require you filling out an “I agree that, if
this breaks my system, it is my own fault” type of
form
– Others require contacting Microsoft and
convincing them that you are eligible for the hotfix
Service Packs and Hotfixes

• Remember: A CU will be released every


two months
– Well, not exactly. But close enough
– Put a recurring task to search for “SQL Server 2008
cumulative update”
Final Thoughts

• Be wary
– COD are least tested
– Service Packs are most tested
– Install what you need
– Use a test box
Final Thoughts

• Be prepared
– Often, removing a hotfix/service pack/etc requires
an uninstall/reinstall
– Be sure you back everything up before installing
– Be prepared to support multiple versions/builds
Things to Know Before You Install
SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
What Is Installed

• Management Tools
– SQL Server Management Studio (SSMS)
– SQL Server Configuration Manager
– sqlcmd
– Import and Export Data
– PowerShell
• Development Tools
– SSMS
– Business Intelligence Development Studio
– Visual Studio 2008
• Performance Tools
– SQL Profiler
– Database Engine Tuning Advisor
• Documentation and Tutorials
– Books Online (BOL)
What Is Installed

• SQL Server Management Studio (SSMS)


– The tool you’ll likely spend the most time with
since it does both DBA and development
• Backups, security, jobs
• Stored procedures, queries, creating/modifying objects
– Deserves its own video!
What Is Installed

• SQL Server Configuration Manager


– Allows DBAs to determine network configuration
and aliases of servers
– Used sparingly – often lots right after install and
then 1x per month thereafter
What Is Installed

• sqlcmd.exe
– Command line query and script execution engine
– Can do most of what SSMS can do
– Powerful scripting capabilities
What Is Installed

• Import and Export Data


– A wizard for importing and exporting….. DATA!
– Uses SQL Server Integration Services engine
– What type of data?
• SQL Server, Oracle, DB2, Sybase
• Excel, Access, text/flat files
• Any OLEDB or ODBC
Upgrading to SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
Upgrading

• First thing: decide what needs to be


upgraded
– Can upgrade an entire instance*
– Can upgrade just one user database
– Can upgrade all user databases
Upgrading

• This chapter only looks at upgrading an


entire instance
– Other chapters look at upgrading individual DBs
What Can You Upgrade?

• Upgrades only support 32-bit to 32-bit or


64-bit to 64-bit
– No 32-bit to 64-bit native upgrade path
– If needed, you will need to move individual DBs
What Can You Upgrade?

• What does the term “upgrade” mean?


– There are two different ways to view:
• Upgrading from a prior version (2000, 2005 only)
• Upgrading from a lower edition of SQL 2008
What Can You Upgrade?

• Upgrading from a lower edition of SQL


Server 2008 is usually:
– Upgrading from Express to a “paid” version
– Upgrading from Workgroup to Standard
– Upgrading from Standard to Enterprise
What Can You Upgrade?

• Requires least amount of planning and


prep-work
What Can You Upgrade?

• Upgrading from a different version of SQL


Server requires significant planning
– Are you upgrading to same edition?
– Are you upgrading 32-bit to 64-bit?
– Will file paths stay the same or change?
– Will CPU or memory requirements change?
– Is your SQL going to cause problems?
What Can You Upgrade?

• Upgrading from SQL Server 2000 to SQL


Server 2008 is a challenge
– So many architecture changes
• Upgrading from SQL Server 2005 is
relatively simple
Things That Will Block Your
Upgrade

• Basic stuff generally


– New server doesn’t meet hardware/software
requirements
– Will be blocked if there is a pending restart
– Windows Installer service must be running
What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
The SQL Server Upgrade Advisor

• Regardless of type of upgrade, install and


run the SQL Server Upgrade Advisor
– Ships with SQL Server
– Reports on incompatibilities and problems
• Before upgrading
– Correct any errors reported
– Note and act upon the warnings
– Note the informational messages
Upgrading to SQL Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
The SQL Server Upgrade Advisor

• Regardless of type of upgrade, install and


run the SQL Server Upgrade Advisor
– Ships with SQL Server
– Reports on incompatibilities and problems
• Before upgrading
– Correct any errors reported
– Note and act upon the warnings
– Note the informational messages
Upgrading SQL Server 2000 DTS
Packages

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
SQL Server 2000 DTS

• SQL Server Integration Services (“SSIS”) is


the replacement for SQL Server Data
Transformation Services (DTS)
• SSIS is radically different from DTS and
requires special consideration when
upgrading
SQL Server 2000 DTS

• In an in-place upgrade, DTS packages will


remain DTS packages in SQL Server 2008
– The upgrade will not “upgrade” your DTS packages
– You can continue to edit the DTS packages if you
install the SQL Server 2000 DTS Designer
– You can even use the Microsoft SQL Server
Backward Compatibility feature to run DTS
packages as-is
• 32-bit only!
SQL Server 2000 DTS

• To migrate DTS packages, run the


Package Migration Wizard (“PMW”)
– Right click on the package and select “Package
Migration Wizard”
– Can upgrade one package at a time or all packages
– Complete the steps to upgrade
SQL Server 2000 DTS

• After migrating to SQL 2008, you might


be surprised
• SSIS is similar to DTS just like Microsoft is
similar to Apple
SSIS / DTS Microsoft / Apple
Both are ETL tools Both write operating systems
Both installed with SQL Server Both sell MP3 players
Different ways of doing the Different ways of doing the
same things same things
SQL Server 2000 DTS

• Be prepared to do a lot of rewriting and


re-architecting
– Refactoring may take more time up-front but will
likely save hours and hours in the long run
– The ActiveX Script Task has been deprecated
• Often the functionality is replaced by a built-in SSIS task
– Complex data transfers will often need to be
rewritten
After You’ve Upgraded to SQL
Server 2008

Presented by Scott Whigham


What We’re Going to Cover

Installing for the 1st Time

Upgrading to SQL 2008


Overview

• Overview • Installing • What to


of Chapter Developer Do Before
• Things to Edition • Upgrade
Know • Working • What to
Before You with Do After
Install Instances
• Things to
Know After
You Install
After You’ve Upgraded

• Life is good, right?


• Check to make sure everything came
over as expected
– It probably did
• It’s a good time to change service
account passwords
– If you don’t already have a policy for doing so
After You’ve Upgraded

• Things you should test – “The Obvious”


– Do your DTS packages still work?
– Do your jobs still run?
– Your pre-upgrade Profiler trace queries – do they
still return same results?
– Does your application still work?
– Do the things that the Upgrade Advisor warned
you about fail?
After You’ve Upgraded

• Things you should test – “The Not-So-


Obvious”
– Do your datetime queries/applications still run
as expected?
• Failures using the Enterprise Library 4.x with .NET 3.5
and SQL 2008 for datetime and smalldatetime
After You’ve Upgraded

• Next steps
– Understand the configuration parameters
– Check your database compatibility
– Review “Suggested Changes After Upgrade” video

Anda mungkin juga menyukai