Support
- Advanced Backup
- Client Side
- Cloud Enterprise
- ColdFusion
- Control Panel
- cPanel
- Customer Portal
- DNS Information
- Dedicated Servers
- DirectAdmin
- Domain Name
- dotDefender
- Dreamweaver
- FileCatalyst
- Front Page
- FTP
- General Information
- Hosted Exchange & SharePoint
- IIS6
- IIS7
- Juniper Netscreen Firewalls
- Linux
- List Server
- MIVA Merchant
- MySQL
- Patching / Server Updates
- phpMyAdmin
- Plesk
- Policies and Procedures
- Premium Spam Filtering
- Programming
- Ruby on Rails
- Search Engine Submission
- SharePoint 3
- SharePoint 2010
- SiteDesigner
- SmarterMail 3
- SmarterMail 4
- SmarterMail 5
- SmarterMail 6
- SmarterMail 7
- SmarterStats
- SmarterTrack
- SQL Server
- Accesstosql
- Addsqldatabase
- Addsqlpremium
- Aspenterprisemanager
- Backup2000
- Backup2005
- Enterprise Manager
- Expressdb
- Logfull
- Long Load
- Managementstudio
- Tcp Ip
- Userpermissions
- Whatsnew
- Sql
- Connect to a remote SQL Express server using SQL Management Studio Express
- Set up SQL 2005 Reporting Services
- Identifying SQL Injection
- SQL Server Tuning
- Back up all MS SQL databases at once
- Install SQL Reporting Services
- Restore a SQL 2005 database
- What is SQL Injection
- Server Principle Error when using SQL Management Studio 2008 to connect to your database
- Migrate Databases from SQL 2005 to SQL 2008 between Virtual or Dedicated Servers
- Configure Query Timeout Period in SQL Management Studio
- Automated SQL2005 Backups
- Automated SQL2008 Backups
- Large MSSQL Transaction Log
- How To Validate A SQL 2008 Cluster
- Microsoft SQL Cluster 2008 Private Heartbeat Connection
- Determining when SQL Server 2008 was Last Restarted
- Secure Socket Layer (SSL)
- Uploading Your Website
- Video Tutorials
- Windows Server 2003
- Windows Server 2008
- Web Design
- WordPress
- Advanced Monitoring
- MediaWiki
- Enkompass
- Microsoft Outlook 2010
- Android
- Outlook Web Access
- Critical Availability Service
- NAS Data Transfer
- Customer Portal Demos
- Joomla
- Moodle
- Cloud Dedicated
- Gallery CMS
- phpBB
- Standard Monitoring
- Righteous Restore
- NAS (Network Attached Storage)
- Networking
- SmarterMail 8
- PCI Security Scan
- LinkTiger
- Windows Cloud VPS
- Linux Cloud VPS
- Linux VPS
- Windows VPS
- Hyper V
- ENSIM
- Alert Logic
- Webmin
- e107
- Vbulletin
- VPN
- Visual Vault
- Mozilla Thunderbird
- PyroCMS
- Active Directory
- Vmware Related
- Drupal
SQL Server Tuning
Although tuning a database is fairly easy, you can make things worse if you don't know what you're doing. Be careful when performing this.
Check the DB_ID
- Create an account in SQL that has sysadmin rights. This user is to be removed upon completion of the tuning
- From your workstation, use Management Studio tpo log into the database server using a sysadmin SQL user
-
Expand databases, right-click the database you'll be profiling and select New Query
- Note: If you're using Enterprise Manager, go to Tools > SQL Query Analyzer
-
Execute the following query:
SELECT DB_ID() - Remeber the DB_ID number that was returned
Run a trace on the DB
- From your workstation, open SQL Profiler
- Choose File >> New Trace >> Connect
- Connect with the SQL sysadmin user you created earlier, this will open the Trace properties window
-
Choose the General tab
- Specify a Trace Name
- From the Use the template dropdown box select Tuning
-
Select the checkbox for Save to file
- Specify a location to save your trace to in the popup window
-
Choose the Events Selection Tab
- Select the Checkbox for Show all columns
-
Keep the existing Data Columns events selected and add these additional ones:
- CPU
- Reads
- Writes
- Click Column Filters
- Select DatabaseID from tjhe left side, expand Equals from the right side and specify the DB_ID from the previous section.
- Click Run
- Stop the trace after about 50,000-75,000 rows of data, or 1 hour - whichever comes first. See the notes below for reference while that is running.
- There is no correct number of events to capture or a correct amount of time to run the trace. As a general rule of thumb, get anywhere from 50,000-75,000 rows of data or 1 hour, whichever comes first.
- For very active databases it's best to ask someone with more experience for some help.
- It's very important to trace during a good time, not during backups - but likely during the time when the database is busiest.
While the trace is running, keep the following in mind:
Run the Tuning Advisor
This will put a heavy load on the server but should be performed during peak times in order to ensure accurate tuning results.
If you have a really small workload (say, less the 1MB) then you can do this whenever you want only if you keep an eye on performance on the db server to ensure it doesn't cause an unreasonable CPU spike or slows I/O too much.
-
Open the Database Engine Tuning Advisor
- Programs >> SQL Server 2005 >> Performance Tools
- Connect with the SQL sysadmin user you created earlier
- On the General tab
- Ensure the File radio button is selected in the Workload section.
- Click on the little binoculars button to locate the trace file(s) you created in the previous section
- From the Database for workload analysis drop down box select the database you are tuning.
- Select only the checkbox next to the database you are profiling at bottom of the screen.
- If you are running this late at night uncheck the Limit tuning time check box, otherwise, during the day keep it checked (and don't forget to monitor db server performance!!).
- Click the Start Analysis button and wait for the tuning recommendations to complete.
-
When the tuning completes go to the Actions menu and choose Save Recommendations.
- Save it to a location where it will be available for a week or so. You probably won't need the file but it's always good to keep it around for a week or two after the tune in case something needs to be rolled back.
- From the Actions select Apply Recommendations.
Note what % increase in performance the tuner said it would give, this is a theoretical improvement and what you will see from the application will likely not match the theoretical DB performance improvement.
Cleanup
- Remove the sysadmin user you created in the first section
