January 24, 2013 at 7:15 pm
Hi,
I want to audit everything in sql server as much as possible..
For example who logged in, what queries are runned and by whom if possible target details also like ipaddress n all if possible.
Similar to application auditing and logging kind of.
Thanks in advance.
January 25, 2013 at 1:25 am
It sounds like profiler might be the tool for you.
If you are new to profiler I suggest "Mastering SQL Server Profiler" By Brad McGehee.
January 25, 2013 at 5:54 am
Since you're on SQL Server 2012, I would advise avoiding trace events. Instead focus on extended events. They're more light weight and much more programmable. There's no book available on that... yet. Jonathan Kehayias has started working on one. I know because I'm doing the technical edits for it.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 26, 2013 at 7:02 am
Grant Fritchey (1/25/2013)
Since you're on SQL Server 2012, I would advise avoiding trace events. Instead focus on extended events. They're more light weight and much more programmable. There's no book available on that... yet. Jonathan Kehayias has started working on one. I know because I'm doing the technical edits for it.
+1 on using XEvents. Can't wait for the book. Is there an estimated release date yet?
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
January 26, 2013 at 7:51 am
opc.three (1/26/2013)
Grant Fritchey (1/25/2013)
Since you're on SQL Server 2012, I would advise avoiding trace events. Instead focus on extended events. They're more light weight and much more programmable. There's no book available on that... yet. Jonathan Kehayias has started working on one. I know because I'm doing the technical edits for it.+1 on using XEvents. Can't wait for the book. Is there an estimated release date yet?
Jonathan is hoping for the summer. Don't hold your breath.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 29, 2013 at 9:05 am
I want to capture and save everything into database.
Thanks.
January 29, 2013 at 9:13 am
monilps (1/29/2013)
I want to capture and save everything into database.Thanks.
Logging all activity to a table could be disastrous for performance. The recommended way to handle auditing is to write to a file on disk. Later you can load that file to a table somewhere other than your production database and analyze or report on the data from there. Trace and XEvents both provide for writing information to a file.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
January 29, 2013 at 12:08 pm
Hi,
Have a look at Brent Ozar's website, loads of good scripts there (sp_Blitz).
Andrew
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply