Solved

SQL Tables/Fields Used the Most Frequently

Posted on 2015-02-23
8
45 Views
Last Modified: 2015-02-24
Hi Experts,

I've run into a bit of an interesting issue. I was tasked with ID'ing which tables (or more so, fields) are being accessed the most frequently in our SQL Server 2008 database in order to determine the most commonly used fields. I'm able to get table row counts, but this doesn't tell me how long ago the table was accessed (could be old data). I've come across sys.dm_db_index_usage_stats, however I don't have permissions to run it.

So, my question: can anyone think of a way to solve this issue when your permissions aren't too high?

Thanks in advance for all your help!
0
Comment
Question by:uga_godawgs
  • 4
  • 2
  • 2
8 Comments
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 250 total points
ID: 40626937
No.  You will definitely need access to the system views, at the very least, to determine how frequently a given table is used.
0
 

Author Comment

by:uga_godawgs
ID: 40627917
Hi Scott,

Thank you for your answer and here's some more detail that might help. I'm able to get to some of the system views, such as sys.partitions, sys.syscolumns, sys.tables and sys.objects. It seems like sys.dm_db_index_usage_stats is one of the few that I cannot access. Does this help develope a solution?

Thanks!
0
 
LVL 47

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 250 total points
ID: 40627978
You can know when a table was accessed but for that you really need access to sys.dm_db_index_usage_stats.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:uga_godawgs
ID: 40628193
OK. Thanks for both of your help. Any idea what access I would need to request? Hopefully, it's not admin...
0
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 40628209
Requires VIEW SERVER STATE permission.
0
 

Author Comment

by:uga_godawgs
ID: 40628282
As always, Experts, I thank you for your help!
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40628646
Books Online is very helpful on what permissions you'll need for various objects.

For example, look under:
sys.dm_db_index_usage_stats
in BOL, "Permissions", and you'll see the "VIEW SERVER STATE" referenced above.
0
 

Author Comment

by:uga_godawgs
ID: 40628759
Thanks Scott..wasn't aware of BOL and will definitely take advantage in the future! Thanks again!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Help 27 45
What is the proper way to use for criteria in left join? 7 28
sql server query 6 9
divide by zero error 23 16
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question