Thursday, April 16, 2015

No global profile is configured. Specify a profile name in the @profile_name parameter

As part of SQL Administration, today I wanted to setup a Maintenance Plan Tasks using Microsoft SQL Server 2008 to automate simple tasks such as rebuild index, reorganize index, etc.














I came up with an idea, it is best practice to do so, to add at the end of Maintenance Plan Tasks the "Notify Operator" Task in order to notify database administrators the result of carrying out Maintenance Plan.
sql server 2008 maintenance plan

I tried to manually execute the Maintenance Plan to see the outcome and got the following error:
sql server execute maintenance plan

Checking History Logs

1. I assume you are now in the Maintenance Plans under SQL Server Management Tools
2. Right click in one of you Maintenance Plans, then click "View History"
sql server 2008 view history
3. You will then see and figured out the error message which states "No global profile is configured. Specify a profile name in the @profile_name parameter"
sql server 2008 logs

4. Below the Log File Viewer were the details of the error

Task Detail: Notify Operator on Local server connection
                    Operator: (Name of the Operator)
Error Number: -1073548784
Error Message: Executing the query "EXECUTE msdb.dbo.sp_notify_operator @name=N'..." failed with the following error: "No global profile is configured. Specify a profile name in the @profile_name parameter.".
Transact SQL Command: View T-SQL


Error Interpretation:

The error says that it cannot find a Database Mail Profile in order to use it in sending email notification.

How to Setup Default Mail Profile

I will assume that you already  setup at least one Database Mail Profile. In SQL Server, you can do this through SQL Server Management Studio:
1. Go to Management > Database Mail (right-click - Configure Database Mail).

2. Click on Next.

3. Manage profile security.

4. Click on Next.
5. Then you will see a list with all the available database mail profiles. You have the option to select one of these profiles to be the Default Profile (by selecting ‘Yes’ in the combo box).


6. Click on Next.

7. Click on Finish.

Above solution works perfectly in my experience and hoping that it made your day :)



No comments:

Post a Comment