sql audit and performance impact.

Heisenberg 261 Reputation points
2022-01-20T22:07:34.293+00:00

we want to audit a table for DELETE operations. I want to capture login/programname/time of the user who deleted the rows for a particular table. I'm thinking of using Audit functionality of sql server. (Security folder and right-click Audits in SSMS). will this option have any performance impact on sql server or created any locking?

Ref: i will be using method mentioned in below article under section "Utilizing SQL Server Extended Events"
https://www.sqlshack.com/various-techniques-to-audit-sql-server-databases/

SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2022-01-20T22:22:21.787+00:00

    There will not be any locking issues.

    I don't know about the exact performance impact. As discussed in that article, SQL Audit is based on Extended Events, but I don't know exactly how SQL Audit uses Extended Events. What I do know is that if you have a workload that runs a lot of short quick statements, capturing sql_statement_completed in an true Extended Events session can cause a noticeable overhead, even if you have a good filter. But the events that SQL Audit uses may be more target and imply less overhead.

    I would suggest that you implement SQL Audit, and pay attention to if there are any complaints in the next few days.

    Also note that SQL Audit has a few options for controlling how to write to the file, which may be important at a busy site.

    I should add the disclaimer that I have not used SQL Audit a lot, but I'm just applying some common sense.

    0 comments No comments

  2. Heisenberg 261 Reputation points
    2022-01-21T13:46:51.79+00:00

    Thank you @Erland Sommarskog appreciate your help as always. I ve another question related to this. if at all there is performance impact with respect to extended events or running a profiler what kind of impact would it be. Does it impact disk throughput, memory usage or CPU usage?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.