Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Server BINGO Install, Migration and Configuration Edition Mindy Curnutt TMW Systems, Inc. VP, Information Management SQL Server MVP

Similar presentations


Presentation on theme: "SQL Server BINGO Install, Migration and Configuration Edition Mindy Curnutt TMW Systems, Inc. VP, Information Management SQL Server MVP"— Presentation transcript:

1 SQL Server BINGO Install, Migration and Configuration Edition Mindy Curnutt TMW Systems, Inc. VP, Information Management SQL Server MVP Twitter: @sqlgirl

2 About Me [ 2 ] Wife & Mother Busy-Bee Musician Soap Making Baking Crocheting Business Owner Event Planning

3 About Me VP, Information Management, TMW SQL Server MVP SQL Server since 6.5 / 1995 (20 Years) SQLPASS Speaker, 2005, 2012, 2013, 2015 PASS Program Manager 2015 Twitter: @sqlgirl Email: mindycurnutt@hotmail.com

4 Platinum Level Sponsors Pre Conference Sponsor Venue Sponsor Key Note Sponsor Gold Level Sponsors

5 Silver Level Sponsors Bronze Level Sponsors

6 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

7 Bingo Rules Bingo Word must be visible in GREEN on a slide AND Must be SPOKEN by the instructor before you can mark the word on your card. First person to get 6 in a row on TWO different cards at once and yell BINGO wins a prize. (no diagonal in this game)

8 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

9 Getting Started  What are you planning? – quick poll.  Same or New Server?  Shared or Dedicated?  Version (from and to)?  SQL Server Edition?  Virtual or Physical?

10 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

11 Disk Configuration  Physical Disk  Specification – 15K RPM  Configuration (ie: 2 mirrored disks in RAID 1, 6 disks in RAID 10)  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

12 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 65536 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.

13 Disk Configuration  See Jimmy May’s 4-Part Blog Entry on Partition Alignment http://blogs.msdn.com/b/jimmymay/archive/200 8/10/14/disk-partition-alignment-for-sql-server- slide-deck.aspx

14 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

15 OS / SQL Installation  Operating System  Everything should be 64 Bit, period.  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 levelCPU-Z  SQL Server  SQL 2008 SP4, 2008 R2 SP3, SQL 2012 SP3, SQL 2014 SP1 + CUs?  http://sqlserverbuilds.blogspot.com/ http://sqlserverbuilds.blogspot.com/  If OS is x64, be absolutely certain to use x64 SQL Server!  Options during install

16 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

17 OS / SQL Installation  DTS Designer Components  For SQL 2008 and SQL 2008 R2  Download and install the SQL Server 2000 DTS Designer Components http://download.microsoft.com/download/4/4/D/44DBDE61- B385-4FC2-A67D- 48053B8F9FAD/SQLServer2005_DTS.msi http://download.microsoft.com/download/4/4/D/44DBDE61- B385-4FC2-A67D- 48053B8F9FAD/SQLServer2005_DTS.msi  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.

18 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

19 SQL Server Configuration  Max Server Memory configuration setting  Lock Pages in Memory Permissions  Instant File Initialization Permissions  Max Degree of Parallelism  TempDB file quantity, growth size & location  Check to see SQL is capable of using Memory  Optimize for Ad Hoc Workloads  XP_Cmdshell

20 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 go Total GBGB for SQLGB for OS 4n/a 871 16142 32284 64568

21 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”

22 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.  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.

23 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 go Qty of Cores PresentMax Degree of Parallelism 2-4n/a 84 168*

24 SQL Server Configuration  TempDB Data Files  TempDB File Qty should equal the qty of Virtual CPUs or cores  2 – Quad Cores = 8 Virtual CPUs or Cores = 8 TempDB Data Files  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/1024.00)/1024.00 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  Trace Flags to Consider  -T835 : Lock Pages in Memory (2005, 2008, 2008R2 only) – KB970070KB970070  -T1118 : TempDB Concurrency Enhancements – KB328551 KB328551  -T3226 : Backup info not in Error Log useful if running frequent log backups  -T4199 : Enable Hotfixes that could effect Query Plans – KB974006KB974006

27 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

28 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:

29 Migrating Databases  Once TESTING is Done  Plan Your Strategy  Log Shipping (least downtime)  Backup / Restore  MDF/NDF/LDF - Detach/Attach

30 Migrating Dependent Objects  Migrate Logins  SQL 2000 to 2005/2008/2012 – see KB246133KB246133  SQL 2005 to 2005/2008/2012/2014 – see KB918992KB918992  Great Plains – see KB878449KB878449  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!!

31 Migrating Dependent Objects  Migrate Logins  Watch for “wrong password” errors in SQL Event Log  Error : 18456, Severity 14, State 8

32 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'

33 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

34 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.

35 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

36 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 E-Mail”  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

37 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 E-mail and choose the “SQLSupport” Profile  Go to Steps  Hit Edit on the 1 st 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

38 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)

39 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

40 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

41 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.

42 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

43 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

44 Night of the “Big Move”  Old 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  Restore Full Backup  Detach / Copy New Files in place / Attach  Run dbcc updateusage()

45 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 GO sp_addserver, local GO  Restart the SQL Server Instance  Run the following to make sure the change “took” Select @@servername

46 Agenda Bingo Rules Getting Started Disk Configuration OS/ SQL Install SQL Server Configuration Migrating Databases and Dependent Objects Night of the “Big Move” Other Considerations

47  Reconnecting Applications  Servername Connection String Alterations  SQL Driver Specifications (SQLNCLI..)  Some applications will need restarting

48 Other Considerations  Database Compatibility Mode  Stop / Disable SQLAgent on Old Server  SQL Server & SQL Server Agent Accounts (Domain Acct or Local Service?)

49 Questions? Mindy Curnutt Twitter: @sqlgirl Email: mindycurnutt@hotmail.com


Download ppt "SQL Server BINGO Install, Migration and Configuration Edition Mindy Curnutt TMW Systems, Inc. VP, Information Management SQL Server MVP"

Similar presentations


Ads by Google