This article contain detailed steps to install SQL server 2008 R2 with best practices and guidelines from Microsoft and other many blogs over the internet, and I try to put all these best practices and guidelines in one article with step by step installation guide.
Pre-Installation Steps
Before install SQL server 2008 R2, we need to check the pre-install requisites:
Operating Systems Requirements:
- Plan to install SQL on a NTFS file system
- Do no try to install SQL Server on a compressed, encrypted or read-only drive, because setup will block the installation
- Do not install SQL Server on a Domain Controller.
- Verify Windows Management Instrumentation service (Control Panel -> Administrative Tools -> Services) is running
- Configure your firewall to allow SQL Server access. Click here for more information about protocols and port numbers
- Create dedicated service account for each service to be installed. Ensure that these accounts are not member of Local Administrator because it will give unnecessary rights to these accounts, see SQL services accounts
- The user account that is running SQL Server Setup must have administrative privileges on the computer, see SQL services accounts
- Group all SQL services accounts in one AD Organization Unit for easy management and understandable hierarchy.
- At least 6.0 GB of disk space are required by SQL Server setup
Additional software requirements and hardware requirements:
- Enable .NET Framework 3.5.
- PowerShell 2.0.
Note: run Windows Updates to get latest updates after install and check all previous requirements.
SQL services accounts
For a SharePoint installation, this section recommends the following best practices and naming conventions for service accounts. In your deployment, you may not need all these accounts
SQL_Admin |
SQL Admin on the SQL Server. Used to Install the SQL Server. |
Local Administrator on the SQL Server |
Domain User |
SQL_Agent |
It is the service account for the following SQL Server services: SQL SERVER AGENT. |
None |
Domain User |
SQL_Engine |
It is the service account for the following SQL Server services: Database Engine. |
None |
Domain User |
SQL_Reporting |
It is the service account for the following SQL Server services: SQL Reporting Service. |
None |
Domain User |
SQL_Analysis |
It is the service account for the following SQL Server services: SQL Analysis Service. |
Non |
Domain User |
From practical experience, create a security group for SQL Administrators “SQL_Admins_Grp“, and add the “SQL_Admin” to this security group. In future if you want to want to give SQL Admin permission to any user; just add the user to this group and it will inherit all permission setting from this group in SQL server.
After create the Organization Unite and Service Accounts in Active Directory, you should have the following service accounts in AD:
Login to all SQL Server(s) as domain admin, and add SQL_Admins_Grp security group to Local Administrators Group on all SQL Server(s).
Now, you are ready to next step: install SQL Server 2008 R2.
Installation Steps
The following is the steps to install SQL server 2008 R2 on Windows Server 2008 R2 with SP1
- Login to SQL Server using SQL_Admin account
- Insert SQL Server Setup media and Open it, select “setup.exe” file, and Right-Click on it and select
Run as administrator
- The “SQL Server Installation Center” will be open, Select “Installation” from left menu, then select first option for new SQL server installation
- The “Setup Support Rules” form will open and check some SQL pre-requests to identify problems that might occur when you install SQL Server Setup Support files. Make sure all checks are passed, then click “OK” button to move for next step.
- The “Product Key” form will open, you should enter the Product Key in this form or select “Evaluation” as a free edition, click “Next” to move for next page.
- Accept the License Terms and click on “Next” button
- Click on “Install” button, to start installation of Setup support Files
- Installation of “Setup Support Files” will start
- After finish Installation of “Setup Support Files”, click on “Next” button to move for next Page.
Please note the Windows Firewall warning, make sure you add “Inbound rule” in Fire to allow SQL Access ports
- In “Feature Selection” page, select needed services and SQL management tools. Click “Next” button to move for next page
Please to make sure you change the installation directory drive. Do not install SQL server on system drive (C: Drive)
- In “Installation Rules” page, make sure all rules are passed or skipped (green checked), click on “Next” button if there is no Failed check.
- In “Instance Configuration” page, select “Default Instance” and change the directory path of “Instance root directory”, you can change the instance name for advanced setting and scenarios.
Please to make sure you change the installation directory drive. Do not install SQL server on system drive (C: Drive)
- In “Disk Space Requirements” page, just check if you have available space and click on “Next” button
- In “Server Configuration”, in “Service Accounts” Tab, enter the service account username and password for each SQL service as following
- In “Server Configuration”, in “Collation” Tab, click “customize” button and select the following collation “Latin1_General_CI_AS_KS_WS“, this is the recommended collation for SharePoint Content Databases
when click on “customize” button, make sure you select the following option:
- After finish the Service accounts and Collation settings, click on “Next” button.
- In “Database Engine Configuration” page, In “Account Provisioning” Tab, Select “Mixed Mode” to provide alternative access to Database engine using default “SA” account (SQL Authentication), enter the password for “SA” account.
Add the Security Group “SQL_Admins_Grp” as SQL server administrators, to set SQL administration permissions for this group and all members of this group
- In “Database Engine Configuration” page, In “Data Directories” Tab, make sure the directories path is not a system drive.
- In “Database Engine Configuration” page, In “FILESTREAM” Tab, enable FILESTREAM feature for advance and future needs like enabling Remote Blob Storage with FILESTREAM. You can skip this feature if there is no plan for FILESTREAM.
- Click on “Next” button, to move for next page
- In “Analysis Services Configuration”, In ”Account Provisioning” Tab, Add “SQL_Admins_Grp” security group to have administration permissions for Analysis services
- In “Analysis Services Configuration”, In “Data Directories” Tab, make sure the directories path is not a system drive
- Click “Next” button to move for next page.
- In “Reporting Services Configuration” page, select third option, to install reporting service, but you will configure it later when needed. Click on “Next” button to move for next page.
- In “Error Reporting” page, select the check box to send Windows and SQL Error Reports to Microsoft to participate in enhancements and fixing errors for next SQL server updates or next releases. Click “Next” button to move for next page.
- In “Installation Configuration Rules” page, make sure all check list are passed or skipped (green check), click “Next” button to continue
- In “Ready to Install” page, check your selected configuration, then click on “Install” button to start SQL installation process.
- Installation Progress page will open and show you the installation progress
- After successful installation, the “Complete” page will open to confirm your installation. Click on “Close” button to close installation wizard
Note: run Windows Updates to get latest updates after successful installation of SQL server 2008 R2.
Post-Installation Steps and Checklist
The following is post installation and tuning steps for SQL server
- Set max degree of parallelism (MAXDOP) to 1 for instances of SQL (SP will do this when SP is installed). Number of processes for each SQL statement.
- Memory: You can set the max memory each SQL instance can use. If the machine is dedicate to only provide SQL for SharePoint, the max setting is total memory minus 4GB for the OS.
- Maximum size for a DB recommended by MS is 200GB, however it can support up to 16TB
- Never use Simple recovery mode for production SharePoint SQL databases, always use Full recovery mode
- The SharePoint Config database is what comprises the actual SharePoint farm configuration information like IIS Settings, Farm solutions, Topology info, etc. This database is read intensive and can range between 0-5GB size
-
Tempdb best practices:
- Number of tempdb files should be 1/4th or 1/2 the number of processor cores on SQL server – This is a practice that needs real data from your existing system to see if tempdb is creating a bottleneck and whether or not increasing the number of db files will increase performance.
- Tempdb size should be roughly 10% of total content DBs
- Autogrowth setting should be in MB and not a percentage
- Tempdb should use Simple Recovery Model
- Tempdb should be placed on different drive than content databases file
- Tempdb: The default is 1, you need more than this depending on how many CPU cores are on your database server. 1 option is set the number of TempDB’s to the same as the number of CPUI cores (1-to-1). Some folks recommend the number of tempDB’s should be 1 less than the number of cpu cores, other folks go for 1 TempDB per 2 CPU cores.
- Number of tempdb files should be 1/4th or 1/2 the number of processor cores on SQL server – This is a practice that needs real data from your existing system to see if tempdb is creating a bottleneck and whether or not increasing the number of db files will increase performance.
-
Model DB best practices:
- Work with SharePoint Admin to identify default initialize size for model db and its log file
- Don’t modify DB Collation after install
- Set the autogrowth in MB and not in percentage (Note: Databases created by SharePoint does not copy autogrowth settings from Model DB)
- Increase initial size and autogrowth settings – fix growth sizes. I would start with 100MB for the mdf and 50MB for the ldf for initial sizes.
- Use Full recovery model on the Model system database – Simple prevents large log files
- Work with SharePoint Admin to identify default initialize size for model db and its log file
I hope this is Useful for You