Download presentation
Presentation is loading. Please wait.
Published byGwenda Doyle Modified over 7 years ago
1
Install, Migration and Configuration Edition Mindy Curnutt
SQL Server BINGO Install, Migration and Configuration Edition Mindy Curnutt
2
About Me VP, Information Management, TMW
3X SQL Server/Data Platform MVP Idera Ace SQL Server since 6.5 / 1995 (20 Years) PASS Summit Speaker, 2005, PASS Program Manager 2015 & 2016
3
Thank You Idera! My speaking to you today was made possible through
the Idera ACE program.
4
Tailgate! When: Between sessions Where: Parking lot Why: Get up Move around Network Grab a drink or snack
5
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
6
Bingo Rules One or more Bingo Words per slide Words are GREEN First person to get 6 in a row on TWO different cards at once and yell BINGO wins a prize.
7
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
8
What’s the Big Deal? New Hardware New Operating System
Physical or Virtual New Operating System New Version of SQL Smallest downtime possible No unexpected issues
9
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
10
Disk Configuration Look at current disk
Qty Specification Configuration (ie: 2 mirrored disks in RAID 1, 6 disks in RAID 10) Performance The Right Foundation – up to 30% Better Performance! 64K Stripe Size Align Partition Offsets – Windows 2003 (so hopefully no longer applies!) File Allocation Unit Size – EVEN ON VMs Separate Log Files from Data Files Sequential IO version Random IO Separate TempDB Data Files from User DB Data Files
11
Disk Configuration File Allocation Unit Size (aka 64K Blocks)
Run this command from the Command Prompt for each drive: Fsutil fsinfo ntfsinfo d: Fsutil fsinfo ntfsinfo e: Etc… Values should be bytes (64KB) for partitions on which SQL Server data or log files reside. Cannot change the File Allocation Unit Size of the Boot Partition (C Drive), this is why you do not want SQL’s data or log files to reside on C.
12
Disk Configuration See Jimmy May’s 4-Part Blog Entry on Partition Alignment
13
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
14
OS / SQL Installation Operating System SQL Server
Everything should be 64 Bit, period. Drivers and Firmware (especially BIOS) Service Packs Anti-Virus should exclude SQL directories Use CPU-Z to verify Power Savings in not enabled for both Windows and at the BIOS level SQL Server 2008 sp4, 2008 R2 sp3, 2012 sp2, 2014 sp1… If OS is x64, be absolutely certain to use x64 SQL Server! Options during install
15
OS / SQL Installation SQL Server Options during Install
Windows Auth / Mixed Mode Authentication Don’t Need to Install: SQL Server Analysis Services Full Text Search Books Online May want: Replication Disable the SQL Browser service SQL Server & SQL Agent Service Auto-start Should have their own Domain Account
16
OS / SQL Installation DTS Designer Components
For SQL 2008 and SQL 2008 R2 Download and install the SQL Server 2000 DTS Designer Components Jobs that call DTS must be recreated using DTSRun.exe and by calling the actual name of the package. Each package can only have 1 version of itself going forward in this environment. For SQL 2012/2014 – must rewrite these as a pure SSIS package or Multi-Step Job calling TSQL, no support for DTS anymore, has been deprecated.
17
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
18
SQL Server Configuration
Max Server Memory configuration setting Lock Pages in Memory Permissions Instant File Initialization Permissions Max Degree of Parallelism Cost Threshold for Parallelism TempDB file quantity, growth size & location Check to see SQL is capable of using Memory Backup Compression Optimize for Ad Hoc Workloads XP_Cmdshell
19
SQL Server Configuration
Max Server Memory Maximum amount of Memory SQL is allowed to use Example SQL to set this option: Sp_configure ‘maxservermemory’, 7068 go Reconfigure Total GB GB for SQL GB for OS 4 n/a 8 7 1 16 14 2 32 28 64 56
20
SQL Server Configuration
Lock Pages in Memory permissions Granted to the account that the SQL Server and SQL Agent Service are running under For x64, only applicable for SQL Server Enterprise Edition For x64, can use with SQL Server Standard when: SQL Server 2008 SP1 Cumulative Update 2 SQL Server 2005 SP3 Cumulative Update 4 SQL Server 2012+ Place startup trace flag –T845 in SQL Server Service startup parameters Instant File Initialization Also referred to as Perform Volume Maintenance Tasks in Group Policy Give SQL Server Service enough permissions so that disk does not have to be cleared before SQL Server can “see it”
21
SQL Configuration To set Lock Pages in Memory and Instant File Initialization Permissions Click Start, click Run, type gpedit.msc, and then click OK. The Group Policy dialog box appears. Expand Computer Configuration, and then expand Windows Settings. Expand Security Settings, and then expand Local Policies. Click User Rights Assignment, and then double-click Lock pages in memory. In the Local Security Policy Setting dialog box, click Add User or Group. In the Select Users or Groups dialog box, add the account that has permission to run the Sqlservr.exe file, and then click OK. Within the same User Rights Assignment node, now double-click Perform Volume Maintenance Tasks.
22
SQL Server Configuration
Max Degree of Parallelism Maximum quantity of Processors for any 1 query Example SQL to set this option: Sp_configure ‘maxdegreeofparallelism’, 4 go Reconfigure Qty of Cores Present Max Degree of Parallelism 2-4 n/a 8 4 16 8*
23
SQL Server Configuration
Cost Threshold for Parallelism Default is 5 Set to 25 and monitor cx_packet / waitstats
24
SQL Server Configuration
TempDB Data Files TempDB File Qty should equal the qty of Virtual CPUs or cores 1 per 4 physical cores limited to 8 and then monitor Should be evenly and generously sized Little likelihood for growth to ever take place -T1118 traceflag in SQL startup parameters Still only need 1 TempDB Log File OK if all in the same directory Unless your system is really taxed, doing the above is not critical. If your system is large and very busy, this is a definite, easy Best Practice to implement
25
SQL Server Configuration
Check to see SQL is capable of using Memory select (cntr_value/ )/ as MaxGBtoSQL from sys.dm_os_performance_counters where object_name = 'SQLServer:Memory Manager' and counter_name = 'Target Server Memory (KB)'
26
SQL Server Configuration
Backup Compression SQL 2008 forward, all editions of SQL Average 60-70% smaller & faster backups Higher CPU to do backup Cannot use with de-duplication technologies EXEC sp_configure 'backup compression default', '1'; RECONFIGURE WITH OVERRIDE; GO
27
SQL Server Configuration
Optimize for Ad Hoc Workloads Single Use Plans create a hash only Xp_cmdshell Jobs that must do work outside SQL (backup cleanup, FTP…) EXEC sp_configure 'optimize for adhoc workloads', '1'; EXEC sp_configure 'xp_cmdshell', '1'; RECONFIGURE; GO
28
SQL Server Configuration
Trace Flags to Consider -T835 : Lock Pages in Memory (2005, 2008, 2008R2 only) – KB970070 -T1118 : TempDB Concurrency Enhancements – KB328551 -T3226 : Backup info not in Error Log useful if running frequent log backups -T2371 : Auto-Update statistics mod counter scaling – KB -T4199 : Enable Hotfixes that could effect Query Plans – KB974006
29
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
30
Migrating Databases For TESTING Restore Placeholder Databases
Find your most recent BAK file of each User DB that you will be migrating Run the following:
31
Migrating Databases Once TESTING is Done Plan Your Strategy
Log Shipping (least downtime) Backup / Restore MDF/NDF/LDF - Detach/Attach
32
Migrating Dependent Objects
Migrate Logins SQL 2000 to 2005/2008/2012 – see KB246133 SQL 2005 to 2005/2008/2012/2014 – see KB918992 Great Plains – see KB878449 Both create and use sp_help_revlogin A script that creates a script – run against “old” server. Take results and run those against the “new” server. No need to “sync” logins, if you are doing that, you’ve gone down the wrong path Passwords remain intact Passwords on SQL 2000 were not case sensitive. On SQL 2005/2008/2012/2014 they are, initial hiccups are likely!!
33
Migrating Dependent Objects
Migrate Logins Watch for “wrong password” errors in SQL Event Log Error : 18456, Severity 14, State 8
34
Migrating Dependent Objects
Migrate Logins Logins SIDs If Logins are migrated concurrently with the Database Backup/Restore or Database Detach/Reattach, there should not be a need to “resync” Logins Just in case, here is the code! In SSMS, point to the DB in question and run: EXEC sp_change_users_login 'Report' This will show you which Logins are “Orphaned”, to fix them, run the following for EACH EXEC sp_change_users_login 'Auto_Fix', 'user'
35
Migrating Dependent Objects
Migrate SQL Agent Jobs Do NOT Migrate jobs that call Maintenance Plans Script SQL Jobs using TSQL Expand JOB node in SSMS Hit F7 In Right Hand Pane, highlight jobs you want to script Select “Script Job As” / “Create To” Save File and Open on NEW server in SSMS Run Script Refresh Job Node on the New Server Test all Jobs * Later, Add Notifications on Failure * Good to have all Jobs scripted as part of your DR Plan
36
Migrating Dependent Objects
DTS Packages For SQL 2005 / SQL 2008 DTS Migration Wizard DOES NOT work Goal should be to eventually rewrite DTS packages using SSIS Right click on each DTS package and EXPORT as a .dts file On New Server, go to “Management” / “Legacy” / “Data Transformation Services” Right Click and choose “Import Package File” Must make sure there is only 1 version of the Package inside the file you imported. The new job will call the DTS package by NAME not by Version GUID like before. For SQL 2012 No Support for DTS whatsoever, completely deprecated. Must rewrite as SSIS packages or Multi-Step Jobs that call T-SQL.
37
Migrating Dependent Objects
Setup Database Mail and Alerts In SSMS on New Server, go to “Management” / “Database Mail” Right Click and Choose “Configure Database Mail” Choose “Setup” Server Name = “mail.yourcomp.com” or “smtp.yourcomp.com” or “exchange server name” or “exchange server IP address” Generally, leave Authentication Anonymous
38
Migrating Dependent Objects
Setup Database Mail and Alerts Manage Profile Security Checkbox PUBLIC for this new Profile Select it as the DEFAULT Profile Next / Next / Finish Test to see if it works Right Click on “Database Mail” again Choose “Send Test ” Put your address in the To: section and send. Connect it to the SQL Server Agent Go to SQL Server Agent / Alert System Click “Enable Mail Profile” Restart the SQL Server Agent Service
39
Migrating Dependent Objects
Setup Database Mail and Alerts Check to see that a Job can send an Alert when it Fails Right Click on a Job and choose “Properties” Choose “Notifications” Checkbox and choose the “SQLSupport” Profile Go to Steps Hit Edit on the 1st Step Slightly alter the Command so that it will not run Add an z_ as a prefix to the stored procedure name or make the SQL Syntax non-valid. Be sure to save what the command WAS so that you can put it back… Hit OK Right Click on the Job and choose “Start Job at Step” Go back and “Fix” the Job
40
Migrating Dependent Objects
Update Usage To avoid false corruption check errors, you must run the following on any SQL database migrated between versions: Dbcc updateusage(databasename)
41
Migrating Dependent Objects
Maintenance Plans Two choices Maintenance Plan Wizard(s) T-SQL Code (my preference) Minimum Requirements Daily Full Backups of Master and MSDB Daily Full Backups of all Production User DBs Hourly Transaction Backups of all Production User DBs Weekly Index Rebuilds of all DB Indexes Weekly Index ReOrganization of all DB Indexes Weekly Update of Statistics of all DBs Weekly Corruption Check Old Backup Cleanup Job MSDB Table Cleanup
42
Migrating Dependent Objects
Other Ideas for Maintenance Items Disk Space Check Long Running Job Repeated Failed Login Attempts Purging / Archiving “Intelligent” Jobs – run nightly (Ola Hallengren!) Index Rebuilds for logical fragmentation > 30% Index ReOrganization for logical fragmentation > 10% and < 30% Disabling Update Statistics for certain tables and handling manually MSDB Table Cleanup MSDB Job History Cleanup MSDB DBMail History Cleanup
43
Migrating Dependent Objects
Backup Location The Only Copy of your Backup Files Should NOT Be On The Same Server The Same Raid Array OR The Same SAN As your database files Hint: You can backup to a UNC path…if SQL is running under a Windows Account.
44
Migrating Dependent Objects
Extended Stored Procedures Linked Servers DSNs Mapped Drives Shares Windows Scheduled Tasks Same Folder Structure for Incoming / Outgoing Files Register CLR Libraries Practice “the Night of the Big Move” Procedures (timing & success) UAT
45
Agenda Other Considerations Bingo Rules What’s the Big Deal?
Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
46
Night of the “Big Move” Old Server New Server Disconnect all users
Put DBs to be moved into Single User Mode Perform Final Backup (Full or Tlog) Detach DB to be moved – no way anyone can connect on accident or put DB into Offline New Server Apply Final Transaction Log & Restore with Recovery <OR> Restore Full Backup <OR> Detach / Copy New Files in place / Attach Run dbcc updateusage()
47
Night of the “Big Move” If you are going to Rename your NEW SQL Server to have the name of your OLD SQL Server. After Machine is Renamed and Rebooted, must run the following within SQL: sp_dropserver <old_name> GO sp_addserver <new_name>, local Restart the SQL Server Instance Run the following to make sure the change “took” Select
48
Agenda Bingo Rules What’s the Big Deal? Disk Configuration
OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations
49
Other Considerations Reconnecting Applications
Servername Connection String Alterations SQL Driver Specifications (SQLNCLI..) Some applications will need restarting
50
Other Considerations Database Compatibility Mode
Stop / Disable SQLAgent on Old Server SQL Server & SQL Server Agent Accounts (Domain Acct or Local Service?)
51
Questions? Mindy Curnutt Event & Session Evals – ONLINE ONLY Event: Session:
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.