When using the Refresh Aggregated Data in the Reports option from the Sitecore Control Panel, the following error may occur:
System.ExceptionMessage: Cannot find the object "Cache_TrafficByDay" because it does not exist or you do not have permissions.
Source: Sitecore.Kernel
at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteNonQuery()
at Sitecore.Data.DataProviders.Sql.SqlDataApi.Execute(Stringsql, Object[] parameters)
at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlMaintenance.UpdateReportsSummary()
at Sitecore.Shell.Applications.Analytics.Reports.Summary.UpdateForm.UpdateReportsRunner.Run()
Nested Exception Exception: System.Data.DataExceptionMessage: Error executing SQL command: execsp_sc_refresh_views
This error occurs if the SQL account lacks necessary permissions to execute the corresponding stored procedure, for example, if the system is configured to connect to the SQL Server Analytics database using an account that only has the db_datareader and db_datawriterpermissions.
Solution 1:
Assign the db_owner role to the SQL user account.
Solution 2:
Assign "Execute" and "Alter any Schema" permissions to the SQL user account.