Universal_SQL_Installations_Framework

Universal SQL Installations Framework (Script review and Demo)
SQL Saturday, San Diego – Sep 19 2015
Prakash Heda
Database Team Lead at Advent Software
Blog: www.SQLfeatures.com
Twitter @PrakashHeda
Email/Facebook/LinkedIN: [email protected] MCDBA/MCITP
Speaker Evaluation
Agenda
Why
Supported Configuration
DEMO Part 1
Advance Preparation
Script Review
How to Execute Script
DEMO Part 2
Why
Consistency in ENVs
Developers knows what to expect in DEV/QA/Stage/Prod
Anyone in IT can deploy a new envs
Smooth coordination between different IT departments
Minimizing production issues
Minimizing support hours
Easy upgrades
Optimal Setup for dedicated SQL Host
Easy troubleshooting
Minimize mundane tasks
Supported Configuration
Infrastructure
OS Versions
SQL Version
•
•
•
•
•
• Windows
2008 R2
• Windows 2012
• Windows 2012
R2
• SQL Server 2008
R2
• SQL Server 2012
• SQL Server 2014
Amazon AWS EC2
Windows Azure
VMware
Hyper-V
Physical servers
Any Service Pack/Cumulative update/Hotfix
Standard/Enterprise/Developer
Demo Application: SQERA
Version 1 – Windows 2008 R2– SQL 2008 R2 Standard Edition –
SP2CU1
Version 2 – Windows 2012– SQL 2012 Standard Edition –
SP2CU7HF
Version 3 – Windows 2012 R2– SQL 2014 Enterprise Edition –
SP1CU2
Version 4 – Windows 2012 R2– SQL 2016 Enterprise Edition –
CTP2.3
How to Execute Script
powershell \\W12R2HV\SQLSetup\Demo\InstallSQL\InstallSQL.ps1
• <SQL Service startup account> #sqlfeatures\svcSQLfeatures
• <SQL Service startup account Password> #Tester1! <<Minimum 8 digit toupgh
password>>
• <SA Password> #SAtemp2014
• <Product Code> #SQERA_V2
• <SQL Binary Top Location> #\\W12R2HV\SQLSetup\SQLBinaries\ (Optional)
powershell \\W12R2HV\SQLSetup\Demo\InstallSQL\InstallSQL.ps1
sqlfeatures\svcSQLfeatures Tester1! SAtemp2014 SQERA_V2
"sqlfeatures\SQLDBA"
Preparation: Windows Template
Pick an OS
Update OS with latest patches
Dot Net 3.5 installed
Add E drive with 50GB as thick
Add F drive as 20GB for file stream – Optional (XML)
Disable Automatic Windows update
Grant PowerShell unrestricted and bypass rights
Disable UAC
Disable Internet
Preparation: Accounts
Installation user account should have local admin
access
SQL service startup account should be a domain
account
Windows domain group represent DBA team should
have SA And Local administrator access to SQL Server
Preparation: SQL Slipstreaming
SQL Server 2008 - R2
• Service Pack: PCUSOURCE
• CU and Hotfix: CUSource
SQL Server 2012/2014/2016
• Cumulative updates: CU folder
Not using configuration files
Preparation: SQL Binaries Folder
Preparation: Install.XML (Basic SQL Installation Template)
Template detail
Id
SQLVersion
Product
SQLComponents
SQLBinaries
SP
CU
INSTANCEDIR
SQLUSERDBDIR
SQLUSERDBLOGDIR
SQLTEMPDBDIR
SQLTEMPDBLOGDIR
SQLBACKUPDIR
FilestreamFolder
CLTRESULTDIR
CLTWORKINGDIR
INSTANCENAME
Collation
DotNet4Location
Values
51
SQL2014
SQL_2014_ENT
SQLENGINE,REPLICATION,FULLTEXT,DQ,RS,RS_SHP,RS_SHPWFE
,DQC,CONN,IS,BC,SDK,BOL,SSMS,ADV_SSMS,SNAC_SDK,MDS
SQL2014\Ent
SQL2014\SPs\CU6_HF
E:\SQLData
E:\SQLData
E:\SQLLogs
E:\MSSQL\SQLTempDBData
E:\MSSQL\SQLTempDBLog
E:\SQLBackup
E:\Filestream
E:\MSSQL\DRC\CLTRESULTDIR
E:\MSSQL\DRC\CLTWORKINGDIR
MSSQLSERtVER
Usage
Unique Number
SQL Edition
Unique Product Name
Features installed
SQL Binary location RTM
SQL Binary location SP (only valid for SQL 208 R2)
SQL Binary location for all patches
SQL Instance Directory
SQL Data File Directory
SQL Log File Directory
SQL TempDB Data File Directory
SQL TempDB Log File Directory
SQL Backup Directory
SQL File-Stream Directory
Replay load folder
Replay load folder
Default Installation
Default SQL Server Collation
if DotNet 4.0 needed to be installed on DB server
Note: Values in RED can be changed to suit a product requirement
Script Review: Pre SQL Steps
Install Failover Cluster
Install Telnet client
Install Dot Net Framework
Disable IE security
Disable UAC
Disable Firewall
Disable IPV6
TempDB data files for each CPU (Max 4)
Create folders based on XML configuration
Grant Local Administrator access to SQL Startup account and DBA Group
Script Review: Post SQL Steps (1)
Grant privileges
•Lock Pages in Memory
•Perform Volume Maintenance Tasks
•Log on as a service
•Log on as a batch job
Script Review: Post SQL Steps (2)
Configure Min/Max Memory
• 4GB = 2.7 GB set for Min and Max RAM
• 8GB = 6.5 GB set for Min and Max RAM
• More than 8GB: keep 2GB for OS rest set for Min and Max RAM
Creating additional TempDB data files based on CPU (Max 4)
Grant sysadmin access to SQL Service startup account
Grant sysadmin access to DBA group
Enable backup compression
Update MAXDOP to 4
Create SSPI entry
Update windows patches again
Blog:
www.SQLfeatures.com
Twitter
@PrakashHeda
Speaker Evaluation
Facebook/Email/LinkedIN:
[email protected]
Script & Presentation DAC