March 1, 2007 at 11:34 am
I'm looking for a way to monitor the usage of SQL views and stored procedures. I have several hundred views across quite a few servers with no documentation...
Some views are redundant for sure but I would like to find out which views are being used, if possible.
March 2, 2007 at 5:45 am
a profiler trace would be your only real option, unless you write an audit table update into each object , you can use something like this in a proc
I don't have any ideas on views other than a profiler trace that only picks views, triggers don't work on selects - hopefully someone else will have an idea on views.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
March 2, 2007 at 7:56 am
Nothing to add here. Profiler is the only real option.
You can add the code to all the sps, but that still leave a lot of holes in the code (direct table/view/function access).
March 7, 2007 at 1:56 pm
I have been playing with the profiler and it should give me what I need if I let it run a while. What I have not found yet is which filter will show the name of the object being accessed, view or stored procedure. Does anyone know which filter will return that information?
March 7, 2007 at 2:36 pm
I can't seem to get this column to show any data. Right now all I can offer is to parse the command text for object names... For from the best solution if you want my opinion.
March 7, 2007 at 3:36 pm
I've never found the names show, capture the object id and then join back to get the name, or use object_name(id) if only one database
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
March 8, 2007 at 7:47 am
I figured I might have to parse the Object ID from the output and query the System Tables to retrieve the objects name. Just another step...
Thanks for the support.
March 8, 2007 at 8:56 pm
March 9, 2007 at 4:09 am
Shekar,
the data would have got saved.Its just that the maximum charaters that you can view in result is set to 356. increase it to 8000 and then probably you will be able to see the results.
March 9, 2007 at 5:37 am
and doesn't this catch so many people out !!
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
March 9, 2007 at 8:06 am
Stopped counting many moons ago.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply