Red herring error "The user does not have permission to perform this action"

When starting the stored procedure, we get error 297

"The user does not have permission to perform this action"

This occurs during a heavy load (regularly when the trim job is performed at the same time). The error is cleared when the service that accesses SQL Server is restarted (and most likely the cropping work has completed), so these are clearly not real permission problems. The error is reported in the line of the stored procedure, which refers to the function, which, in turn, refers to the representations of dynamic control.

What situations can cause an error, for example, when it is not a problem with permissions?

Is it possible to enable trace flag 4616 to fix this, according to this article ? I would like to try, but you need more information. In addition, I am puzzled by the fact that this is a problem with an intermittent situation that occurs only during periods of high activity.

I tried to reproduce the same error in other situations (it also had no rights), and I found that when I started on SQL Server 2005, I got a permission problem:

select * from sys.dm_db_index_physical_stats(66,null,null, null, null)

(66 is an invalid DBID.)

However, we do not use dm_db_index_physical_stats with the wrong DBID. We use dm_tran_session_transactions and dm_tran_active_transactions, but they do not accept parameters, so I cannot get an error to happen to them. But I thought the problem was related.

Thanks for any ideas.

+3
3

concurrency?

, temp? , sp_getapplock

? GRANT VIEW SERVER STATE TO xxx?

, , EXECUTE AS -, ..?

: , GO proc GRANT. , SP . , concurrency - , ?

+4

, , Profiler , .

? , SQL Agent Job? . , , diff. .

,

0

Thank you all for your input. What I did (it seems that the problem has been fixed at the moment) changes the daily work of the finish. Now it is much longer between deletions, and also deletes a much smaller piece of records at a time.

I will talk about this later with additional information when I receive it.

Thanks again.

0
source

Source: https://habr.com/ru/post/1742151/


All Articles