Problem
I run into an issue today. When trying to run Database Engine Tuning Advisor (part of SQL Server Management Studio 2008) on a SQL Server 2008 instance that was upgraded form a SQL Server 2005 instance, I got the error below:
Cannot initialize tuning. (.Net SqlClient Data Provider)
===================================
User does not have enough permissions to tune one or more of the databases specified. (.Net SqlClient Data Provider)
------------------------------
For help, click: here
------------------------------
Server Name: {removed}
Error Number: 31003
Severity: 16
State: 1
Procedure: sp_DTA_add_session
Line Number: 88
Of course, the error message is quite obscure, misleading you towards believing that it’s a permissions issue. However, documentation clearly states that a db_owner can run the tool. Investigating the issue I found out that some DTA-related tables and stored procedures from the MSDB database differ between 2005 and 2008 and they were not upgraded during the migration to 2008.
Solution
So, it’s pretty clear what the solution is:
Option A. Delete all DTA-related objects from the MSDB database and run the Database Engine Tuning Advisor using a sysadmin user so that it re-creates the structures.
Option B. Compare the schemas and create and run an update script yourself. Keeping your DTA history requires some tweaking.
I opted for option A as I found it less of a hack than option B.
Tags: problem solving